Merge "Changed the password $valid check condition"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 7 Feb 2014 16:44:55 +0000 (16:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 7 Feb 2014 16:44:55 +0000 (16:44 +0000)
1  2 
includes/installer/WebInstallerPage.php

@@@ -380,7 -380,7 +380,7 @@@ class WebInstaller_ExistingWiki extend
  
        /**
         * Initiate an upgrade of the existing database
 -       * @param array $vars Variables from LocalSettings.php and AdminSettings.php
 +       * @param array $vars Variables from LocalSettings.php
         * @return Status
         */
        protected function handleExistingUpgrade( $vars ) {
@@@ -827,7 -827,11 +827,11 @@@ class WebInstaller_Name extends WebInst
                $msg = false;
                $pwd = $this->getVar( '_AdminPassword' );
                $user = User::newFromName( $cname );
-               $valid = $user && $user->getPasswordValidity( $pwd );
+               if ( $user ) {
+                       $valid = $user->getPasswordValidity( $pwd );
+               } else {
+                       $valid = 'config-admin-name-invalid';
+               }
                if ( strval( $pwd ) === '' ) {
                        # $user->getPasswordValidity just checks for $wgMinimalPasswordLength.
                        # This message is more specific and helpful.
                } elseif ( $pwd !== $this->getVar( '_AdminPassword2' ) ) {
                        $msg = 'config-admin-password-mismatch';
                } elseif ( $valid !== true ) {
-                       # As of writing this will only catch the username being e.g. 'FOO' and
-                       # the password 'foo'
                        $msg = $valid;
                }
                if ( $msg !== false ) {
@@@ -1291,7 -1293,7 +1293,7 @@@ class WebInstaller_Complete extends Web
                ) {
                        // JS appears to be the only method that works consistently with IE7+
                        $this->addHtml( "\n<script>jQuery( function () { document.location = " .
 -                      Xml::encodeJsVar( $lsUrl ) . "; } );</script>\n" );
 +                              Xml::encodeJsVar( $lsUrl ) . "; } );</script>\n" );
                } else {
                        $this->parent->request->response()->header( "Refresh: 0;url=$lsUrl" );
                }