From 5ced0170c5eca9c4890753f8c746f3243eb7cde9 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 6 Jul 2010 18:57:06 +0000 Subject: [PATCH] Disable installer when LocalSettings.php is detected --- includes/installer/Installer.i18n.php | 4 ++++ includes/installer/WebInstaller.php | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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' ) { -- 2.20.1