From: Chad Horohoe Date: Tue, 6 Jul 2010 18:57:06 +0000 (+0000) Subject: Disable installer when LocalSettings.php is detected X-Git-Tag: 1.31.0-rc.0~36240 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=5ced0170c5eca9c4890753f8c746f3243eb7cde9;p=lhc%2Fweb%2Fwiklou.git Disable installer when LocalSettings.php is detected --- diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index 8f57e112db..eff283bd2b 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -13,6 +13,10 @@ $messages = array(); $messages['en'] = array( 'config-title' => 'MediaWiki $1 installation', 'config-information' => 'Information', + 'config-localsettings-upgrade' => "'''Warning''': Your LocalSettings.php 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 LocalSettings.php 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. diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 09f3c18836..ca81a35fdc 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -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' ) {