Merge "Add test to validate special page aliases"
[lhc/web/wiklou.git] / includes / installer / WebInstallerPage.php
index b12b686..f83db54 100644 (file)
@@ -380,7 +380,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
 
        /**
         * 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 @@ 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 ) {
@@ -948,20 +950,11 @@ class WebInstaller_Options extends WebInstallerPage {
                if ( $extensions ) {
                        $extHtml = $this->getFieldSetStart( 'config-extensions' );
 
-                       /* Force a recache, so we load extensions descriptions */
-                       global $wgLang;
-                       $lc = Language::getLocalisationCache();
-                       $lc->setInitialisedLanguages( array() );
-                       $lc->getItem( $wgLang->mCode, '' );
-                       LinkCache::singleton()->useDatabase( false );
-
                        foreach ( $extensions as $ext ) {
                                $extHtml .= $this->parent->getCheckBox( array(
-                                               'var' => "ext-{$ext['name']}",
-                                               'rawtext' => "<b>{$ext['name']}</b>: " .
-                                               wfMessage( $ext['descriptionmsg'] )->useDatabase( false )->parse(),
-                                       ) );
-
+                                       'var' => "ext-$ext",
+                                       'rawtext' => $ext,
+                               ) );
                        }
 
                        $extHtml .= $this->parent->getHelpBox( 'config-extensions-help' ) .
@@ -1184,17 +1177,11 @@ class WebInstaller_Options extends WebInstallerPage {
                        $this->setVar( 'wgRightsIcon', '' );
                }
 
-               $extsAvailable = array_map(
-                       function($e) {
-                               if( isset($e['name']) ) {
-                                       return $e['name'];
-                               }
-                       }, $this->parent->findExtensions() );
+               $extsAvailable = $this->parent->findExtensions();
                $extsToInstall = array();
-               foreach ( $extsAvailable as $key => $ext ) {
-                               var_dump("config_ext-$ext");
+               foreach ( $extsAvailable as $ext ) {
                        if ( $this->parent->request->getCheck( 'config_ext-' . $ext ) ) {
-                               $extsToInstall[] = $extsAvailable[ $key ];
+                               $extsToInstall[] = $ext;
                        }
                }
                $this->parent->setVar( '_Extensions', $extsToInstall );
@@ -1306,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" );
                }