Wikinaut has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/59666


Change subject: code cosmetics only; bumped to version 3.121
......................................................................

code cosmetics only; bumped to version 3.121

Change-Id: I5e610adcafe7db118e1eb8bc3178fbd03d9d7c70
---
M CHANGES
M OpenID.php
M SpecialOpenIDLogin.body.php
M SpecialOpenIDServer.body.php
4 files changed, 140 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID 
refs/changes/66/59666/5

diff --git a/CHANGES b/CHANGES
index 42b933b..1fbb865 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
 CHANGES
 =======
 
+3.121 20130417  code cosmetics
 3.12  20130402  breaking change renamed $wgOpenIDClientOnly to 
$wgOpenIDConsumerAndAlsoProvider
                 and inverting its logic accordingly
 3.11  20130401  code cosmetics
diff --git a/OpenID.php b/OpenID.php
index 38db058..22dcc7e 100644
--- a/OpenID.php
+++ b/OpenID.php
@@ -29,7 +29,7 @@
        exit( 1 );
 }
 
-define( 'MEDIAWIKI_OPENID_VERSION', '3.12 20130402' );
+define( 'MEDIAWIKI_OPENID_VERSION', '3.121 20130417' );
 
 $path = dirname( __FILE__ );
 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . 
get_include_path() );
diff --git a/SpecialOpenIDLogin.body.php b/SpecialOpenIDLogin.body.php
index 76e8221..dad7a40 100644
--- a/SpecialOpenIDLogin.body.php
+++ b/SpecialOpenIDLogin.body.php
@@ -74,7 +74,7 @@
                                // if a forced OpenID provider specified, 
bypass the form
                                $this->login( $wgOpenIDConsumerForce, 
$this->getTitle( 'Finish' ) );
                        } else {
-                               $this->loginForm();
+                               $this->providerSelectionLoginForm();
                        }
                }
        }
@@ -94,9 +94,9 @@
        }
 
        /**
-        * Displays the main login form
+        * Displays the main provider selection login form
         */
