xref: /plugin/oauth/conf/metadata.php (revision 69d9f82991950b3b2faf74ef33aee80457a1138b)
1<?php
2/**
3 * Options for the oauth plugin
4 *
5 * @author Andreas Gohr <andi@splitbrain.org>
6 */
7
8class setting_plugin_oauth extends setting {
9
10    function update($input) {
11        return true;
12    }
13
14    public function html(&$plugin, $echo = false) {
15        /** @var helper_plugin_oauth $hlp */
16        $hlp = plugin_load('helper', 'oauth');
17
18        $key   = htmlspecialchars($this->_key);
19        $value = '<code>'.$hlp->redirectURI().'</code>';
20
21        $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
22        $input = '<div>'.$value.'</div>';
23        return array($label, $input);
24    }
25
26}
27
28$meta['info']                = array('plugin_oauth');
29$meta['auth0-key']           = array('string');
30$meta['auth0-secret']        = array('string');
31$meta['auth0-domain']        = array('string');
32$meta['custom-redirectURI']  = array('string','_caution' => 'warning');
33$meta['facebook-key']        = array('string');
34$meta['facebook-secret']     = array('string');
35$meta['github-key']          = array('string');
36$meta['github-secret']       = array('string');
37$meta['google-key']          = array('string');
38$meta['google-secret']       = array('string');
39$meta['yahoo-key']           = array('string');
40$meta['yahoo-secret']        = array('string');
41$meta['doorkeeper-key']      = array('string');
42$meta['doorkeeper-secret']   = array('string');
43$meta['doorkeeper-authurl']  = array('string');
44$meta['doorkeeper-tokenurl'] = array('string');
45$meta['mailRestriction']     = array('string','_pattern' => '!^(@[^,@]+(\.[^,@]+)+(,|$))*$!'); // https://regex101.com/r/mG4aL5/3
46$meta['singleService']       = array('multichoice',
47                                     '_choices' => array(
48                                         '',
49                                         'Auth0',
50                                         'Google',
51                                         'Facebook',
52                                         'Github',
53                                         'Yahoo',
54                                         'Doorkeeper',));
55