Index: trunk/phase3/includes/installer/CoreInstaller.php |
— | — | @@ -308,7 +308,6 @@ |
309 | 309 | array( 'name' => 'tables', 'callback' => array( $this, 'installTables' ) ), |
310 | 310 | array( 'name' => 'interwiki', 'callback' => array( $installer, 'populateInterwikiTable' ) ), |
311 | 311 | array( 'name' => 'secretkey', 'callback' => array( $this, 'generateSecretKey' ) ), |
312 | | - array( 'name' => 'upgradekey', 'callback' => array( $this, 'generateUpgradeKey' ) ), |
313 | 312 | array( 'name' => 'sysop', 'callback' => array( $this, 'createSysop' ) ), |
314 | 313 | array( 'name' => 'mainpage', 'callback' => array( $this, 'createMainpage' ) ), |
315 | 314 | ); |
— | — | @@ -395,23 +394,15 @@ |
396 | 395 | |
397 | 396 | $this->setVar( 'wgSecretKey', $secretKey ); |
398 | 397 | |
| 398 | + // Generate a $wgUpgradeKey from our secret key |
| 399 | + $secretKey = md5( $secretKey ); |
| 400 | + $randPos = mt_rand( 0, strlen( $secretKey ) - 8 ); |
| 401 | + $this->setVar( 'wgUpgradeKey', substr( $secretKey, $randPos, $randPos + 8 ) ); |
| 402 | + |
399 | 403 | return $status; |
400 | 404 | } |
401 | 405 | |
402 | 406 | /** |
403 | | - * Generate a default $wgUpradeKey, using a semi-random 8 character portion |
404 | | - * of md5($wgSecretKey) |
405 | | - * |
406 | | - * @return Status |
407 | | - */ |
408 | | - protected function generateUpgradeKey() { |
409 | | - $secret = md5( $this->getVar( 'wgSecretKey' ) ); |
410 | | - $randPos = mt_rand( 0, strlen( $secret ) - 8 ); |
411 | | - $this->setVar( 'wgUpgradeKey', substr( $secret, $randPos, $randPos + 8 ) ); |
412 | | - return Status::newGood(); |
413 | | - } |
414 | | - |
415 | | - /** |
416 | 407 | * Create the first user account, grant it sysop and bureaucrat rights |
417 | 408 | * |
418 | 409 | * @return Status |