83 parent::__construct(
'Userlogin' );
85 $this->mOverrideRequest = $request;
92 global $wgAuth, $wgHiddenPrefs, $wgEnableEmail;
94 if ( $this->mLoaded ) {
97 $this->mLoaded =
true;
99 if ( $this->mOverrideRequest ===
null ) {
104 $this->mRequest = $request;
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 =
wfMemcKey(
'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 ) {
727 $username = trim( $username );
730 if ( is_array( $wgPasswordAttemptThrottle ) ) {
731 $throttleKey =
wfMemcKey(
'password-throttle', $wgRequest->getIP(), md5( $username ) );
732 $count = $wgPasswordAttemptThrottle[
'count'];
733 $period = $wgPasswordAttemptThrottle[
'seconds'];
735 $throttleCount =
$wgMemc->get( $throttleKey );
736 if ( !$throttleCount ) {
737 $wgMemc->add( $throttleKey, 1, $period );
738 } elseif ( $throttleCount <
$count ) {
740 } elseif ( $throttleCount >=
$count ) {
745 return $throttleCount;
755 $username = trim( $username );
757 $throttleKey =
wfMemcKey(
'password-throttle', $wgRequest->getIP(), md5( $username ) );
758 $wgMemc->delete( $throttleKey );
772 if ( $this->
getUser()->isBlockedFromCreateAccount() ) {
773 wfDebug( __METHOD__ .
": user is blocked from account creation\n" );
778 if ( !$wgAuth->autoCreate() ) {
782 if ( !$wgAuth->userExists(
$user->getName() ) ) {
783 wfDebug( __METHOD__ .
": user does not exist\n" );
789 wfDebug( __METHOD__ .
": \$wgAuth->authenticate() returned false, aborting\n" );
797 wfDebug(
"LoginForm::attemptAutoCreate: a hook blocked creation: $abortError\n" );
798 $this->mAbortLoginErrorMsg = $abortError;
803 wfDebug( __METHOD__ .
": creating account\n" );
806 if ( !$status->isOK() ) {
807 $errors = $status->getErrorsByType(
'error' );
808 $this->mAbortLoginErrorMsg = $errors[0][
'message'];
818 $wgInvalidPasswordReset;
822 # We've verified now, update the real record
824 $user->invalidateCache();
826 if (
$user->requiresHTTPS() ) {
827 $this->mStickHTTPS =
true;
830 if ( $wgSecureLogin && !$this->mStickHTTPS ) {
831 $user->setCookies( $this->mRequest,
false, $this->mRemember );
833 $user->setCookies( $this->mRequest,
null, $this->mRemember );
839 $key =
wfMemcKey(
'password-throttle', $request->getIP(), md5( $this->mUsername ) );
846 $code = $request->getVal(
'uselang',
$user->getOption(
'language' ) );
849 $this->
getContext()->setLanguage( $userLang );
852 if ( $this->
getUser()->getPasswordExpired() ==
'soft' ) {
854 } elseif ( $wgInvalidPasswordReset
855 && !
$user->isValidPassword( $this->mPassword )
857 $status =
$user->checkPasswordValidity( $this->mPassword );
859 $status->getMessage(
'resetpass-validity-soft' )
870 $error = $this->mAbortLoginErrorMsg ?:
'nocookiesforlogin';
874 $error = $this->mAbortLoginErrorMsg ?:
'sessionfailure';
879 $error = $this->mAbortLoginErrorMsg ?:
'noname';
883 $error = $this->mAbortLoginErrorMsg ?:
'wrongpassword';
887 if ( $this->
getUser()->isAllowed(
'createaccount' ) ) {
888 $error = $this->mAbortLoginErrorMsg ?:
'nosuchuser';
892 $error = $this->mAbortLoginErrorMsg ?:
'nosuchusershort';
898 $error = $this->mAbortLoginErrorMsg ?:
'wrongpassword';
902 $error = $this->mAbortLoginErrorMsg ?:
'wrongpasswordempty';
906 $error = $this->mAbortLoginErrorMsg ?:
'resetpass_announce';
913 $error = $this->mAbortLoginErrorMsg ?:
'login-throttled';
915 ->params( $this->
getLanguage()->formatDuration( $wgPasswordAttemptThrottle[
'seconds'] ) )
920 $error = $this->mAbortLoginErrorMsg ?:
'login-userblocked';
924 $error = $this->mAbortLoginErrorMsg ?:
'login-abort-generic';
938 wfRunHooks(
'LoginPasswordResetMessage',
array( &$msg, $this->mUsername ) );
941 $derivative->setTitle( $reset->getPageTitle() );
942 $reset->setContext( $derivative );
943 if ( !$this->mTempPasswordUsed ) {
944 $reset->setOldPasswordMessage(
'oldpassword' );
946 $reset->setChangeMessage( $msg );
947 $reset->execute(
null );
958 $emailText =
'passwordremindertext'
960 global $wgNewPasswordExpiry;
962 if ( $u->getEmail() ==
'' ) {
970 $currentUser = $this->
getUser();
971 wfRunHooks(
'User::mailPasswordInternal',
array( &$currentUser, &$ip, &$u ) );
973 $np = $u->randomPassword();
974 $u->setNewpassword( $np, $throttle );
976 $userLanguage = $u->getOption(
'language' );
979 $mainPageUrl = $mainPage->getCanonicalURL();
981 $m = $this->
msg( $emailText, $ip, $u->getName(), $np,
'<' . $mainPageUrl .
'>',
982 round( $wgNewPasswordExpiry / 86400 ) )->inLanguage( $userLanguage )->text();
983 $result = $u->sendMail( $this->
msg( $emailTitle )->inLanguage( $userLanguage )->
text(), $m );
999 # Run any hooks; display injected HTML if any, else redirect
1000 $currentUser = $this->
getUser();
1001 $injected_html =
'';
1002 wfRunHooks(
'UserLoginComplete',
array( &$currentUser, &$injected_html ) );
1004 if ( $injected_html !==
'' ) {
1006 'loginsuccess', $injected_html );
1019 # Run any hooks; display injected HTML
1020 $currentUser = $this->
getUser();
1021 $injected_html =
'';
1022 $welcome_creation_msg =
'welcomecreation-msg';
1024 wfRunHooks(
'UserLoginComplete',
array( &$currentUser, &$injected_html ) );
1031 wfRunHooks(
'BeforeWelcomeCreation',
array( &$welcome_creation_msg, &$injected_html ) );
1034 $welcome_creation_msg, $injected_html );
1051 $out->addHTML( $injected_html );
1065 # Let's be nice about this, it's likely that this feature will be used
1066 # for blocking large numbers of innocent people, e.g. range blocks on
1067 # schools. Don't blame it on the user. There's a small chance that it
1068 # really is the user's fault, i.e. the username is blocked and they
1069 # haven't bothered to log out before trying to create an account to
1070 # evade it, but we'll leave that to their guilty conscience to figure
1072 $errorParams =
array(
1074 $block->mReason ? $block->mReason : $this->
msg(
'blockednoreason' )->text(),
1079 $errorMessage =
'cantcreateaccount-range-text';
1080 $errorParams[] = $this->
getRequest()->getIP();
1082 $errorMessage =
'cantcreateaccount-text';
1086 'cantcreateaccounttitle',
1107 $type, $returnTo =
'', $returnToQuery =
'', $stickHTTPs =
false
1109 $this->mReturnTo = $returnTo;
1110 $this->mReturnToQuery = $returnToQuery;
1111 $this->mStickHTTPS = $stickHTTPs;
1124 global $wgRedirectOnLogin, $wgSecureLogin;
1126 if (
$type !=
'error' && $wgRedirectOnLogin !==
null ) {
1127 $returnTo = $wgRedirectOnLogin;
1128 $returnToQuery =
array();
1131 $returnToQuery =
wfCgiToArray( $this->mReturnToQuery );
1135 if ( !$returnToTitle ) {
1139 if ( $wgSecureLogin && !$this->mStickHTTPS ) {
1142 } elseif ( $wgSecureLogin ) {
1150 if (
$type ==
'successredirect' ) {
1151 $redirectUrl = $returnToTitle->getFullURL( $returnToQuery,
false, $proto );
1152 $this->
getOutput()->redirect( $redirectUrl );
1154 $this->
getOutput()->addReturnTo( $returnToTitle, $returnToQuery,
null,
$options );
1162 global $wgEnableEmail, $wgEnableUserEmail;
1163 global $wgHiddenPrefs, $wgLoginLanguageSelector;
1164 global $wgAuth, $wgEmailConfirmToEdit, $wgCookieExpiration;
1165 global $wgSecureLogin, $wgPasswordResetRoutes;
1171 if ( $this->mType ==
'signup' ) {
1175 $permErrors = $titleObj->getUserPermissionsErrors(
'createaccount',
$user,
true );
1176 if ( count( $permErrors ) ) {
1178 } elseif (
$user->isBlockedFromCreateAccount() ) {
1188 if ( $this->mUsername ==
'' && $this->mType !=
'signup' ) {
1189 if (
$user->isLoggedIn() ) {
1190 $this->mUsername =
$user->getName();
1192 $this->mUsername = $this->
getRequest()->getCookie(
'UserName' );
1199 'mediawiki.ui.button',
1200 'mediawiki.special.userlogin.common.styles'
1203 'mediawiki.special.userlogin.common.js'
1206 if ( $this->mType ==
'signup' ) {
1209 $out->addJsConfigVars(
'wgCreateacctImgcaptchaHelp',
1210 $this->
msg(
'createacct-imgcaptcha-help' )->parse() );
1214 'mediawiki.special.userlogin.signup.js'
1217 'mediawiki.special.userlogin.signup.styles'
1223 $template->set(
'benefitCount', 3 );
1225 $q =
'action=submitlogin&type=signup';
1226 $linkq =
'type=login';
1230 'mediawiki.special.userlogin.login.styles'
1235 $q =
'action=submitlogin&type=login';
1236 $linkq =
'type=signup';
1239 if ( $this->mReturnTo !==
'' ) {
1240 $returnto =
'&returnto=' .
wfUrlencode( $this->mReturnTo );
1241 if ( $this->mReturnToQuery !==
'' ) {
1242 $returnto .=
'&returntoquery=' .
1246 $linkq .= $returnto;
1249 # Don't show a "create account" link if the user can't.
1251 # Pass any language selection on to the mode switch link
1252 if ( $wgLoginLanguageSelector && $this->mLanguage ) {
1256 $template->set(
'createOrLoginHref', $titleObj->getLocalURL( $linkq ) );
1258 $template->set(
'link',
'' );
1261 $resetLink = $this->mType ==
'signup'
1263 : is_array( $wgPasswordResetRoutes ) && in_array(
true, array_values( $wgPasswordResetRoutes ) );
1265 $template->set(
'header',
'' );
1266 $template->set(
'skin', $this->
getSkin() );
1267 $template->set(
'name', $this->mUsername );
1268 $template->set(
'password', $this->mPassword );
1269 $template->set(
'retype', $this->mRetype );
1270 $template->set(
'createemailset', $this->mCreateaccountMail );
1271 $template->set(
'email', $this->mEmail );
1272 $template->set(
'realname', $this->mRealName );
1273 $template->set(
'domain', $this->mDomain );
1274 $template->set(
'reason', $this->mReason );
1276 $template->set(
'action', $titleObj->getLocalURL( $q ) );
1277 $template->set(
'message', $msg );
1278 $template->set(
'messagetype', $msgtype );
1279 $template->set(
'createemail', $wgEnableEmail &&
$user->isLoggedIn() );
1280 $template->set(
'userealname', !in_array(
'realname', $wgHiddenPrefs ) );
1281 $template->set(
'useemail', $wgEnableEmail );
1282 $template->set(
'emailrequired', $wgEmailConfirmToEdit );
1283 $template->set(
'emailothers', $wgEnableUserEmail );
1284 $template->set(
'canreset', $wgAuth->allowPasswordChange() );
1285 $template->set(
'resetlink', $resetLink );
1286 $template->set(
'canremember', ( $wgCookieExpiration > 0 ) );
1287 $template->set(
'usereason',
$user->isLoggedIn() );
1288 $template->set(
'remember', $this->mRemember );
1289 $template->set(
'cansecurelogin', ( $wgSecureLogin ===
true ) );
1290 $template->set(
'stickhttps', (
int)$this->mStickHTTPS );
1291 $template->set(
'loggedin',
$user->isLoggedIn() );
1292 $template->set(
'loggedinuser',
$user->getName() );
1294 if ( $this->mType ==
'signup' ) {
1295 if ( !self::getCreateaccountToken() ) {
1298 $template->set(
'token', self::getCreateaccountToken() );
1300 if ( !self::getLoginToken() ) {
1303 $template->set(
'token', self::getLoginToken() );
1306 # Prepare language selection links as needed
1307 if ( $wgLoginLanguageSelector ) {
1309 if ( $this->mLanguage ) {
1310 $template->set(
'uselang', $this->mLanguage );
1314 $template->set(
'secureLoginUrl', $this->mSecureLoginUrl );
1317 $usingHTTPS = $this->mRequest->getProtocol() ==
'https';
1318 $loginendHTTPS = $this->
msg(
'loginend-https' );
1319 $signupendHTTPS = $this->
msg(
'signupend-https' );
1320 if ( $usingHTTPS && !$loginendHTTPS->isBlank() ) {
1321 $template->set(
'loginend', $loginendHTTPS->parse() );
1323 $template->set(
'loginend', $this->
msg(
'loginend' )->parse() );
1325 if ( $usingHTTPS && !$signupendHTTPS->isBlank() ) {
1326 $template->set(
'signupend', $signupendHTTPS->parse() );
1328 $template->set(
'signupend', $this->
msg(
'signupend' )->parse() );
1332 $wgAuth->modifyUITemplate( $template, $this->mType );
1333 if ( $this->mType ==
'signup' ) {
1339 $out->disallowUserJs();
1340 $out->addTemplate( $template );
1351 if ( $this->mType ==
'signup' ) {
1353 } elseif (
$user->isAllowed(
'createaccount' ) ) {
1371 global $wgDisableCookieCheck;
1373 return $wgDisableCookieCheck ?
true : $this->
getRequest()->checkSessionCookie();
1383 return $wgRequest->getSessionData(
'wsLoginToken' );
1401 $wgRequest->setSessionData(
'wsLoginToken',
null );
1411 return $wgRequest->getSessionData(
'wsCreateaccountToken' );
1427 $wgRequest->setSessionData(
'wsCreateaccountToken',
null );
1434 global $wgSecureLogin, $wgCookieSecure;
1435 if ( $wgSecureLogin && !$this->mStickHTTPS ) {
1436 $wgCookieSecure =
false;
1448 if ( $this->mReturnTo !==
'' ) {
1452 $check = $titleObj->getFullURL(
$query );
1462 if (
$type ==
'new' ) {
1464 } elseif (
$type ==
'login' ) {
1482 $msg = $this->
msg(
'loginlanguagelinks' )->inContentLanguage();
1483 if ( !$msg->isBlank() ) {
1484 $langs = explode(
"\n", $msg->text() );
1486 foreach ( $langs
as $lang ) {
1487 $lang = trim( $lang,
'* ' );
1488 $parts = explode(
'|', $lang );
1489 if ( count( $parts ) >= 2 ) {
1494 return count( $links ) > 0 ? $this->
msg(
'loginlanguagelabel' )->rawParams(
1495 $this->
getLanguage()->pipeList( $links ) )->escaped() :
'';
1512 return htmlspecialchars( $text );
1515 if ( $this->mType ==
'signup' ) {
1516 $query[
'type'] =
'signup';
1518 if ( $this->mReturnTo !==
'' ) {
1525 $attr[
'lang'] = $attr[
'hreflang'] = $targetLanguage->getHtmlCode();
1529 htmlspecialchars( $text ),