Index: trunk/phase3/maintenance/commandLine.inc |
— | — | @@ -18,6 +18,13 @@ |
19 | 19 | } |
20 | 20 | } |
21 | 21 | |
| 22 | + protected function getDbType() { |
| 23 | + global $wgUseNormalUser; |
| 24 | + |
| 25 | + return ( isset( $wgUseNormalUser ) && $wgUseNormalUser ) ? |
| 26 | + Maintenance::DB_STD : Maintenance::DB_ADMIN; |
| 27 | + } |
| 28 | + |
22 | 29 | /** |
23 | 30 | * No help, it would just be misleading since it misses custom options |
24 | 31 | */ |
Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -356,7 +356,7 @@ |
357 | 357 | * Do some sanity checking and basic setup |
358 | 358 | */ |
359 | 359 | public function setup() { |
360 | | - global $IP, $wgCommandLineMode, $wgUseNormalUser, $wgRequestTime; |
| 360 | + global $IP, $wgCommandLineMode, $wgRequestTime; |
361 | 361 | |
362 | 362 | # Abort if called from a web server |
363 | 363 | if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) { |
— | — | @@ -406,10 +406,6 @@ |
407 | 407 | # Turn off output buffering if it's on |
408 | 408 | @ob_end_flush(); |
409 | 409 | |
410 | | - if ( !isset( $wgUseNormalUser ) ) { |
411 | | - $wgUseNormalUser = false; |
412 | | - } |
413 | | - |
414 | 410 | $this->loadParamsAndArgs(); |
415 | 411 | $this->maybeHelp(); |
416 | 412 | $this->validateParamsAndArgs(); |
— | — | @@ -603,7 +599,7 @@ |
604 | 600 | * Handle some last-minute setup here. |
605 | 601 | */ |
606 | 602 | public function finalSetup() { |
607 | | - global $wgCommandLineMode, $wgUseNormalUser, $wgShowSQLErrors; |
| 603 | + global $wgCommandLineMode, $wgShowSQLErrors; |
608 | 604 | global $wgTitle, $wgProfiling, $IP, $wgDBadminuser, $wgDBadminpassword; |
609 | 605 | global $wgDBuser, $wgDBpassword, $wgDBservers, $wgLBFactoryConf; |
610 | 606 | |
— | — | @@ -620,7 +616,7 @@ |
621 | 617 | if( $this->mDbPass ) |
622 | 618 | $wgDBadminpassword = $this->mDbPass; |
623 | 619 | |
624 | | - if ( empty( $wgUseNormalUser ) && isset( $wgDBadminuser ) ) { |
| 620 | + if ( $this->getDbType() == self::DB_ADMIN && isset( $wgDBadminuser ) ) { |
625 | 621 | $wgDBuser = $wgDBadminuser; |
626 | 622 | $wgDBpassword = $wgDBadminpassword; |
627 | 623 | |