X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUserlogin.php;h=71efefa79543ca2a37860399ccdc4db162e951b7;hb=44840d15929d8ecfc1d7c31d6f7e86d873ac15a2;hp=bb57e6ceb49a7faaeddf0371cd440a6c35280d19;hpb=ef30e0b49d7743174f6fcc38b4d208d3c751ef48;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index bb57e6ceb4..71efefa795 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -51,9 +51,6 @@ class LoginForm extends SpecialPage { var $mAbortLoginErrorMsg = 'login-abort-generic'; private $mLoaded = false; private $mSecureLoginUrl; - // TODO Remove old forms and mShowVForm gating after all WMF wikis have - // adapted messages and help links to new versions. - private $mShowVForm; /** * @ var WebRequest @@ -144,17 +141,10 @@ class LoginForm extends SpecialPage { } function getDescription() { - if ( !$this->getUser()->isAllowed( 'createaccount' ) ) { - return $this->msg( 'userloginnocreate' )->text(); - } - if ( $this->mShowVForm ) { - if ( $this->mType === 'signup' ) { - return $this->msg( 'createaccount' )->text(); - } else { - return $this->msg( 'login' )->text(); - } + if ( $this->mType === 'signup' ) { + return $this->msg( 'createaccount' )->text(); } else { - return $this->msg( 'userlogin' )->text(); + return $this->msg( 'login' )->text(); } } @@ -173,8 +163,6 @@ class LoginForm extends SpecialPage { if ( $subPage == 'signup' ) { $this->mType = 'signup'; } - $this->mShowVForm = $this->shouldShowVForm(); - $this->setHeaders(); // If logging in and not on HTTPS, either redirect to it or offer a link. @@ -1039,22 +1027,6 @@ class LoginForm extends SpecialPage { } } - /** - * Whether to show new vertically laid out login form. - * ?useNew=1 forces new style, ?useNew=0 forces old style, - * otherwise consult $wgUseVFormUserLogin. - * @return Boolean - */ - private function shouldShowVForm() { - global $wgUseVFormCreateAccount, $wgUseVFormUserLogin; - - if ( $this->mType == 'signup' ) { - return $this->mRequest->getBool( 'useNew', $wgUseVFormCreateAccount ); - } else { - return $this->mRequest->getBool( 'useNew', $wgUseVFormUserLogin ); - } - } - /** * @private */ @@ -1093,37 +1065,34 @@ class LoginForm extends SpecialPage { } if ( $this->mType == 'signup' ) { - $out->addModules( 'mediawiki.special.userlogin.signup' ); - if ( $this->mShowVForm ) { - $template = new UsercreateTemplateVForm(); - $out->addModuleStyles( array( - 'mediawiki.ui', - 'mediawiki.special.createaccount.vform' - ) ); - // XXX hack pending RL or JS parse() support for complex content messages - // https://bugzilla.wikimedia.org/show_bug.cgi?id=25349 - $out->addJsConfigVars( 'wgCreateacctImgcaptchaHelp', - $this->msg( 'createacct-imgcaptcha-help' )->parse() ); - $out->addModules( 'mediawiki.special.createaccount.vform.js' ); - } else { - $template = new UsercreateTemplate(); - } + $template = new UsercreateTemplate(); + + $out->addModuleStyles( array( + 'mediawiki.ui', + 'mediawiki.special.createaccount' + ) ); + // XXX hack pending RL or JS parse() support for complex content messages + // https://bugzilla.wikimedia.org/show_bug.cgi?id=25349 + $out->addJsConfigVars( 'wgCreateacctImgcaptchaHelp', + $this->msg( 'createacct-imgcaptcha-help' )->parse() ); + $out->addModules( array( + 'mediawiki.special.createaccount.js' + ) ); + // Must match number of benefits defined in messages + $template->set( 'benefitCount', 3 ); + $q = 'action=submitlogin&type=signup'; $linkq = 'type=login'; - $linkmsg = 'gotaccount'; } else { - if ( $this->mShowVForm ) { - $template = new UserloginTemplateVForm(); - $out->addModuleStyles( array( - 'mediawiki.ui', - 'mediawiki.special.userlogin.vform' - ) ); - } else { - $template = new UserloginTemplate(); - } + $template = new UserloginTemplate(); + + $out->addModuleStyles( array( + 'mediawiki.ui', + 'mediawiki.special.userlogin' + ) ); + $q = 'action=submitlogin&type=login'; $linkq = 'type=signup'; - $linkmsg = 'nologin'; } if ( $this->mReturnTo !== '' ) { @@ -1142,17 +1111,8 @@ class LoginForm extends SpecialPage { if ( $wgLoginLanguageSelector && $this->mLanguage ) { $linkq .= '&uselang=' . $this->mLanguage; } - if ( !$this->mShowVForm ) { - $link = Html::element( 'a', array( 'href' => $titleObj->getLocalURL( $linkq ) ), - $this->msg( $linkmsg . 'link' )->text() ); # Calling either 'gotaccountlink' or 'nologinlink' - - $template->set( 'link', $this->msg( $linkmsg )->rawParams( $link )->parse() ); - - } else { - // Supply URL, login template creates the button. - // (The template 'link' key, passed above, is obsolete in the VForm design.) - $template->set( 'createOrLoginHref', $titleObj->getLocalURL( $linkq ) ); - } + // Supply URL, login template creates the button. + $template->set( 'createOrLoginHref', $titleObj->getLocalURL( $linkq ) ); } else { $template->set( 'link', '' ); }