xref: /plugin/oauth/conf/metadata.php (revision d313403c1ae2bd9fb3dd1e1d64a2d337d8c7c83e)
180852c15SAndreas Gohr<?php
280852c15SAndreas Gohr/**
380852c15SAndreas Gohr * Options for the oauth plugin
480852c15SAndreas Gohr *
580852c15SAndreas Gohr * @author Andreas Gohr <andi@splitbrain.org>
680852c15SAndreas Gohr */
780852c15SAndreas Gohr
826eb6013SAndreas Gohrclass setting_plugin_oauth extends setting {
926eb6013SAndreas Gohr
1026eb6013SAndreas Gohr    function update($input) {
1126eb6013SAndreas Gohr        return true;
1226eb6013SAndreas Gohr    }
1326eb6013SAndreas Gohr
1426eb6013SAndreas Gohr    public function html(&$plugin, $echo = false) {
1526eb6013SAndreas Gohr        /** @var helper_plugin_oauth $hlp */
1626eb6013SAndreas Gohr        $hlp = plugin_load('helper', 'oauth');
1726eb6013SAndreas Gohr
1826eb6013SAndreas Gohr        $key   = htmlspecialchars($this->_key);
1926eb6013SAndreas Gohr        $value = '<code>'.$hlp->redirectURI().'</code>';
2026eb6013SAndreas Gohr
2126eb6013SAndreas Gohr        $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
2226eb6013SAndreas Gohr        $input = '<div>'.$value.'</div>';
2326eb6013SAndreas Gohr        return array($label, $input);
2426eb6013SAndreas Gohr    }
2526eb6013SAndreas Gohr
2626eb6013SAndreas Gohr}
2726eb6013SAndreas Gohr
2826eb6013SAndreas Gohr$meta['info']                = array('plugin_oauth');
2969d9f829SGerman Lena$meta['auth0-key']           = array('string');
3069d9f829SGerman Lena$meta['auth0-secret']        = array('string');
3169d9f829SGerman Lena$meta['auth0-domain']        = array('string');
329683193cSMichael Große$meta['custom-redirectURI']  = array('string','_caution' => 'warning');
3343972fa4SAndreas Gohr$meta['facebook-key']        = array('string');
3443972fa4SAndreas Gohr$meta['facebook-secret']     = array('string');
3543972fa4SAndreas Gohr$meta['github-key']          = array('string');
3643972fa4SAndreas Gohr$meta['github-secret']       = array('string');
3743972fa4SAndreas Gohr$meta['google-key']          = array('string');
3843972fa4SAndreas Gohr$meta['google-secret']       = array('string');
39e5b447f5SKasper Rynning-Tønnesen$meta['dataporten-key']      = array('string');
40e5b447f5SKasper Rynning-Tønnesen$meta['dataporten-secret']   = array('string');
414c7f12a8SSteve Nolen$meta['keycloak-key']        = array('string');
424c7f12a8SSteve Nolen$meta['keycloak-secret']     = array('string');
434c7f12a8SSteve Nolen$meta['keycloak-authurl']    = array('string');
444c7f12a8SSteve Nolen$meta['keycloak-tokenurl']   = array('string');
454c7f12a8SSteve Nolen$meta['keycloak-userinfourl'] = array('string');
46551dc731SAndreas Gohr$meta['yahoo-key']           = array('string');
47551dc731SAndreas Gohr$meta['yahoo-secret']        = array('string');
483b2654aaSAndreas Gohr$meta['doorkeeper-key']      = array('string');
493b2654aaSAndreas Gohr$meta['doorkeeper-secret']   = array('string');
503b2654aaSAndreas Gohr$meta['doorkeeper-authurl']  = array('string');
513b2654aaSAndreas Gohr$meta['doorkeeper-tokenurl'] = array('string');
52d9818adbSMichael Große$meta['mailRestriction']     = array('string','_pattern' => '!^(@[^,@]+(\.[^,@]+)+(,|$))*$!'); // https://regex101.com/r/mG4aL5/3
53081812bfSMichael Große$meta['singleService']       = array('multichoice',
54081812bfSMichael Große                                     '_choices' => array(
554304ef94SMichael Große                                         '',
5669d9f829SGerman Lena                                         'Auth0',
57081812bfSMichael Große                                         'Google',
58e5b447f5SKasper Rynning-Tønnesen                                         'Dataporten',
59081812bfSMichael Große                                         'Facebook',
60081812bfSMichael Große                                         'Github',
61081812bfSMichael Große                                         'Yahoo',
624c7f12a8SSteve Nolen                                         'Doorkeeper',
634c7f12a8SSteve Nolen                                         'Keycloak'));
64*d313403cSAnna Dabrowska$meta['register-on-auth']    = array('onoff','_caution' => 'security');
65