From 44a90f9525509bf6b1218f63067675c88c05b972 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 30 Jan 2011 18:21:37 +0000 Subject: [PATCH] Tweak install steps to be on the POST rather than GET. It makes more sense architecturally. It also gives us one last chance for them to say no (in case they clicked "I'm bored already" but changed their minds). Check final step of installer for fatals, and if everything's good, suppress the back button. It's just going to confuse people. And the opposite, suppress continue on fatals...no need pretending things went dandy if they didn't. It's basically now impossible to re-run 'page=Install' after it completes. This is probably a good thing as it throws errors. Coincidentally this also fixes bug 26947. --- includes/installer/Installer.i18n.php | 2 ++ includes/installer/WebInstallerPage.php | 26 ++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index 80bc7e769f..dacecf00c8 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -438,6 +438,8 @@ Should be separated with commas and specify the port to be used (for example: 12 They may require additional configuration, but you can enable them now', 'config-install-alreadydone' => "'''Warning:''' You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.", + 'config-install-begin' => 'By pressing next, you will begin the installation of MediaWiki. +If you still want to make changes, press back.', 'config-install-step-done' => 'done', 'config-install-step-failed' => 'failed', 'config-install-extensions' => 'Including extensions', diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 9fa81f4086..902b620c84 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -1009,25 +1009,29 @@ class WebInstaller_Options extends WebInstallerPage { class WebInstaller_Install extends WebInstallerPage { public function execute() { - if( $this->parent->request->wasPosted() ) { - return 'continue'; - } elseif( $this->getVar( '_InstallDone' ) ) { - $this->startForm(); - $status = new Status(); - $status->warning( 'config-install-alreadydone' ); - $this->parent->showStatusBox( $status ); - } elseif( $this->getVar( '_UpgradeDone' ) ) { + if( $this->getVar( '_UpgradeDone' ) ) { return 'skip'; - } else { + } elseif( $this->getVar( '_InstallDone' ) ) { + return 'continue'; + } elseif( $this->parent->request->wasPosted() ) { $this->startForm(); $this->addHTML(""); + // PerformInstallation bails on a fatal, so make sure the last item + // completed before giving 'next.' Likewise, only provide back on failure + $lastStep = end( $results ); + $continue = $lastStep->isOK() ? 'continue' : false; + $back = $lastStep->isOK() ? false : 'back'; + $this->endForm( $continue, $back ); + } else { + $this->startForm(); + $this->addHTML( $this->parent->getInfoBox( wfMsgNoTrans( 'config-install-begin' ) ) ); + $this->endForm(); } - $this->endForm(); return true; } -- 2.20.1