]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/CasAuthentication/CasAuthenticationPlugin.php
Delete old Twitter user record when user changes screen name instead of updating...
[quix0rs-gnu-social.git] / plugins / CasAuthentication / CasAuthenticationPlugin.php
index 8b6ef54621f28e51430d0299ff0eae5f88125544..483b060abdba12d03806da23eccc0c26a129b063 100644 (file)
@@ -34,12 +34,12 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
 // We bundle the phpCAS library...
 set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/extlib/CAS');
 
-require_once INSTALLDIR.'/plugins/Authentication/AuthenticationPlugin.php';
 class CasAuthenticationPlugin extends AuthenticationPlugin
 {
     public $server;
     public $port = 443;
     public $path = '';
+    public $takeOverLogin = false;
 
     function checkPassword($username, $password)
     {
@@ -57,8 +57,14 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
          case 'CasloginAction':
             require_once(INSTALLDIR.'/plugins/CasAuthentication/' . strtolower(mb_substr($cls, 0, -6)) . '.php');
             return false;
-         default:
-            return parent::onAutoload($cls);
+        }
+    }
+
+    function onArgsInitialize(&$args)
+    {
+        if($this->takeOverLogin && $args['action'] == 'login')
+        {
+            $args['action'] = 'caslogin';
         }
     }
 
@@ -132,4 +138,15 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
         $casSettings['port']=$this->port;
         $casSettings['path']=$this->path;
     }
+
+    function onPluginVersion(&$versions)
+    {
+        $versions[] = array('name' => 'CAS Authentication',
+                            'version' => STATUSNET_VERSION,
+                            'author' => 'Craig Andrews',
+                            'homepage' => 'http://status.net/wiki/Plugin:CasAuthentication',
+                            'rawdescription' =>
+                            _m('The CAS Authentication plugin allows for StatusNet to handle authentication through CAS (Central Authentication Service).'));
+        return true;
+    }
 }