]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OpenID/OpenIDPlugin.php
Merge branch 'testing' into 0.9.x
[quix0rs-gnu-social.git] / plugins / OpenID / OpenIDPlugin.php
index a37d5465e84800f8780db2380d7649157c1eb12a..6b35ec3e142f2f1503f7df6476e94691fb1d1d2f 100644 (file)
@@ -70,7 +70,7 @@ class OpenIDPlugin extends Plugin
         $m->connect('index.php?action=finishopenidlogin', array('action' => 'finishopenidlogin'));
         $m->connect('index.php?action=finishaddopenid', array('action' => 'finishaddopenid'));
         $m->connect('main/openidserver', array('action' => 'openidserver'));
-        
+
         return true;
     }
 
@@ -101,11 +101,11 @@ class OpenIDPlugin extends Plugin
                                           'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
                                           'version' => '2.0'));
         $xrdsOutputter->element('Type', null, 'xri://$xrds*simple');
-        
+
         //consumer
         $xrdsOutputter->showXrdsService('http://specs.openid.net/auth/2.0/return_to',
                             common_local_url('finishopenidlogin'));
-                            
+
         //provider
         $xrdsOutputter->showXrdsService('http://specs.openid.net/auth/2.0/signon',
                             common_local_url('openidserver'),
@@ -235,9 +235,14 @@ class OpenIDPlugin extends Plugin
         switch ($name)
         {
          case 'register':
-            $instr = '(Have an [OpenID](http://openid.net/)? ' .
-              'Try our [OpenID registration]'.
-              '(%%action.openidlogin%%)!)';
+            if (common_logged_in()) {
+                $instr = '(Have an [OpenID](http://openid.net/)? ' .
+                  '[Add an OpenID to your account](%%action.openidsettings%%)!';
+            } else {
+                $instr = '(Have an [OpenID](http://openid.net/)? ' .
+                  'Try our [OpenID registration]'.
+                  '(%%action.openidlogin%%)!)';
+            }
             break;
          case 'login':
             $instr = '(Have an [OpenID](http://openid.net/)? ' .
@@ -308,4 +313,15 @@ class OpenIDPlugin extends Plugin
         $tables[] = 'User_openid_trustroot';
         return true;
     }
+
+    function onPluginVersion(&$versions)
+    {
+        $versions[] = array('name' => 'OpenID',
+                            'version' => STATUSNET_VERSION,
+                            'author' => 'Evan Prodromou, Craig Andrews',
+                            'homepage' => 'http://status.net/wiki/Plugin:OpenID',
+                            'rawdescription' =>
+                            _m('Use <a href="http://openid.net/">OpenID</a> to login to the site.'));
+        return true;
+    }
 }