Merge "Add RCCacheEntryBuilder, split from EnhancedChangesList and cleaned up"
[lhc/web/wiklou.git] / includes / installer / WebInstallerPage.php
index 67236e5..4bc6cad 100644 (file)
@@ -482,7 +482,7 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                $defaultType = $this->getVar( 'wgDBtype' );
 
                // Messages: config-dbsupport-mysql, config-dbsupport-postgres, config-dbsupport-oracle,
-               // config-dbsupport-sqlite
+               // config-dbsupport-sqlite, config-dbsupport-mssql
                $dbSupport = '';
                foreach ( Installer::getDBTypes() as $type ) {
                        $dbSupport .= wfMessage( "config-dbsupport-$type" )->plain() . "\n";
@@ -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 ) {
@@ -1291,7 +1293,7 @@ class WebInstaller_Complete extends WebInstallerPage {
                ) {
                        // 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" );
                }