]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/CasAuthentication/CasAuthenticationPlugin.php
Fix wrong path on Realtime cleanupchannels script by XRevan86
[quix0rs-gnu-social.git] / plugins / CasAuthentication / CasAuthenticationPlugin.php
index 3196bd94a7a622f6d0e186b698e0a8ea0d297040..02ed4cb166a6efa61333bf7408dfa33de5415ac9 100644 (file)
@@ -40,6 +40,7 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
     public $port = 443;
     public $path = '';
     public $takeOverLogin = false;
+    public $user_whitelist = null;
 
     function checkPassword($username, $password)
     {
@@ -54,10 +55,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)
@@ -125,12 +126,15 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
     function onInitializePlugin(){
         parent::onInitializePlugin();
         if(!isset($this->server)){
+            // 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)){
+            // 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)){
+            // 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
@@ -142,14 +146,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' => GNUSOCIAL_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;