'wgShellLocale',
'wgSecretKey',
'wgUseInstantCommons',
+ 'wgUpgradeKey',
);
/**
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' ) ),
);
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
*
'config-install-secretkey' => 'Generating secret key',
'config-insecure-secretkey' => "'''Warning:''' Unable to create secure <code>\$wgSecretKey</code>.
Consider changing it manually.",
+ 'config-install-upgradekey' => 'Generating default upgrade key',
'config-install-sysop' => 'Creating administrator user account',
'config-install-mainpage' => 'Creating main page with default content',
'config-install-mainpage-failed' => 'Could not insert main page.',
'wgDBtype', 'wgSecretKey', 'wgRightsUrl', 'wgSitename', 'wgRightsIcon',
'wgRightsText', 'wgRightsCode', 'wgMainCacheType', 'wgEnableUploads',
'wgMainCacheType', '_MemCachedServers', 'wgDBserver', 'wgDBuser',
- 'wgDBpassword', 'wgUseInstantCommons'
+ 'wgDBpassword', 'wgUseInstantCommons', 'wgUpgradeKey'
),
$db->getGlobalNames()
);
\$wgSecretKey = \"{$this->values['wgSecretKey']}\";
+# Site upgrade key. Must be set to a string (default provided) to turn on the
+# web installer while LocalSettings.php is in place
+#\$wgUpgradeKey = \"{$this->values['wgUpgradeKey']}\";
+
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
\$wgDefaultSkin = 'vector';