83 parent::__construct(
'Userlogin' );
92 global $wgAuth, $wgHiddenPrefs, $wgEnableEmail;
94 if ( $this->mLoaded ) {
97 $this->mLoaded =
true;
99 if ( $this->mOverrideRequest ===
null ) {
106 $this->mType =
$request->getText(
'type' );
107 $this->mUsername =
$request->getText(
'wpName' );
108 $this->mPassword =
$request->getText(
'wpPassword' );
109 $this->mRetype =
$request->getText(
'wpRetype' );
110 $this->mDomain =
$request->getText(
'wpDomain' );
111 $this->mReason =
$request->getText(
'wpReason' );
112 $this->mCookieCheck =
$request->getVal(
'wpCookieCheck' );
113 $this->mPosted =
$request->wasPosted();
114 $this->mCreateaccountMail =
$request->getCheck(
'wpCreateaccountMail' )
117 $this->mLoginattempt =
$request->getCheck(
'wpLoginattempt' );
118 $this->mAction =
$request->getVal(
'action' );
119 $this->mRemember =
$request->getCheck(
'wpRemember' );
120 $this->mFromHTTP =
$request->getBool(
'fromhttp',
false );
121 $this->mStickHTTPS = ( !$this->mFromHTTP &&
$request->getProtocol() ===
'https' )
122 ||
$request->getBool(
'wpForceHttps',
false );
123 $this->mLanguage =
$request->getText(
'uselang' );
124 $this->mSkipCookieCheck =
$request->getCheck(
'wpSkipCookieCheck' );
125 $this->mToken = $this->mType ==
'signup'
126 ?
$request->getVal(
'wpCreateaccountToken' )
127 :
$request->getVal(
'wpLoginToken' );
128 $this->mReturnTo =
$request->getVal(
'returnto',
'' );
129 $this->mReturnToQuery =
$request->getVal(
'returntoquery',
'' );
131 if ( $wgEnableEmail ) {
132 $this->mEmail =
$request->getText(
'wpEmail' );
136 if ( !in_array(
'realname', $wgHiddenPrefs ) ) {
137 $this->mRealName =
$request->getText(
'wpRealName' );
139 $this->mRealName =
'';
142 if ( !$wgAuth->validDomain( $this->mDomain ) ) {
143 $this->mDomain = $wgAuth->getDomain();
145 $wgAuth->setDomain( $this->mDomain );
147 # 1. When switching accounts, it sucks to get automatically logged out
148 # 2. Do not return to PasswordReset after a successful password change
149 # but goto Wiki start page (Main_Page) instead ( bug 33997 )
151 if ( is_object( $returnToTitle )
152 && ( $returnToTitle->isSpecial(
'Userlogout' )
153 || $returnToTitle->isSpecial(
'PasswordReset' ) )
155 $this->mReturnTo =
'';
156 $this->mReturnToQuery =
'';
161 if ( $this->mType ===
'signup' ) {
162 return $this->
msg(
'createaccount' )->text();
164 return $this->
msg(
'login' )->text();
171 public function execute( $subPage ) {
172 if ( session_id() ==
'' ) {
180 if ( $subPage ==
'signup' ) {
181 $this->mType =
'signup';
187 if ( $this->mRequest->getProtocol() !==
'https' ) {
190 'returnto' => $this->mReturnTo !==
'' ? $this->mReturnTo :
null,
191 'returntoquery' => $this->mReturnToQuery !==
'' ?
192 $this->mReturnToQuery :
null,
194 ) + $this->mRequest->getQueryValues();
200 $this->
getOutput()->addVaryHeader(
'X-Forwarded-Proto' );
207 if ( substr( $url, 0, 8 ) ===
'https://' ) {
208 $this->mSecureLoginUrl = $url;
213 if ( !is_null( $this->mCookieCheck ) ) {
217 } elseif ( $this->mPosted ) {
218 if ( $this->mCreateaccount ) {
222 } elseif ( $this->mCreateaccountMail ) {
226 } elseif ( (
'submitlogin' == $this->mAction ) || $this->mLoginattempt ) {
239 if ( $this->mEmail ==
'' ) {
246 if ( !$status->isGood() ) {
247 $error = $status->getMessage();
253 $u = $status->getValue();
256 $u->setPassword(
null );
261 $u->addNewUserLogEntry(
'byemail', $this->mReason );
264 $out->setPageTitle( $this->
msg(
'accmailtitle' ) );
269 $out->addWikiMsg(
'accmailtext', $u->getName(), $u->getEmail() );
281 # Create the account and abort if there's a problem doing so
283 if ( !$status->isGood() ) {
284 $error = $status->getMessage();
290 $u = $status->getValue();
292 # Only save preferences if the user is not creating an account for someone else.
293 if ( $this->
getUser()->isAnon() ) {
294 # If we showed up language selection links, and one was in use, be
295 # smart (and sensible) and save that language as the user's preference
296 if ( $wgLoginLanguageSelector && $this->mLanguage ) {
297 $u->setOption(
'language', $this->mLanguage );
300 # Otherwise the user's language preference defaults to $wgContLang,
301 # but it may be better to set it to their preferred $wgContLang variant,
302 # based on browser preferences or URL parameters.
303 $u->setOption(
'language',
$wgContLang->getPreferredVariant() );
306 $u->setOption(
'variant',
$wgContLang->getPreferredVariant() );
312 # Send out an email authentication message if needed
314 $status = $u->sendConfirmationMail();
315 if ( $status->isGood() ) {
316 $out->addWikiMsg(
'confirmemail_oncreate' );
318 $out->addWikiText( $status->getWikiText(
'confirmemail_sendfailed' ) );
322 # Save settings (including confirmation token)
325 # If not logged in, assume the new account as the current one and set
326 # session cookies then show a "welcome" message or a "need cookies"
328 if ( $this->
getUser()->isAnon() ) {
336 $u->addNewUserLogEntry(
'create' );
343 # Confirm that the account was created
344 $out->setPageTitle( $this->
msg(
'accountcreated' ) );
345 $out->addWikiMsg(
'accountcreatedtext', $u->getName() );
348 $u->addNewUserLogEntry(
'create2', $this->mReason );
362 $wgMinimalPasswordLength, $wgEmailConfirmToEdit;
365 if ( !$wgAuth->validDomain( $this->mDomain ) ) {
374 if (
'local' != $this->mDomain && $this->mDomain !=
'' ) {
376 !$wgAuth->canCreateAccounts() &&
378 !$wgAuth->userExists( $this->mUsername ) ||
379 !$wgAuth->authenticate( $this->mUsername, $this->mPassword )
390 # Request forgery checks.
391 if ( !self::getCreateaccountToken() ) {
397 # The user didn't pass a createaccount token
398 if ( !$this->mToken ) {
402 # Validate the createaccount token
403 if ( $this->mToken !== self::getCreateaccountToken() ) {
408 $currentUser = $this->
getUser();
409 $creationBlock = $currentUser->isBlockedFromCreateAccount();
410 if ( !$currentUser->isAllowed(
'createaccount' ) ) {
412 } elseif ( $creationBlock instanceof
Block ) {
420 # Include checks that will include GlobalBlocking (Bug 38333)
421 $permErrors = $this->
getPageTitle()->getUserPermissionsErrors(
427 if ( count( $permErrors ) ) {
432 if ( $currentUser->isDnsBlacklisted( $ip,
true ) ) {
440 if ( !is_object(
$title ) ) {
444 # Now create a dummy user ($u) and check if it is valid
446 if ( !is_object( $u ) ) {
448 } elseif ( 0 != $u->idForName() ) {
452 if ( $this->mCreateaccountMail ) {
453 # do not force a password for account creation by email
454 # set invalid password, it will be replaced later by a random generated password
455 $this->mPassword =
null;
457 if ( $this->mPassword !== $this->mRetype ) {
461 # check for minimal password length
462 $valid = $u->getPasswordValidity( $this->mPassword );
463 if ( $valid !==
true ) {
464 if ( !is_array( $valid ) ) {
465 $valid =
array( $valid, $wgMinimalPasswordLength );
468 return call_user_func_array(
'Status::newFatal', $valid );
472 # if you need a confirmed email address to edit, then obviously you
473 # need an email address.
474 if ( $wgEmailConfirmToEdit && strval( $this->mEmail ) ===
'' ) {
482 # Set some additional data so the AbortNewAccount hook can be used for
483 # more than just username validation
484 $u->setEmail( $this->mEmail );
485 $u->setRealName( $this->mRealName );
489 if ( !
wfRunHooks(
'AbortNewAccount',
array( $u, &$abortError, &$abortStatus ) ) ) {
491 wfDebug(
"LoginForm::addNewAccountInternal: a hook blocked creation\n" );
492 if ( $abortStatus ===
null ) {
497 $abortError =
new Message(
'createaccount-hook-aborted',
array( $abortError ) );
509 if ( !
wfRunHooks(
'ExemptFromAccountCreationThrottle',
array( $ip ) ) ) {
510 wfDebug(
"LoginForm::exemptFromAccountCreationThrottle: a hook " .
511 "allowed account creation w/o throttle\n" );
513 if ( ( $wgAccountCreationThrottle && $currentUser->isPingLimitable() ) ) {
514 $key =
'global:acctcreate:ip:' . $ip;
517 $wgMemc->set( $key, 0, 86400 );
519 if (
$value >= $wgAccountCreationThrottle ) {
520 return Status::newFatal(
'acct_creation_throttle_hit', $wgAccountCreationThrottle );
526 if ( !$wgAuth->addUser( $u, $this->mPassword, $this->mEmail, $this->mRealName ) ) {
532 return $this->
initUser( $u,
false );
544 function initUser( $u, $autocreate ) {
547 $status = $u->addToDatabase();
548 if ( !$status->isOK() ) {
552 if ( $wgAuth->allowPasswordChange() ) {
553 $u->setPassword( $this->mPassword );
556 $u->setEmail( $this->mEmail );
557 $u->setRealName( $this->mRealName );
560 $wgAuth->initUser( $u, $autocreate );
586 if ( $this->mUsername ==
'' ) {
596 if ( !self::getLoginToken() ) {
602 if ( !$this->mToken ) {
607 if ( $throttleCount ===
true ) {
612 if ( $this->mToken !== self::getLoginToken() ) {
623 wfDebug( __METHOD__ .
": already logged in as {$this->mUsername}\n" );
633 $isAutoCreated =
false;
634 if ( $u->getID() == 0 ) {
636 if ( $status !== self::SUCCESS ) {
639 $isAutoCreated =
true;
648 if ( !
wfRunHooks(
'AbortLogin',
array( $u, $this->mPassword, &$abort, &$msg ) ) ) {
649 $this->mAbortLoginErrorMsg = $msg;
654 global $wgBlockDisablesLogin;
655 if ( !$u->checkPassword( $this->mPassword ) ) {
656 if ( $u->checkTemporaryPassword( $this->mPassword ) ) {
673 if ( !$u->isEmailConfirmed() ) {
681 $this->mAbortLoginErrorMsg =
'resetpass-temp-emailed';
682 $this->mTempPasswordUsed =
true;
687 } elseif ( $wgBlockDisablesLogin && $u->isBlocked() ) {
690 } elseif ( $u->getPasswordExpired() ==
'hard' ) {
693 $this->mAbortLoginErrorMsg =
'resetpass-expired';
695 $wgAuth->updateUser( $u );
703 if ( $throttleCount ) {
707 if ( $isAutoCreated ) {
728 $username = $canUsername !==
false ? $canUsername : $username;
731 if ( is_array( $wgPasswordAttemptThrottle ) ) {
732 $throttleKey =
'global:password-throttle:' . $wgRequest->getIP() .
':' . md5( $username );
733 $count = $wgPasswordAttemptThrottle[
'count'];
734 $period = $wgPasswordAttemptThrottle[
'seconds'];
736 $throttleCount =
$wgMemc->get( $throttleKey );
737 if ( !$throttleCount ) {
738 $wgMemc->add( $throttleKey, 1, $period );
739 } elseif ( $throttleCount <
$count ) {
741 } elseif ( $throttleCount >=
$count ) {
746 return $throttleCount;
757 $username = $canUsername !==
false ? $canUsername : $username;
759 $throttleKey =
'global:password-throttle:' . $wgRequest->getIP() .
':' . md5( $username );
760 $wgMemc->delete( $throttleKey );
774 if ( $this->
getUser()->isBlockedFromCreateAccount() ) {
775 wfDebug( __METHOD__ .
": user is blocked from account creation\n" );
780 if ( !$wgAuth->autoCreate() ) {
784 if ( !$wgAuth->userExists(
$user->getName() ) ) {
785 wfDebug( __METHOD__ .
": user does not exist\n" );
791 wfDebug( __METHOD__ .
": \$wgAuth->authenticate() returned false, aborting\n" );
799 wfDebug(
"LoginForm::attemptAutoCreate: a hook blocked creation: $abortError\n" );
800 $this->mAbortLoginErrorMsg = $abortError;
805 wfDebug( __METHOD__ .
": creating account\n" );
808 if ( !$status->isOK() ) {
809 $errors = $status->getErrorsByType(
'error' );
810 $this->mAbortLoginErrorMsg = $errors[0][
'message'];
820 $wgInvalidPasswordReset;
824 # We've verified now, update the real record
826 $user->invalidateCache();
828 if (
$user->requiresHTTPS() ) {
829 $this->mStickHTTPS =
true;
832 if ( $wgSecureLogin && !$this->mStickHTTPS ) {
833 $user->setCookies( $this->mRequest,
false, $this->mRemember );
835 $user->setCookies( $this->mRequest,
null, $this->mRemember );
841 $key =
wfMemcKey(
'password-throttle',
$request->getIP(), md5( $this->mUsername ) );
848 $code =
$request->getVal(
'uselang',
$user->getOption(
'language' ) );
851 $this->
getContext()->setLanguage( $userLang );
854 if ( $this->
getUser()->getPasswordExpired() ==
'soft' ) {
856 } elseif ( $wgInvalidPasswordReset
857 && !
$user->isValidPassword( $this->mPassword )
859 $status =
$user->checkPasswordValidity( $this->mPassword );
861 $status->getMessage(
'resetpass-validity-soft' )
872 $error = $this->mAbortLoginErrorMsg ?:
'nocookiesforlogin';
876 $error = $this->mAbortLoginErrorMsg ?:
'sessionfailure';
881 $error = $this->mAbortLoginErrorMsg ?:
'noname';
885 $error = $this->mAbortLoginErrorMsg ?:
'wrongpassword';
889 if ( $this->
getUser()->isAllowed(
'createaccount' ) ) {
890 $error = $this->mAbortLoginErrorMsg ?:
'nosuchuser';
894 $error = $this->mAbortLoginErrorMsg ?:
'nosuchusershort';
900 $error = $this->mAbortLoginErrorMsg ?:
'wrongpassword';
904 $error = $this->mAbortLoginErrorMsg ?:
'wrongpasswordempty';
908 $error = $this->mAbortLoginErrorMsg ?:
'resetpass_announce';
915 $error = $this->mAbortLoginErrorMsg ?:
'login-throttled';
917 ->params( $this->
getLanguage()->formatDuration( $wgPasswordAttemptThrottle[
'seconds'] ) )
922 $error = $this->mAbortLoginErrorMsg ?:
'login-userblocked';
926 $error = $this->mAbortLoginErrorMsg ?:
'login-abort-generic';
940 wfRunHooks(
'LoginPasswordResetMessage',
array( &$msg, $this->mUsername ) );
943 $derivative->setTitle( $reset->getPageTitle() );
944 $reset->setContext( $derivative );
945 if ( !$this->mTempPasswordUsed ) {
946 $reset->setOldPasswordMessage(
'oldpassword' );
948 $reset->setChangeMessage( $msg );
949 $reset->execute(
null );
960 $emailText =
'passwordremindertext'
962 global $wgNewPasswordExpiry;
964 if ( $u->getEmail() ==
'' ) {
972 $currentUser = $this->
getUser();
973 wfRunHooks(
'User::mailPasswordInternal',
array( &$currentUser, &$ip, &$u ) );
975 $np = $u->randomPassword();
976 $u->setNewpassword( $np, $throttle );
978 $userLanguage = $u->getOption(
'language' );
981 $mainPageUrl = $mainPage->getCanonicalURL();
983 $m = $this->
msg( $emailText, $ip, $u->getName(), $np,
'<' . $mainPageUrl .
'>',
984 round( $wgNewPasswordExpiry / 86400 ) )->inLanguage( $userLanguage )->text();
985 $result = $u->sendMail( $this->
msg( $emailTitle )->inLanguage( $userLanguage )->
text(), $m );
1001 # Run any hooks; display injected HTML if any, else redirect
1002 $currentUser = $this->
getUser();
1003 $injected_html =
'';
1004 wfRunHooks(
'UserLoginComplete',
array( &$currentUser, &$injected_html ) );
1006 if ( $injected_html !==
'' ) {
1008 'loginsuccess', $injected_html );
1021 # Run any hooks; display injected HTML
1022 $currentUser = $this->
getUser();
1023 $injected_html =
'';
1024 $welcome_creation_msg =
'welcomecreation-msg';
1026 wfRunHooks(
'UserLoginComplete',
array( &$currentUser, &$injected_html ) );
1033 wfRunHooks(
'BeforeWelcomeCreation',
array( &$welcome_creation_msg, &$injected_html ) );
1036 $welcome_creation_msg, $injected_html );
1053 $out->addHTML( $injected_html );
1067 # Let's be nice about this, it's likely that this feature will be used
1068 # for blocking large numbers of innocent people, e.g. range blocks on
1069 # schools. Don't blame it on the user. There's a small chance that it
1070 # really is the user's fault, i.e. the username is blocked and they
1071 # haven't bothered to log out before trying to create an account to
1072 # evade it, but we'll leave that to their guilty conscience to figure
1074 $errorParams =
array(
1076 $block->mReason ? $block->mReason : $this->
msg(
'blockednoreason' )->text(),
1081 $errorMessage =
'cantcreateaccount-range-text';
1082 $errorParams[] = $this->
getRequest()->getIP();
1084 $errorMessage =
'cantcreateaccount-text';
1088 'cantcreateaccounttitle',
1109 $type, $returnTo =
'', $returnToQuery =
'', $stickHTTPs =
false
1111 $this->mReturnTo = $returnTo;
1112 $this->mReturnToQuery = $returnToQuery;
1113 $this->mStickHTTPS = $stickHTTPs;
1126 global $wgRedirectOnLogin, $wgSecureLogin;
1128 if (
$type !=
'error' && $wgRedirectOnLogin !==
null ) {
1129 $returnTo = $wgRedirectOnLogin;
1130 $returnToQuery =
array();
1133 $returnToQuery =
wfCgiToArray( $this->mReturnToQuery );
1137 if ( !$returnToTitle ) {
1141 if ( $wgSecureLogin && !$this->mStickHTTPS ) {
1144 } elseif ( $wgSecureLogin ) {
1152 if (
$type ==
'successredirect' ) {
1153 $redirectUrl = $returnToTitle->getFullURL( $returnToQuery,
false, $proto );
1154 $this->
getOutput()->redirect( $redirectUrl );
1156 $this->
getOutput()->addReturnTo( $returnToTitle, $returnToQuery,
null,
$options );
1164 global $wgEnableEmail, $wgEnableUserEmail;
1165 global $wgHiddenPrefs, $wgLoginLanguageSelector;
1166 global $wgAuth, $wgEmailConfirmToEdit, $wgCookieExpiration;
1167 global $wgSecureLogin, $wgPasswordResetRoutes;
1173 if ( $this->mType ==
'signup' ) {
1177 $permErrors = $titleObj->getUserPermissionsErrors(
'createaccount',
$user,
true );
1178 if ( count( $permErrors ) ) {
1180 } elseif (
$user->isBlockedFromCreateAccount() ) {
1190 if ( $this->mUsername ==
'' && $this->mType !=
'signup' ) {
1191 if (
$user->isLoggedIn() ) {
1192 $this->mUsername =
$user->getName();
1194 $this->mUsername = $this->
getRequest()->getCookie(
'UserName' );
1201 'mediawiki.ui.button',
1202 'mediawiki.special.userlogin.common.styles'
1205 'mediawiki.special.userlogin.common.js'
1208 if ( $this->mType ==
'signup' ) {
1211 $out->addJsConfigVars(
'wgCreateacctImgcaptchaHelp',
1212 $this->
msg(
'createacct-imgcaptcha-help' )->parse() );
1216 'mediawiki.special.userlogin.signup.js'
1219 'mediawiki.special.userlogin.signup.styles'
1225 $template->set(
'benefitCount', 3 );
1227 $q =
'action=submitlogin&type=signup';
1228 $linkq =
'type=login';
1232 'mediawiki.special.userlogin.login.styles'
1237 $q =
'action=submitlogin&type=login';
1238 $linkq =
'type=signup';
1241 if ( $this->mReturnTo !==
'' ) {
1242 $returnto =
'&returnto=' .
wfUrlencode( $this->mReturnTo );
1243 if ( $this->mReturnToQuery !==
'' ) {
1244 $returnto .=
'&returntoquery=' .
1248 $linkq .= $returnto;
1251 # Don't show a "create account" link if the user can't.
1253 # Pass any language selection on to the mode switch link
1254 if ( $wgLoginLanguageSelector && $this->mLanguage ) {
1258 $template->set(
'createOrLoginHref', $titleObj->getLocalURL( $linkq ) );
1260 $template->set(
'link',
'' );
1263 $resetLink = $this->mType ==
'signup'
1265 : is_array( $wgPasswordResetRoutes ) && in_array(
true, array_values( $wgPasswordResetRoutes ) );
1267 $template->set(
'header',
'' );
1268 $template->set(
'skin', $this->
getSkin() );
1269 $template->set(
'name', $this->mUsername );
1270 $template->set(
'password', $this->mPassword );
1271 $template->set(
'retype', $this->mRetype );
1272 $template->set(
'createemailset', $this->mCreateaccountMail );
1273 $template->set(
'email', $this->mEmail );
1274 $template->set(
'realname', $this->mRealName );
1275 $template->set(
'domain', $this->mDomain );
1276 $template->set(
'reason', $this->mReason );
1278 $template->set(
'action', $titleObj->getLocalURL( $q ) );
1279 $template->set(
'message', $msg );
1280 $template->set(
'messagetype', $msgtype );
1281 $template->set(
'createemail', $wgEnableEmail &&
$user->isLoggedIn() );
1282 $template->set(
'userealname', !in_array(
'realname', $wgHiddenPrefs ) );
1283 $template->set(
'useemail', $wgEnableEmail );
1284 $template->set(
'emailrequired', $wgEmailConfirmToEdit );
1285 $template->set(
'emailothers', $wgEnableUserEmail );
1286 $template->set(
'canreset', $wgAuth->allowPasswordChange() );
1287 $template->set(
'resetlink', $resetLink );
1288 $template->set(
'canremember', ( $wgCookieExpiration > 0 ) );
1289 $template->set(
'usereason',
$user->isLoggedIn() );
1290 $template->set(
'remember', $this->mRemember );
1291 $template->set(
'cansecurelogin', ( $wgSecureLogin ===
true ) );
1292 $template->set(
'stickhttps', (
int)$this->mStickHTTPS );
1293 $template->set(
'loggedin',
$user->isLoggedIn() );
1294 $template->set(
'loggedinuser',
$user->getName() );
1296 if ( $this->mType ==
'signup' ) {
1297 if ( !self::getCreateaccountToken() ) {
1300 $template->set(
'token', self::getCreateaccountToken() );
1302 if ( !self::getLoginToken() ) {
1305 $template->set(
'token', self::getLoginToken() );
1308 # Prepare language selection links as needed
1309 if ( $wgLoginLanguageSelector ) {
1311 if ( $this->mLanguage ) {
1312 $template->set(
'uselang', $this->mLanguage );
1316 $template->set(
'secureLoginUrl', $this->mSecureLoginUrl );
1319 $usingHTTPS = $this->mRequest->getProtocol() ==
'https';
1320 $loginendHTTPS = $this->
msg(
'loginend-https' );
1321 $signupendHTTPS = $this->
msg(
'signupend-https' );
1322 if ( $usingHTTPS && !$loginendHTTPS->isBlank() ) {
1323 $template->set(
'loginend', $loginendHTTPS->parse() );
1325 $template->set(
'loginend', $this->
msg(
'loginend' )->parse() );
1327 if ( $usingHTTPS && !$signupendHTTPS->isBlank() ) {
1328 $template->set(
'signupend', $signupendHTTPS->parse() );
1330 $template->set(
'signupend', $this->
msg(
'signupend' )->parse() );
1334 $wgAuth->modifyUITemplate( $template, $this->mType );
1335 if ( $this->mType ==
'signup' ) {
1341 $out->disallowUserJs();
1342 $out->addTemplate( $template );
1353 if ( $this->mType ==
'signup' ) {
1355 } elseif (
$user->isAllowed(
'createaccount' ) ) {
1373 global $wgDisableCookieCheck;
1375 return $wgDisableCookieCheck ?
true : $this->
getRequest()->checkSessionCookie();
1385 return $wgRequest->getSessionData(
'wsLoginToken' );
1403 $wgRequest->setSessionData(
'wsLoginToken',
null );
1413 return $wgRequest->getSessionData(
'wsCreateaccountToken' );
1429 $wgRequest->setSessionData(
'wsCreateaccountToken',
null );
1436 global $wgSecureLogin, $wgCookieSecure;
1437 if ( $wgSecureLogin && !$this->mStickHTTPS ) {
1438 $wgCookieSecure =
false;
1441 $this->
getRequest()->setSessionData(
'wsEditToken',
null );
1451 if ( $this->mReturnTo !==
'' ) {
1455 $check = $titleObj->getFullURL(
$query );
1465 if (
$type ==
'new' ) {
1467 } elseif (
$type ==
'login' ) {
1485 $msg = $this->
msg(
'loginlanguagelinks' )->inContentLanguage();
1486 if ( !$msg->isBlank() ) {
1487 $langs = explode(
"\n", $msg->text() );
1489 foreach ( $langs
as $lang ) {
1490 $lang = trim( $lang,
'* ' );
1491 $parts = explode(
'|', $lang );
1492 if ( count( $parts ) >= 2 ) {
1497 return count( $links ) > 0 ? $this->
msg(
'loginlanguagelabel' )->rawParams(
1498 $this->
getLanguage()->pipeList( $links ) )->escaped() :
'';
1515 return htmlspecialchars( $text );
1518 if ( $this->mType ==
'signup' ) {
1519 $query[
'type'] =
'signup';
1521 if ( $this->mReturnTo !==
'' ) {
1528 $attr[
'lang'] = $attr[
'hreflang'] = $targetLanguage->getHtmlCode();
1532 htmlspecialchars( $text ),