Disable installer when LocalSettings.php is detected
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 6 Jul 2010 18:57:06 +0000 (18:57 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 6 Jul 2010 18:57:06 +0000 (18:57 +0000)
includes/installer/Installer.i18n.php
includes/installer/WebInstaller.php

index 8f57e11..eff283b 100644 (file)
@@ -13,6 +13,10 @@ $messages = array();
 $messages['en'] = array(
        'config-title'                    => 'MediaWiki $1 installation',
        'config-information'              => 'Information',
+       'config-localsettings-upgrade'    => "'''Warning''': Your <code>LocalSettings.php</code> file has been detected.
+Your software is able to upgrade. Please move LocalSettings.php to somewhere safe in then run the installer again.",
+       'config-localsettings-noupgrade'  => "'''Error''': Your <code>LocalSettings.php</code> file has been detected.
+Your software is not able to upgrade at this time. The installer has been disabled for security reasons.",
        'config-session-error'            => 'Error starting session: $1',
        'config-session-expired'          => 'Your session data seems to have expired.
 Sessions are configured for a lifetime of $1.
index 09f3c18..ca81a35 100644 (file)
@@ -159,7 +159,13 @@ class WebInstaller extends Installer {
                # Execute the page
                $this->currentPageName = $page->getName();
                $this->startPageWrapper( $pageName );
-               $result = $page->execute();
+               $localSettings = $this->getLocalSettingsStatus();
+               if( !$localSettings->isGood() ) {
+                       $this->showStatusBox( $localSettings );
+                       $result = 'output';
+               } else {
+                       $result = $page->execute();
+               }
                $this->endPageWrapper();
 
                if ( $result == 'skip' ) {