Changed the password $valid check condition
authortonythomas01 <01tonythomas@gmail.com>
Tue, 28 Jan 2014 13:31:48 +0000 (19:01 +0530)
committertonythomas01 <01tonythomas@gmail.com>
Tue, 4 Feb 2014 13:42:53 +0000 (19:12 +0530)
$user will always be an object and User::getPasswordValidity will
always return either true, a string or a (non-empty) array
combined with AND (&&), this will always be true"
Removed message 'config-admin-password-same' as it was used nowhere.

Bug: 41392
Change-Id: Idc2cb80ca4541d1120e18aad3261aece7bd72122

includes/installer/Installer.i18n.php
includes/installer/WebInstallerPage.php

index 892fb2a..3b3205f 100644 (file)
@@ -377,7 +377,6 @@ This is the name you will use to log in to the wiki.',
        'config-admin-name-invalid'       => 'The specified username "<nowiki>$1</nowiki>" is invalid.
 Specify a different username.',
        'config-admin-password-blank'     => 'Enter a password for the administrator account.',
-       'config-admin-password-same'      => 'The password must not be the same as the username.',
        'config-admin-password-mismatch'  => 'The two passwords you entered do not match.',
        'config-admin-email'              => 'Email address:',
        'config-admin-email-help'         => 'Enter an email address here to allow you to receive email from other users on the wiki, reset your password, and be notified of changes to pages on your watchlist. You can leave this field empty.',
index d4b3d65..7b8b97b 100644 (file)
@@ -827,7 +827,11 @@ class WebInstaller_Name extends WebInstallerPage {
                $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.
@@ -835,8 +839,6 @@ class WebInstaller_Name extends WebInstallerPage {
                } 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 ) {