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'); 29*69d9f829SGerman Lena$meta['auth0-key'] = array('string'); 30*69d9f829SGerman Lena$meta['auth0-secret'] = array('string'); 31*69d9f829SGerman 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'); 39551dc731SAndreas Gohr$meta['yahoo-key'] = array('string'); 40551dc731SAndreas Gohr$meta['yahoo-secret'] = array('string'); 413b2654aaSAndreas Gohr$meta['doorkeeper-key'] = array('string'); 423b2654aaSAndreas Gohr$meta['doorkeeper-secret'] = array('string'); 433b2654aaSAndreas Gohr$meta['doorkeeper-authurl'] = array('string'); 443b2654aaSAndreas Gohr$meta['doorkeeper-tokenurl'] = array('string'); 45d9818adbSMichael Große$meta['mailRestriction'] = array('string','_pattern' => '!^(@[^,@]+(\.[^,@]+)+(,|$))*$!'); // https://regex101.com/r/mG4aL5/3 46081812bfSMichael Große$meta['singleService'] = array('multichoice', 47081812bfSMichael Große '_choices' => array( 484304ef94SMichael Große '', 49*69d9f829SGerman Lena 'Auth0', 50081812bfSMichael Große 'Google', 51081812bfSMichael Große 'Facebook', 52081812bfSMichael Große 'Github', 53081812bfSMichael Große 'Yahoo', 54081812bfSMichael Große 'Doorkeeper',)); 55