Index: trunk/phase3/config/index.php |
— | — | @@ -45,10 +45,17 @@ |
46 | 46 | |
47 | 47 | require_once( "includes/Defines.php" ); |
48 | 48 | require_once( "includes/DefaultSettings.php" ); |
| 49 | +require_once( "includes/AutoLoader.php" ); |
49 | 50 | require_once( "includes/MagicWord.php" ); |
50 | 51 | require_once( "includes/Namespace.php" ); |
51 | 52 | require_once( "includes/ProfilerStub.php" ); |
| 53 | +require_once( "includes/GlobalFunctions.php" ); |
| 54 | +require_once( "includes/Hooks.php" ); |
52 | 55 | |
| 56 | +# If we get an exception, the user needs to know |
| 57 | +# all the details |
| 58 | +$wgShowExceptionDetails = true; |
| 59 | + |
53 | 60 | ## Databases we support: |
54 | 61 | |
55 | 62 | $ourdb = array(); |
— | — | @@ -269,12 +276,11 @@ |
270 | 277 | $conf = new ConfigData; |
271 | 278 | |
272 | 279 | install_version_checks(); |
| 280 | +$self = 'Installer'; # Maintenance script name, to please Setup.php |
273 | 281 | |
274 | 282 | print "<li>PHP " . phpversion() . " installed</li>\n"; |
275 | 283 | |
276 | | -## Temporarily turn off all errors as we try to discover installed databases |
277 | | -$olderrnum = error_reporting(0); |
278 | | - |
| 284 | +error_reporting( 0 ); |
279 | 285 | $phpdatabases = array(); |
280 | 286 | foreach (array_keys($ourdb) as $db) { |
281 | 287 | $compname = $ourdb[$db]['compile']; |
— | — | @@ -283,9 +289,8 @@ |
284 | 290 | $ourdb[$db]['havedriver'] = 1; |
285 | 291 | } |
286 | 292 | } |
| 293 | +error_reporting( E_ALL ); |
287 | 294 | |
288 | | -error_reporting($olderrornum); |
289 | | - |
290 | 295 | if (!$phpdatabases) { |
291 | 296 | print "Could not find a suitable database driver!<ul>"; |
292 | 297 | foreach (array_keys($ourdb) AS $db) { |
— | — | @@ -547,11 +552,11 @@ |
548 | 553 | $conf->RootUser = importPost( "RootUser", "root" ); |
549 | 554 | $conf->RootPW = importPost( "RootPW", "" ); |
550 | 555 | $useRoot = importCheck( 'useroot', false ); |
| 556 | + $conf->LanguageCode = importPost( "LanguageCode", "en" ); |
551 | 557 | |
552 | 558 | ## MySQL specific: |
553 | 559 | $conf->DBprefix = importPost( "DBprefix" ); |
554 | 560 | $conf->setSchema( importPost( "DBschema", "mysql4" ) ); |
555 | | - $conf->LanguageCode = importPost( "LanguageCode", "en" ); |
556 | 561 | |
557 | 562 | ## Postgres specific: |
558 | 563 | $conf->DBport = importPost( "DBport", "5432" ); |
— | — | @@ -580,12 +585,48 @@ |
581 | 586 | $errs["DBprefix"] = "Invalid table prefix"; |
582 | 587 | } |
583 | 588 | |
584 | | -if( $conf->SysopPass == "" ) { |
585 | | - $errs["SysopPass"] = "Must not be blank"; |
| 589 | +error_reporting( E_ALL ); |
| 590 | + |
| 591 | +/** |
| 592 | + * Initialise $wgLang and $wgContLang to something so we can |
| 593 | + * call case-folding methods. Per Brion, this is English for |
| 594 | + * now, although we could be clever and initialise to the |
| 595 | + * user-selected language. |
| 596 | + */ |
| 597 | +$wgContLang = Language::factory( 'en' ); |
| 598 | +$wgLang = $wgContLang; |
| 599 | + |
| 600 | +/** |
| 601 | + * We're messing about with users, so we need a stub |
| 602 | + * authentication plugin... |
| 603 | + */ |
| 604 | +$wgAuth = new AuthPlugin(); |
| 605 | + |
| 606 | +/** |
| 607 | + * Validate the initial administrator account; username, |
| 608 | + * password checks, etc. |
| 609 | + */ |
| 610 | +if( $conf->SysopName ) { |
| 611 | + # Check that the user can be created |
| 612 | + $u = User::newFromName( $conf->SysopName ); |
| 613 | + if( $u instanceof User ) { |
| 614 | + # Various password checks |
| 615 | + if( $conf->SysopPass != '' ) { |
| 616 | + if( $conf->SysopPass == $conf->SysopPass2 ) { |
| 617 | + if( !$u->isValidPassword( $conf->SysopPass ) ) { |
| 618 | + $errs['SysopPass'] = "Bad password"; |
| 619 | + } |
| 620 | + } else { |
| 621 | + $errs['SysopPass2'] = "Passwords don't match"; |
| 622 | + } |
| 623 | + } else { |
| 624 | + $errs['SysopPass'] = "Cannot be blank"; |
| 625 | + } |
| 626 | + unset( $u ); |
| 627 | + } else { |
| 628 | + $errs['SysopName'] = "Bad username"; |
| 629 | + } |
586 | 630 | } |
587 | | -if( $conf->SysopPass != $conf->SysopPass2 ) { |
588 | | - $errs["SysopPass2"] = "Passwords don't match!"; |
589 | | -} |
590 | 631 | |
591 | 632 | $conf->License = importRequest( "License", "none" ); |
592 | 633 | if( $conf->License == "gfdl" ) { |
— | — | @@ -1088,6 +1129,9 @@ |
1089 | 1130 | An admin can lock/delete pages, block users from editing, and do other maintenance tasks.<br /> |
1090 | 1131 | A new account will be added only when creating a new wiki database. |
1091 | 1132 | </p> |
| 1133 | + <p class="config-desc"> |
| 1134 | + The password cannot be the same as the username. |
| 1135 | + </p> |
1092 | 1136 | |
1093 | 1137 | <div class="config-input"> |
1094 | 1138 | <label class='column'>Shared memory caching:</label> |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -127,6 +127,8 @@ |
128 | 128 | configuration format, e.g. "5;/tmp" |
129 | 129 | * Don't generate a diff link in the patrol log if the page doesn't exist |
130 | 130 | * (bug 10067) Translations for former skins removed from message files |
| 131 | +* (bug 9993) Force $wgShowExceptionDetails on during installation |
| 132 | +* (bug 9980) Validate administrator username and password during installation |
131 | 133 | |
132 | 134 | == MediaWiki API changes since 1.10 == |
133 | 135 | |