}
public function showDoneMessage() {
- global $wgScriptExtension;
-
$this->startForm();
$regenerate = !$this->getVar( '_ExistingDBSettings' );
if ( $regenerate ) {
$this->parent->getInfoBox(
wfMessage( $msg,
$this->getVar( 'wgServer' ) .
- $this->getVar( 'wgScriptPath' ) . '/index' .
- $wgScriptExtension
+ $this->getVar( 'wgScriptPath' ) . '/index.php'
)->plain(), 'tick-32.png'
)
);
* @return bool
*/
public function submit() {
+ global $wgPasswordPolicy;
+
$retVal = true;
$this->parent->setVarsFromRequest( array( 'wgSitename', '_NamespaceType',
'_AdminName', '_AdminPassword', '_AdminPasswordConfirm', '_AdminEmail',
$pwd = $this->getVar( '_AdminPassword' );
$user = User::newFromName( $cname );
if ( $user ) {
- $status = $user->checkPasswordValidity( $pwd, 'create' );
- $valid = $status->isGood() ? true : $status->getMessage()->escaped();
+ $upp = new UserPasswordPolicy(
+ $wgPasswordPolicy['policies'],
+ $wgPasswordPolicy['checks']
+ );
+ $status = $upp->checkUserPasswordForGroups(
+ $user,
+ $pwd,
+ array( 'bureaucrat', 'sysop' ) // per Installer::createSysop()
+ );
+ $valid = $status->isGood() ? true : $status->getMessage();
} else {
$valid = 'config-admin-name-invalid';
}
if ( strval( $pwd ) === '' ) {
- # $user->getPasswordValidity just checks for $wgMinimalPasswordLength.
- # This message is more specific and helpful.
+ // Provide a more specific and helpful message if password field is left blank
$msg = 'config-admin-password-blank';
} elseif ( $pwd !== $this->getVar( '_AdminPasswordConfirm' ) ) {
$msg = 'config-admin-password-mismatch';
$msg = $valid;
}
if ( $msg !== false ) {
- call_user_func_array( array( $this->parent, 'showError' ), (array)$msg );
+ call_user_func( array( $this->parent, 'showError' ), $msg );
$this->setVar( '_AdminPassword', '' );
$this->setVar( '_AdminPasswordConfirm', '' );
$retVal = false;
$caches[] = 'memcached';
// We'll hide/show this on demand when the value changes, see config.js.
- $cacheval = $this->getVar( 'wgMainCacheType' );
+ $cacheval = $this->getVar( '_MainCacheType' );
if ( !$cacheval ) {
// We need to set a default here; but don't hardcode it
// or we lose it every time we reload the page for validation
// For grep: The following messages are used as the item labels:
// config-cache-none, config-cache-accel, config-cache-memcached
$this->parent->getRadioSet( array(
- 'var' => 'wgMainCacheType',
+ 'var' => '_MainCacheType',
'label' => 'config-cache-options',
'itemLabelPrefix' => 'config-cache-',
'values' => $caches,
$this->parent->setVarsFromRequest( array( '_RightsProfile', '_LicenseCode',
'wgEnableEmail', 'wgPasswordSender', 'wgEnableUploads', 'wgLogo',
'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist',
- 'wgEmailAuthentication', 'wgMainCacheType', '_MemCachedServers',
+ 'wgEmailAuthentication', '_MainCacheType', '_MemCachedServers',
'wgUseInstantCommons', 'wgDefaultSkin' ) );
$retVal = true;
}
$this->parent->setVar( '_Extensions', $extsToInstall );
- if ( $this->getVar( 'wgMainCacheType' ) == 'memcached' ) {
+ if ( $this->getVar( '_MainCacheType' ) == 'memcached' ) {
$memcServers = explode( "\n", $this->getVar( '_MemCachedServers' ) );
if ( !$memcServers ) {
$this->parent->showError( 'config-memcache-needservers' );