Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -324,6 +324,19 @@ |
325 | 325 | return $html; |
326 | 326 | } |
327 | 327 | |
| 328 | + public function getParserOptions() { |
| 329 | + return $this->parserOptions; |
| 330 | + } |
| 331 | + |
| 332 | + public function disableLinkPopups() { |
| 333 | + $this->parserOptions->setExternalLinkTarget( false ); |
| 334 | + } |
| 335 | + |
| 336 | + public function restoreLinkPopups() { |
| 337 | + global $wgExternalLinkTarget; |
| 338 | + $this->parserOptions->setExternalLinkTarget( $wgExternalLinkTarget ); |
| 339 | + } |
| 340 | + |
328 | 341 | /** |
329 | 342 | * TODO: document |
330 | 343 | * |
Index: trunk/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -284,6 +284,9 @@ |
285 | 285 | |
286 | 286 | If you want to regenerate your <code>LocalSettings.php</code> file, click the button below. |
287 | 287 | This is '''not recommended''' unless you are having problems with your wiki.", |
| 288 | + 'config-upgrade-done-no-regenerate' => "Upgrade complete. |
| 289 | + |
| 290 | +You can now [$1 start using your wiki].", |
288 | 291 | 'config-regenerate' => 'Regenerate LocalSettings.php →', |
289 | 292 | 'config-show-table-status' => 'SHOW TABLE STATUS query failed!', |
290 | 293 | 'config-unknown-collation' => "'''Warning:''' Database is using unrecognised collation.", |
Index: trunk/phase3/includes/installer/WebInstallerPage.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | ); |
51 | 51 | } |
52 | 52 | |
53 | | - public function endForm( $continue = 'continue' ) { |
| 53 | + public function endForm( $continue = 'continue', $back = 'back' ) { |
54 | 54 | $s = "<div class=\"config-submit\">\n"; |
55 | 55 | $id = $this->getId(); |
56 | 56 | |
— | — | @@ -63,10 +63,10 @@ |
64 | 64 | array( 'name' => "enter-$continue", 'style' => 'visibility:hidden;overflow:hidden;width:1px;margin:0' ) ) . "\n"; |
65 | 65 | } |
66 | 66 | |
67 | | - if ( $id !== 0 ) { |
68 | | - $s .= Xml::submitButton( wfMsg( 'config-back' ), |
| 67 | + if ( $back ) { |
| 68 | + $s .= Xml::submitButton( wfMsg( "config-$back" ), |
69 | 69 | array( |
70 | | - 'name' => 'submit-back', |
| 70 | + 'name' => "submit-$back", |
71 | 71 | 'tabindex' => $this->parent->nextTabIndex() |
72 | 72 | ) ) . "\n"; |
73 | 73 | } |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | $this->getLanguageSelector( 'UserLang', 'config-your-language', $userLang, $this->parent->getHelpBox( 'config-your-language-help' ) ) . |
174 | 174 | $this->getLanguageSelector( 'ContLang', 'config-wiki-language', $contLang, $this->parent->getHelpBox( 'config-wiki-language-help' ) ); |
175 | 175 | $this->addHTML( $s ); |
176 | | - $this->endForm(); |
| 176 | + $this->endForm( 'continue', false ); |
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
— | — | @@ -435,7 +435,10 @@ |
436 | 436 | |
437 | 437 | public function execute() { |
438 | 438 | if ( $this->getVar( '_UpgradeDone' ) ) { |
439 | | - if ( $this->parent->request->wasPosted() ) { |
| 439 | + // Allow regeneration of LocalSettings.php, unless we are working |
| 440 | + // from a pre-existing LocalSettings.php file and we want to avoid |
| 441 | + // leaking its contents |
| 442 | + if ( $this->parent->request->wasPosted() && !$this->getVar( '_ExistingDBSettings' ) ) { |
440 | 443 | // Done message acknowledged |
441 | 444 | return 'continue'; |
442 | 445 | } else { |
— | — | @@ -483,16 +486,24 @@ |
484 | 487 | |
485 | 488 | public function showDoneMessage() { |
486 | 489 | $this->startForm(); |
| 490 | + $regenerate = !$this->getVar( '_ExistingDBSettings' ); |
| 491 | + if ( $regenerate ) { |
| 492 | + $msg = 'config-upgrade-done'; |
| 493 | + } else { |
| 494 | + $msg = 'config-upgrade-done-no-regenerate'; |
| 495 | + } |
| 496 | + $this->parent->disableLinkPopups(); |
487 | 497 | $this->addHTML( |
488 | 498 | $this->parent->getInfoBox( |
489 | | - wfMsgNoTrans( 'config-upgrade-done', |
| 499 | + wfMsgNoTrans( $msg, |
490 | 500 | $GLOBALS['wgServer'] . |
491 | 501 | $this->getVar( 'wgScriptPath' ) . '/index' . |
492 | 502 | $this->getVar( 'wgScriptExtension' ) |
493 | 503 | ), 'tick-32.png' |
494 | 504 | ) |
495 | 505 | ); |
496 | | - $this->endForm( 'regenerate' ); |
| 506 | + $this->parent->restoreLinkPopups(); |
| 507 | + $this->endForm( $regenerate ? 'regenerate' : false, false ); |
497 | 508 | } |
498 | 509 | |
499 | 510 | } |
— | — | @@ -1029,6 +1040,7 @@ |
1030 | 1041 | $this->parent->request->response()->header( "Refresh: 0;$lsUrl" ); |
1031 | 1042 | |
1032 | 1043 | $this->startForm(); |
| 1044 | + $this->parent->disableLinkPopups(); |
1033 | 1045 | $this->addHTML( |
1034 | 1046 | $this->parent->getInfoBox( |
1035 | 1047 | wfMsgNoTrans( 'config-install-done', |
— | — | @@ -1040,7 +1052,8 @@ |
1041 | 1053 | ), 'tick-32.png' |
1042 | 1054 | ) |
1043 | 1055 | ); |
1044 | | - $this->endForm( false ); |
| 1056 | + $this->parent->restoreLinkPopups(); |
| 1057 | + $this->endForm( false, false ); |
1045 | 1058 | } |
1046 | 1059 | } |
1047 | 1060 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -4132,7 +4132,13 @@ |
4133 | 4133 | $wgReadOnlyFile = false; |
4134 | 4134 | |
4135 | 4135 | /** |
4136 | | - * Set this to a random string to allow web-based upgrades |
| 4136 | + * When you run the web-based upgrade utility, it will tell you what to set |
| 4137 | + * this to in order to authorize the upgrade process. It will subsequently be |
| 4138 | + * used as a password, to authorize further upgrades. |
| 4139 | + * |
| 4140 | + * For security, do not set this to a guessable string. Use the value supplied |
| 4141 | + * by the install/upgrade process. To cause the upgrader to generate a new key, |
| 4142 | + * delete the old key from LocalSettings.php. |
4137 | 4143 | */ |
4138 | 4144 | $wgUpgradeKey = false; |
4139 | 4145 | |