X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FCasAuthentication%2FCasAuthenticationPlugin.php;h=17c5f49d7ecedef9b643139965b47d79ffb2e950;hb=8ea83aac48545e2cdf81b4787b14b86fe819aa19;hp=6b751a0aa4fa9e02b39d688e590e411e7851e682;hpb=78ed0348b0eaaebf7a51d55adc7e746cc5b43bbf;p=quix0rs-gnu-social.git diff --git a/plugins/CasAuthentication/CasAuthenticationPlugin.php b/plugins/CasAuthentication/CasAuthenticationPlugin.php index 6b751a0aa4..17c5f49d7e 100644 --- a/plugins/CasAuthentication/CasAuthenticationPlugin.php +++ b/plugins/CasAuthentication/CasAuthenticationPlugin.php @@ -36,10 +36,13 @@ set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/ext class CasAuthenticationPlugin extends AuthenticationPlugin { + const PLUGIN_VERSION = '2.0.0'; + public $server; public $port = 443; public $path = ''; public $takeOverLogin = false; + public $user_whitelist = null; function checkPassword($username, $password) { @@ -54,10 +57,10 @@ class CasAuthenticationPlugin extends AuthenticationPlugin case 'phpCAS': require_once(INSTALLDIR.'/plugins/CasAuthentication/extlib/CAS.php'); return false; - case 'CasloginAction': - require_once(INSTALLDIR.'/plugins/CasAuthentication/' . strtolower(mb_substr($cls, 0, -6)) . '.php'); - return false; } + + // if it's not our exception, try standard places + return parent::onAutoload($cls); } function onArgsInitialize(&$args) @@ -74,7 +77,7 @@ class CasAuthenticationPlugin extends AuthenticationPlugin return true; } - function onEndLoginGroupNav(&$action) + function onEndLoginGroupNav($action) { $action_name = $action->trimmed('action'); @@ -125,13 +128,16 @@ class CasAuthenticationPlugin extends AuthenticationPlugin function onInitializePlugin(){ parent::onInitializePlugin(); if(!isset($this->server)){ - throw new Exception(_m("Specifying a server is required."); + // TRANS: Exception thrown when the CAS Authentication plugin has been configured incorrectly. + throw new Exception(_m("Specifying a server is required.")); } if(!isset($this->port)){ - throw new Exception(_m("Specifying a port is required."); + // TRANS: Exception thrown when the CAS Authentication plugin has been configured incorrectly. + throw new Exception(_m("Specifying a port is required.")); } if(!isset($this->path)){ - throw new Exception(_m("Specifying a path is required."); + // TRANS: Exception thrown when the CAS Authentication plugin has been configured incorrectly. + throw new Exception(_m("Specifying a path is required.")); } //These values need to be accessible to a action object //I can't think of any other way than global variables @@ -142,14 +148,15 @@ class CasAuthenticationPlugin extends AuthenticationPlugin $casSettings['port']=$this->port; $casSettings['path']=$this->path; $casSettings['takeOverLogin']=$this->takeOverLogin; + $casSettings['user_whitelist']=$this->user_whitelist; } - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array('name' => 'CAS Authentication', - 'version' => STATUSNET_VERSION, + 'version' => self::PLUGIN_VERSION, 'author' => 'Craig Andrews', - 'homepage' => 'http://status.net/wiki/Plugin:CasAuthentication', + 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/CasAuthentication', // TRANS: Plugin description. CAS is Central Authentication Service. 'rawdescription' => _m('The CAS Authentication plugin allows for StatusNet to handle authentication through CAS (Central Authentication Service).')); return true;