-       function loginForm() {
+       function providerSelectionLoginForm() {
                global $wgOut, $wgOpenIDShowProviderIcons, $wgOpenIDLoginOnly;
 
                $wgOut->addModules( $wgOpenIDShowProviderIcons ? 
'ext.openid.icons' : 'ext.openid.plain' );
@@ -168,8 +168,9 @@
         * @param $messagekey String or null: message name to display at the top
         */
        function chooseNameForm( $openid, $sreg, $ax, $messagekey = null ) {
-               global $wgOut, $wgOpenIDAllowExistingAccountSelection, 
$wgHiddenPrefs, $wgUser;
-               global $wgOpenIDProposeUsernameFromSREG, 
$wgOpenIDAllowAutomaticUsername, $wgOpenIDAllowNewAccountname;
+               global $wgOut, $wgOpenIDAllowExistingAccountSelection, 
$wgHiddenPrefs,
+                       $wgUser, $wgOpenIDProposeUsernameFromSREG,
+                       $wgOpenIDAllowAutomaticUsername, 
$wgOpenIDAllowNewAccountname;
 
                if ( $messagekey ) {
                        $wgOut->addWikiMsg( $messagekey );
@@ -178,8 +179,17 @@
 
                $wgOut->addHTML(
                        Xml::openElement( 'form',
-                               array( 'action' => $this->getTitle( 
'ChooseName' )->getLocalUrl(), 'method' => 'POST' ) ) . "\n" .
-                       Xml::fieldset( wfMessage( 'openidchooselegend' 
)->text(), false, array( 'id' => 'mw-openid-choosename' ) ) . "\n" .
+                               array(
+                                       'action' => $this->getTitle( 
'ChooseName' )->getLocalUrl(),
+                                       'method' => 'POST'
+                               )
+                       ) . "\n" .
+                       Xml::fieldset( wfMessage( 'openidchooselegend' 
)->text(),
+                               false,
+                               array(
+                                       'id' => 'mw-openid-choosename'
+                               )
+                       ) . "\n" .
                        Xml::openElement( 'table' )
                );
                $def = false;
@@ -210,9 +220,15 @@
                                        $checkName = 'wpUpdateUserInfo' . 
$oidAttr;
                                        $oidAttributes[] = Xml::tags( 'li', 
array(),
                                                Xml::check( $checkName, false, 
array( 'id' => $checkName ) ) .
-                                               Xml::tags( 'label', array( 
'for' => $checkName ),
+                                               Xml::tags( 'label',
+                                                       array(
+                                                               'for' => 
$checkName
+                                                       ),
                                                        wfMessage( 
"openid$oidAttr" )->text() . wfMessage( 'colon-separator' )->escaped() .
-                                                               Xml::tags( 'i', 
array(), $sreg[$oidAttr] )
+                                                               Xml::tags( 'i',
+                                                                       array(),
+                                                                       
$sreg[$oidAttr]
+                                                               )
                                                )
                                        );
                                }
@@ -252,10 +268,22 @@
                                if ( array_key_exists( 'nickname', $sreg ) && 
$this->userNameOK( $sreg['nickname'] ) ) {
                                        $wgOut->addHTML(
                                                Xml::openElement( 'tr' ) .
-                                               Xml::tags( 'td', array( 'class' 
=> 'mw-label' ),
-                                                       Xml::radio( 
'wpNameChoice', 'nick', !$def, array( 'id' => 'wpNameChoiceNick' ) )
+                                               Xml::tags( 'td',
+                                                       array(
+                                                               'class' => 
'mw-label'
+                                                       ),
+                                                       Xml::radio( 
'wpNameChoice',
+                                                               'nick',
+                                                               !$def,
+                                                               array(
+                                                                       'id' => 
'wpNameChoiceNick'
+                                                               )
+                                                       )
                                                ) .
-                                               Xml::tags( 'td', array( 'class' 
=> 'mw-input' ),
+                                               Xml::tags( 'td',
+                                                       array(
+                                                               'class' => 
'mw-input'
+                                                       ),
                                                        Xml::label( wfMessage( 
'openidchoosenick', $sreg['nickname'] )->escaped(), 'wpNameChoiceNick' )
                                                ) .
                                                Xml::closeElement( 'tr' ) . "\n"
@@ -275,10 +303,22 @@
                                if ( $fullname && $this->userNameOK( $fullname 
) ) {
                                        $wgOut->addHTML(
                                                Xml::openElement( 'tr' ) .
-                                               Xml::tags( 'td', array( 'class' 
=> 'mw-label' ),
-                                                       Xml::radio( 
'wpNameChoice', 'full', !$def, array( 'id' => 'wpNameChoiceFull' ) )
+                                               Xml::tags( 'td',
+                                                       array(
+                                                               'class' => 
'mw-label'
+                                                       ),
+                                                       Xml::radio( 
'wpNameChoice',
+                                                               'full',
+                                                               !$def,
+                                                               array(
+                                                                       'id' => 
'wpNameChoiceFull'
+                                                               )
+                                                       )
                                                ) .
-                                               Xml::tags( 'td', array( 'class' 
=> 'mw-input' ),
+                                               Xml::tags( 'td',
+                                                       array(
+                                                               'class' => 
'mw-input'
+                                                       ),
                                                        Xml::label( wfMessage( 
'openidchoosefull', $fullname )->escaped(), 'wpNameChoiceFull' )
                                                ) .
                                                Xml::closeElement( 'tr' ) . "\n"
@@ -290,10 +330,22 @@
                                if ( $idname && $this->userNameOK( $idname ) ) {
                                        $wgOut->addHTML(
                                                Xml::openElement( 'tr' ) .
-                                               Xml::tags( 'td', array( 'class' 
=> 'mw-label' ),
-                                                       Xml::radio( 
'wpNameChoice', 'url', !$def, array( 'id' => 'wpNameChoiceUrl' ) )
+                                               Xml::tags( 'td',
+                                                       array(
+                                                               'class' => 
'mw-label'
+                                                       ),
+                                                       Xml::radio( 
'wpNameChoice',
+                                                               'url',
+                                                               !$def,
+                                                               array(
+                                                                       'id' => 
'wpNameChoiceUrl'
+                                                               )
+                                                       )
                                                ) .
-                                               Xml::tags( 'td', array( 'class' 
=> 'mw-input' ),
+                                               Xml::tags( 'td',
+                                                       array(
+                                                               'class' => 
'mw-input'
+                                                       ),
                                                        Xml::label( wfMessage( 
'openidchooseurl', $idname )->text(), 'wpNameChoiceUrl' )
                                                ) .
                                                Xml::closeElement( 'tr' ) . "\n"
@@ -305,10 +357,22 @@
                        if ( $wgOpenIDAllowAutomaticUsername ) {
                                $wgOut->addHTML(
                                        Xml::openElement( 'tr' ) .
-                                       Xml::tags( 'td', array( 'class' => 
'mw-label' ),
-                                               Xml::radio( 'wpNameChoice', 
'auto', !$def, array( 'id' => 'wpNameChoiceAuto' ) )
+                                       Xml::tags( 'td',
+                                               array(
+                                                       'class' => 'mw-label'
+                                               ),
+                                               Xml::radio( 'wpNameChoice',
+                                                       'auto',
+                                                       !$def,
+                                                       array(
+                                                               'id' => 
'wpNameChoiceAuto'
+                                                       )
+                                               )
                                        ) .
-                                       Xml::tags( 'td', array( 'class' => 
'mw-input' ),
+                                       Xml::tags( 'td',
+                                               array(
+                                                       'class' => 'mw-input'
+                                               ),
                                                Xml::label( wfMessage( 
'openidchooseauto', $this->automaticName( $sreg ) )->escaped(), 
'wpNameChoiceAuto' )
                                        ) .
                                                Xml::closeElement( 'tr' ) . "\n"
@@ -319,12 +383,30 @@
                                $wgOut->addHTML(
 
                                Xml::openElement( 'tr' ) .
-                               Xml::tags( 'td', array( 'class' => 'mw-label' ),
-                                       Xml::radio( 'wpNameChoice', 'manual', 
!$def, array( 'id' => 'wpNameChoiceManual' ) )
+                               Xml::tags( 'td',
+                                       array(
+                                               'class' => 'mw-label'
+                                       ),
+                                       Xml::radio( 'wpNameChoice',
+                                               'manual',
+                                               !$def,
+                                               array(
+                                                       'id' => 
'wpNameChoiceManual'
+                                               )
+                                       )
                                ) .
-                               Xml::tags( 'td', array( 'class' => 'mw-input' ),
+                               Xml::tags( 'td',
+                                       array(
+                                               'class' => 'mw-input'
+                                       ),
                                        Xml::label( wfMessage( 
'openidchoosemanual' )->text(), 'wpNameChoiceManual' ) . ' ' .
-                                       Xml::input( 'wpNameValue', 16, false, 
array( 'id' => 'wpNameValue' ) )
+                                       Xml::input( 'wpNameValue',
+                                               16,
+                                               false,
+                                               array(
+                                                       'id' => 'wpNameValue'
+                                               )
+                                       )
                                ) .
                                Xml::closeElement( 'tr' ) . "\n"
                                );
@@ -335,8 +417,14 @@
                # These are always available
                $wgOut->addHTML(
                        Xml::openElement( 'tr' ) . "\n" .
-                       Xml::element( 'td', array(), '' ) . "\n" .
-                       Xml::tags( 'td', array( 'class' => 'mw-submit' ),
+                       Xml::element( 'td',
+                               array(),
+                               ''
+                       ) . "\n" .
+                       Xml::tags( 'td',
+                               array(
+                                       'class' => 'mw-submit'
+                               ),
                                Xml::submitButton( wfMessage( 'userlogin' 
)->text(), array( 'name' => 'wpOK' ) ) .
                                Xml::submitButton( wfMessage( 'cancel' 
)->text(), array( 'name' => 'wpCancel' ) )
                        ) . "\n" .
diff --git a/SpecialOpenIDServer.body.php b/SpecialOpenIDServer.body.php
index 160cf20..d0e21ab 100644
--- a/SpecialOpenIDServer.body.php
+++ b/SpecialOpenIDServer.body.php
@@ -597,8 +597,11 @@
        }
 
        function SregFromQuery( $query ) {
-               $sreg = array( 'required' => array(), 'optional' => array(),
-                                         'policy_url' => null );
+               $sreg = array( 
+                       'required' => array(),
+                       'optional' => array(),
+                       'policy_url' => null
+               );
                if ( array_key_exists( 'openid.sreg.required', $query ) ) {
                        $sreg['required'] = explode( ',', 
$query['openid.sreg.required'] );
                }
@@ -700,15 +703,16 @@
                $sk = $wgUser->getSkin();
 
                $wgOut->addHTML( "<p>{$instructions}</p>" .
-                                               '<form action="' . 
$sk->makeSpecialUrl( 'OpenIDServer/Login' ) . '" method="POST">' .
-                                               '<table>' .
-                                               "<tr><td><label 
for='username'>{$username}</label></td>" .
-                                               '    <td><span id="username">' 
. htmlspecialchars( $name ) . '</span></td></tr>' .
-                                               "<tr><td><label 
for='password'>{$password}</label></td>" .
-                                               '    <td><input type="password" 
name="wpPassword" size="32" value="" /></td></tr>' .
-                                               "<tr><td colspan='2'><input 
type='submit' name='wpOK' value='{$ok}' /> <input type='submit' name='wpCancel' 
value='{$cancel}' /></td></tr>" .
-                                               '</table>' .
-                                               '</form>' );
+                       '<form action="' . $sk->makeSpecialUrl( 
'OpenIDServer/Login' ) . '" method="POST">' .
+                       '<table>' .
+                       "<tr><td><label 
for='username'>{$username}</label></td>" .
+                       '    <td><span id="username">' . htmlspecialchars( 
$name ) . '</span></td></tr>' .
+                       "<tr><td><label 
for='password'>{$password}</label></td>" .
+                       '    <td><input type="password" name="wpPassword" 
size="32" value="" /></td></tr>' .
+                       "<tr><td colspan='2'><input type='submit' name='wpOK' 
value='{$ok}' /> <input type='submit' name='wpCancel' value='{$cancel}' 
/></td></tr>" .
+                       '</table>' .
+                       '</form>'
+               );
        }
 
        function SaveValues( $request, $sreg ) {
@@ -803,8 +807,11 @@
                                                           array( $this, 
'ValidField' ) );
 
                if ( count( $fields ) > 0 ) {
+
                        $wgOut->addHTML( '<table>' );
+
                        foreach ( $fields as $field ) {
+
                                $wgOut->addHTML( "<tr>" );
                                $wgOut->addHTML( "<th><label 
for='wpAllow{$field}'>" );
                                $wgOut->addHTML( wfMessage( "openid$field" 
)->text() );
@@ -814,15 +821,20 @@
                                $wgOut->addHTML( "<td> " . ( ( is_null( $value 
) ) ? '' : $value ) . "</td>" );
                                $wgOut->addHTML( "<td>" . ( ( in_array( $field, 
$sreg['required'] ) ) ? wfMessage( 'openidrequired' )->text() : wfMessage( 
'openidoptional' )->text() ) . "</td>" );
                                $wgOut->addHTML( "<td><input 
name='wpAllow{$field}' id='wpAllow{$field}' type='checkbox'" );
+
                                if ( !is_null( $value ) ) {
                                        $wgOut->addHTML( " value='on' 
checked='checked' />" );
                                } else {
                                        $wgOut->addHTML( " disabled='disabled' 
/>" );
                                }
+
                                $wgOut->addHTML( "</tr>" );
+
                        }
+
                        $wgOut->addHTML( '</table>' );
                }
+
                $wgOut->addHTML( "<input type='submit' name='wpOK' 
value='{$ok}' /> <input type='submit' name='wpCancel' value='{$cancel}' 
/></form>" );
                return null;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/59666
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e610adcafe7db118e1eb8bc3178fbd03d9d7c70
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/OpenID
Gerrit-Branch: master
Gerrit-Owner: Wikinaut <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to