]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OpenID/openidlogin.php
hide a little more on the profile
[quix0rs-gnu-social.git] / plugins / OpenID / openidlogin.php
index 34e00cccebd509cc3f83c8d7d03c0d569330d79d..20d6e070cdb39599b352b3d1419152f867cd852b 100644 (file)
@@ -33,6 +33,9 @@ class OpenidloginAction extends Action
             $provider = common_config('openid', 'trusted_provider');
             if ($provider) {
                 $openid_url = $provider;
+                if (common_config('openid', 'append_username')) {
+                    $openid_url .= $this->trimmed('openid_username');
+                }
             } else {
                 $openid_url = $this->trimmed('openid_url');
             }
@@ -100,7 +103,15 @@ class OpenidloginAction extends Action
     function showScripts()
     {
         parent::showScripts();
-        $this->autofocus('openid_url');
+        if (common_config('openid', 'trusted_provider')) {
+            if (common_config('openid', 'append_username')) {
+                $this->autofocus('openid_username');
+            } else {
+                $this->autofocus('rememberme');
+            }
+        } else {
+            $this->autofocus('openid_url');
+        }
     }
 
     function title()
@@ -130,10 +141,17 @@ class OpenidloginAction extends Action
         $this->elementStart('ul', 'form_data');
         $this->elementStart('li');
         $provider = common_config('openid', 'trusted_provider');
+        $appendUsername = common_config('openid', 'append_username');
         if ($provider) {
             $this->element('label', array(), _m('OpenID provider'));
             $this->element('span', array(), $provider);
+            if ($appendUsername) {
+                $this->element('input', array('id' => 'openid_username',
+                                              'name' => 'openid_username',
+                                              'style' => 'float: none'));
+            }
             $this->element('p', 'form_guide',
+                           ($appendUsername ? _m('Enter your username.') . ' ' : '') .
                            _m('You will be sent to the provider\'s site for authentication.'));
             $this->hidden('openid_url', $provider);
         } else {