diff options
Diffstat (limited to 'includes/installer/WebInstallerPage.php')
-rw-r--r-- | includes/installer/WebInstallerPage.php | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 98f3ae8a..151aad0a 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -287,10 +287,10 @@ class WebInstallerLanguage extends WebInstallerPage { public function getLanguageSelector( $name, $label, $selectedCode, $helpHtml = '' ) { global $wgDummyLanguageCodes; - $s = $helpHtml; + $output = $helpHtml; - $s .= Html::openElement( 'select', array( 'id' => $name, 'name' => $name, - 'tabindex' => $this->parent->nextTabIndex() ) ) . "\n"; + $select = new XmlSelect( $name, $name, $selectedCode ); + $select->setAttribute( 'tabindex', $this->parent->nextTabIndex() ); $languages = Language::fetchLanguageNames(); ksort( $languages ); @@ -298,11 +298,11 @@ class WebInstallerLanguage extends WebInstallerPage { if ( isset( $wgDummyLanguageCodes[$code] ) ) { continue; } - $s .= "\n" . Xml::option( "$code - $lang", $code, $code == $selectedCode ); + $select->addOption( "$code - $lang", $code ); } - $s .= "\n</select>\n"; - return $this->parent->label( $label, $name, $s ); + $output .= $select->getHTML(); + return $this->parent->label( $label, $name, $output ); } } @@ -669,6 +669,8 @@ class WebInstallerUpgrade extends WebInstallerPage { } public function showDoneMessage() { + global $wgScriptExtension; + $this->startForm(); $regenerate = !$this->getVar( '_ExistingDBSettings' ); if ( $regenerate ) { @@ -682,7 +684,7 @@ class WebInstallerUpgrade extends WebInstallerPage { wfMessage( $msg, $this->getVar( 'wgServer' ) . $this->getVar( 'wgScriptPath' ) . '/index' . - $this->getVar( 'wgScriptExtension' ) + $wgScriptExtension )->plain(), 'tick-32.png' ) ); @@ -831,6 +833,8 @@ class WebInstallerName extends WebInstallerPage { * @return bool */ public function submit() { + global $wgPasswordPolicy; + $retVal = true; $this->parent->setVarsFromRequest( array( 'wgSitename', '_NamespaceType', '_AdminName', '_AdminPassword', '_AdminPasswordConfirm', '_AdminEmail', @@ -907,13 +911,21 @@ class WebInstallerName extends WebInstallerPage { $pwd = $this->getVar( '_AdminPassword' ); $user = User::newFromName( $cname ); if ( $user ) { - $valid = $user->getPasswordValidity( $pwd ); + $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'; @@ -921,7 +933,7 @@ class WebInstallerName extends WebInstallerPage { $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; @@ -1479,8 +1491,7 @@ class WebInstallerComplete extends WebInstallerPage { wfMessage( 'config-install-done', $lsUrl, $this->getVar( 'wgServer' ) . - $this->getVar( 'wgScriptPath' ) . '/index' . - $this->getVar( 'wgScriptExtension' ), + $this->getVar( 'wgScriptPath' ) . '/index.php', '<downloadlink/>' )->plain(), 'tick-32.png' ) |