]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/CasAuthentication/CasAuthenticationPlugin.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / plugins / CasAuthentication / CasAuthenticationPlugin.php
index 1662db3ebafab9fc03c31b0a8e9ea65bbb7de12b..7f467173b0766616d5f3d53575a8ca2520c42e77 100644 (file)
@@ -54,13 +54,13 @@ 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)
+    function onArgsInitialize(array &$args)
     {
         if($this->takeOverLogin && $args['action'] == 'login')
         {
@@ -74,13 +74,15 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
         return true;
     }
 
-    function onEndLoginGroupNav(&$action)
+    function onEndLoginGroupNav($action)
     {
         $action_name = $action->trimmed('action');
 
         $action->menuItem(common_local_url('caslogin'),
+                          // TRANS: Menu item. CAS is Central Authentication Service.
                           _m('CAS'),
-                          _m('Login or register with CAS'),
+                          // TRANS: Tooltip for menu item. CAS is Central Authentication Service.
+                          _m('Login or register with CAS.'),
                           $action_name === 'caslogin');
 
         return true;
@@ -93,9 +95,11 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
         switch ($name)
         {
          case 'login':
-            $instr = '(Have an account with CAS? ' .
-              'Try our [CAS login]'.
-              '(%%action.caslogin%%)!)';
+            // TRANS: Invitation to users with a CAS account to log in using the service.
+            // TRANS: "[CAS login]" is a link description. (%%action.caslogin%%) is the URL.
+            // TRANS: These two elements may not be separated.
+            $instr = _m('(Have an account with CAS? ' .
+              'Try our [CAS login](%%action.caslogin%%)!)');
             break;
          default:
             return true;
@@ -121,13 +125,16 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
     function onInitializePlugin(){
         parent::onInitializePlugin();
         if(!isset($this->server)){
-            throw new Exception("must specify a 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)){
-            throw new Exception("must specify a 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)){
-            throw new Exception("must specify a 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
         //I can't think of any other way than global variables
@@ -140,14 +147,14 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
         $casSettings['takeOverLogin']=$this->takeOverLogin;
     }
 
-    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',
-                            'rawdescription' =>
-                            _m('The CAS Authentication plugin allows for StatusNet to handle authentication through CAS (Central Authentication Service).'));
+                            // 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;
     }
 }