http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76393

Revision: 76393
Author:   demon
Date:     2010-11-09 17:01:09 +0000 (Tue, 09 Nov 2010)
Log Message:
-----------
Followup r76391 per CR: just do $wgUpgradeKey in generateSecretKey()

Modified Paths:
--------------
    trunk/phase3/includes/installer/CoreInstaller.php

Modified: trunk/phase3/includes/installer/CoreInstaller.php
===================================================================
--- trunk/phase3/includes/installer/CoreInstaller.php   2010-11-09 17:00:35 UTC 
(rev 76392)
+++ trunk/phase3/includes/installer/CoreInstaller.php   2010-11-09 17:01:09 UTC 
(rev 76393)
@@ -308,7 +308,6 @@
                        array( 'name' => 'tables',    'callback' => array( 
$this, 'installTables' ) ),
                        array( 'name' => 'interwiki', 'callback' => array( 
$installer, 'populateInterwikiTable' ) ),
                        array( 'name' => 'secretkey', 'callback' => array( 
$this, 'generateSecretKey' ) ),
-                       array( 'name' => 'upgradekey', 'callback' => array( 
$this, 'generateUpgradeKey' ) ),
                        array( 'name' => 'sysop',     'callback' => array( 
$this, 'createSysop' ) ),
                        array( 'name' => 'mainpage',  'callback' => array( 
$this, 'createMainpage' ) ),
                );
@@ -395,23 +394,15 @@
 
                $this->setVar( 'wgSecretKey', $secretKey );
 
+               // Generate a $wgUpgradeKey from our secret key
+               $secretKey = md5( $secretKey );
+               $randPos = mt_rand( 0, strlen( $secretKey ) - 8 );
+               $this->setVar( 'wgUpgradeKey', substr( $secretKey, $randPos, 
$randPos + 8 ) );
+
                return $status;
        }
 
        /**
-        * Generate a default $wgUpradeKey, using a semi-random 8 character 
portion
-        * of md5($wgSecretKey)
-        *
-        * @return Status
-        */
-       protected function generateUpgradeKey() {
-               $secret = md5( $this->getVar( 'wgSecretKey' ) );
-               $randPos = mt_rand( 0, strlen( $secret ) - 8 );
-               $this->setVar( 'wgUpgradeKey', substr( $secret, $randPos, 
$randPos + 8 ) );
-               return Status::newGood();
-       }
-
-       /**
         * Create the first user account, grant it sysop and bureaucrat rights
         *
         * @return Status


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to