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'); 299683193cSMichael Große$meta['custom-redirectURI'] = array('string','_caution' => 'warning'); 3043972fa4SAndreas Gohr$meta['facebook-key'] = array('string'); 3143972fa4SAndreas Gohr$meta['facebook-secret'] = array('string'); 3243972fa4SAndreas Gohr$meta['github-key'] = array('string'); 3343972fa4SAndreas Gohr$meta['github-secret'] = array('string'); 3443972fa4SAndreas Gohr$meta['google-key'] = array('string'); 3543972fa4SAndreas Gohr$meta['google-secret'] = array('string'); 36551dc731SAndreas Gohr$meta['yahoo-key'] = array('string'); 37551dc731SAndreas Gohr$meta['yahoo-secret'] = array('string'); 383b2654aaSAndreas Gohr$meta['doorkeeper-key'] = array('string'); 393b2654aaSAndreas Gohr$meta['doorkeeper-secret'] = array('string'); 403b2654aaSAndreas Gohr$meta['doorkeeper-authurl'] = array('string'); 413b2654aaSAndreas Gohr$meta['doorkeeper-tokenurl'] = array('string'); 42*d9818adbSMichael Große$meta['mailRestriction'] = array('string','_pattern' => '!^(@[^,@]+(\.[^,@]+)+(,|$))*$!'); // https://regex101.com/r/mG4aL5/3 43081812bfSMichael Große$meta['singleService'] = array('multichoice', 44081812bfSMichael Große '_choices' => array( 454304ef94SMichael Große '', 46081812bfSMichael Große 'Google', 47081812bfSMichael Große 'Facebook', 48081812bfSMichael Große 'Github', 49081812bfSMichael Große 'Yahoo', 50081812bfSMichael Große 'Doorkeeper',)); 51