MediaWiki
REL1_19
|
Implements Special:UserLogin. More...
Public Member Functions | |
__construct ($request=null) | |
addNewAccount () | |
addNewAccountInternal () | |
addNewAccountMailPassword () | |
attemptAutoCreate ($user) | |
Attempt to automatically create a user on login. | |
authenticateUserData () | |
Internally authenticate the login request. | |
cookieRedirectCheck ($type) | |
execute ($par) | |
Default execute method Checks user permissions, calls the function given in mFunction. | |
getDescription () | |
Returns the name that goes in the <h1> in the special page itself, and also the name that will be listed in Special:Specialpages. | |
hasSessionCookie () | |
Check if a session cookie is present. | |
load () | |
Loader. | |
mailPasswordInternal ($u, $throttle=true, $emailTitle= 'passwordremindertitle', $emailText= 'passwordremindertext') | |
mainLoginForm ($msg, $msgtype= 'error') | |
makeLanguageSelector () | |
Produce a bar of links which allow the user to select another language during login/registration but retain "returnto". | |
makeLanguageSelectorLink ($text, $lang) | |
Create a language selector link for a particular language Links back to this page preserving type and returnto. | |
onCookieRedirectCheck ($type) | |
processLogin () | |
resetLoginForm ($error) | |
showCreateOrLoginLink (&$user) | |
userBlockedMessage (Block $block) | |
Output a message that informs the user that they cannot create an account because there is a block on them or their IP which prevents account creation. | |
Static Public Member Functions | |
static | clearCreateaccountToken () |
Remove any createaccount token attached to the current session. | |
static | clearLoginThrottle ($username) |
Clear the login attempt throttle hit count for the (username,current IP) tuple. | |
static | clearLoginToken () |
Remove any login token attached to the current session. | |
static | getCreateaccountToken () |
Get the createaccount token from the current session. | |
static | getLoginToken () |
Get the login token from the current session. | |
static | incLoginThrottle ($username) |
Increment the login attempt throttle hit count for the (username,current IP) tuple unless the throttle was already reached. | |
static | setCreateaccountToken () |
Randomly generate a new createaccount token and attach it to the current session. | |
static | setLoginToken () |
Randomly generate a new login token and attach it to the current session. | |
Public Attributes | |
$mAbortLoginErrorMsg = 'login-abort-generic' | |
$mAction | |
$mCookieCheck | |
$mCreateaccount | |
$mCreateaccountMail | |
$mDomain | |
$mEmail | |
$mLanguage | |
$mLoginattempt | |
$mPassword | |
$mPosted | |
$mRealName | |
$mReason | |
$mRemember | |
$mReturnTo | |
$mReturnToQuery | |
$mRetype | |
$mSkipCookieCheck | |
$mStickHTTPS | |
$mToken | |
$mType | |
$mUsername | |
const | ABORTED = 8 |
const | CREATE_BLOCKED = 9 |
const | EMPTY_PASS = 6 |
const | ILLEGAL = 2 |
const | NEED_TOKEN = 12 |
const | NO_NAME = 1 |
const | NOT_EXISTS = 4 |
const | RESET_PASS = 7 |
const | SUCCESS = 0 |
const | THROTTLED = 10 |
const | USER_BLOCKED = 11 |
const | WRONG_PASS = 5 |
const | WRONG_PLUGIN_PASS = 3 |
const | WRONG_TOKEN = 13 |
Private Member Functions | |
displaySuccessfulLogin ($msgname, $injected_html) | |
Display a "login successful" page. | |
initUser ($u, $autocreate) | |
Actually add a user to the database. | |
renewSessionId () | |
Renew the user's session id, using strong entropy. | |
successfulCreation () | |
Run any hooks registered for logins, then display a message welcoming the user. | |
successfulLogin () | |
Run any hooks registered for logins, then HTTP redirect to $this->mReturnTo (or Main Page if that's undefined). | |
throttleHit ($limit) | |
Private Attributes | |
$mExtUser = null | |
$mLoaded = false | |
$mOverrideRequest = null | |
@ var WebRequest |
Implements Special:UserLogin.
Definition at line 29 of file SpecialUserlogin.php.
LoginForm::__construct | ( | $ | request = null | ) |
WebRequest | $request |
Definition at line 67 of file SpecialUserlogin.php.
Definition at line 213 of file SpecialUserlogin.php.
References $out, $wgEmailAuthentication, $wgLoginLanguageSelector, $wgUser, addNewAccountInternal(), cookieRedirectCheck(), SpecialPage\getContext(), SpecialPage\getOutput(), SpecialPage\getTitle(), SpecialPage\getUser(), hasSessionCookie(), SpecialPage\msg(), successfulCreation(), Sanitizer\validateEmail(), and wfRunHooks().
Referenced by execute().
Definition at line 274 of file SpecialUserlogin.php.
References $wgAccountCreationThrottle, $wgAuth, $wgEmailConfirmToEdit, $wgMemc, $wgMinimalPasswordLength, clearCreateaccountToken(), SpecialPage\getRequest(), SpecialPage\getTitle(), SpecialPage\getUser(), initUser(), mainLoginForm(), SpecialPage\msg(), User\newFromName(), setCreateaccountToken(), throttleHit(), userBlockedMessage(), Sanitizer\validateEmail(), wfDebug(), wfMemcKey(), wfReadOnly(), and wfRunHooks().
Referenced by addNewAccount().
Definition at line 179 of file SpecialUserlogin.php.
References $out, $result, SpecialPage\getOutput(), mailPasswordInternal(), mainLoginForm(), SpecialPage\msg(), and wfRunHooks().
Referenced by execute().
LoginForm::attemptAutoCreate | ( | $ | user | ) |
Attempt to automatically create a user on login.
Only succeeds if there is an external authentication method which allows it.
$user | User |
Definition at line 669 of file SpecialUserlogin.php.
References $user, $wgAuth, $wgAutocreatePolicy, ABORTED, CREATE_BLOCKED, SpecialPage\getUser(), initUser(), NOT_EXISTS, SUCCESS, wfDebug(), wfRunHooks(), and WRONG_PLUGIN_PASS.
Referenced by authenticateUserData().
Internally authenticate the login request.
This may create a local account as a side effect if the authentication plugin allows transparent local account creation.
Definition at line 480 of file SpecialUserlogin.php.
References $wgAuth, $wgAutocreatePolicy, $wgBlockDisablesLogin, $wgExternalAuthType, $wgUser, ABORTED, attemptAutoCreate(), clearLoginThrottle(), SpecialPage\getContext(), SpecialPage\getName(), SpecialPage\getUser(), ILLEGAL, incLoginThrottle(), User\isUsableName(), load(), NEED_TOKEN, ExternalUser\newFromName(), User\newFromName(), NO_NAME, RESET_PASS, setLoginToken(), SUCCESS, THROTTLED, USER_BLOCKED, wfDebug(), wfRunHooks(), and WRONG_TOKEN.
Referenced by processLogin().
static LoginForm::clearCreateaccountToken | ( | ) | [static] |
Remove any createaccount token attached to the current session.
Definition at line 1179 of file SpecialUserlogin.php.
Referenced by addNewAccountInternal().
static LoginForm::clearLoginThrottle | ( | $ | username | ) | [static] |
Clear the login attempt throttle hit count for the (username,current IP) tuple.
$username | string The user name |
Definition at line 653 of file SpecialUserlogin.php.
References $wgMemc, and wfMemcKey().
Referenced by SpecialChangeEmail\attemptChange(), SpecialChangePassword\attemptReset(), and authenticateUserData().
static LoginForm::clearLoginToken | ( | ) | [static] |
Remove any login token attached to the current session.
Definition at line 1155 of file SpecialUserlogin.php.
Referenced by processLogin().
LoginForm::cookieRedirectCheck | ( | $ | type | ) |
Definition at line 1204 of file SpecialUserlogin.php.
References SpecialPage\getOutput(), and SpecialPage\getTitleFor().
Referenced by addNewAccount(), and processLogin().
LoginForm::displaySuccessfulLogin | ( | $ | msgname, |
$ | injected_html | ||
) | [private] |
Display a "login successful" page.
Definition at line 904 of file SpecialUserlogin.php.
References $out, SpecialPage\getName(), SpecialPage\getOutput(), SpecialPage\getUser(), SpecialPage\msg(), and wfEscapeWikiText().
Referenced by successfulCreation(), and successfulLogin().
LoginForm::execute | ( | $ | par | ) |
Default execute method Checks user permissions, calls the function given in mFunction.
This must be overridden by subclasses; it will be made abstract in a future version
$par | String subpage string, if one was specified |
Reimplemented from SpecialPage.
Definition at line 149 of file SpecialUserlogin.php.
References addNewAccount(), addNewAccountMailPassword(), load(), mainLoginForm(), onCookieRedirectCheck(), processLogin(), SpecialPage\setHeaders(), and wfSetupSession().
static LoginForm::getCreateaccountToken | ( | ) | [static] |
Get the createaccount token from the current session.
Definition at line 1163 of file SpecialUserlogin.php.
Returns the name that goes in the <h1> in the special page itself, and also the name that will be listed in Special:Specialpages.
Derived classes can override this, but usually it is easier to keep the default behaviour. Messages can be added at run-time, see MessageCache.php.
Reimplemented from SpecialPage.
Definition at line 144 of file SpecialUserlogin.php.
References SpecialPage\getUser(), and SpecialPage\msg().
static LoginForm::getLoginToken | ( | ) | [static] |
Get the login token from the current session.
Definition at line 1137 of file SpecialUserlogin.php.
Referenced by SpecialChangePassword\execute(), and SpecialChangePassword\showForm().
Check if a session cookie is present.
This will not pick up a cookie set during _this_ request, but is meant to ensure that the client is returning the cookie which was set on a previous pass through the system.
Definition at line 1129 of file SpecialUserlogin.php.
References $wgDisableCookieCheck, and SpecialPage\getRequest().
Referenced by addNewAccount(), onCookieRedirectCheck(), and processLogin().
static LoginForm::incLoginThrottle | ( | $ | username | ) | [static] |
Increment the login attempt throttle hit count for the (username,current IP) tuple unless the throttle was already reached.
$username | string The user name |
Definition at line 625 of file SpecialUserlogin.php.
References $count, $wgMemc, $wgPasswordAttemptThrottle, and wfMemcKey().
Referenced by SpecialChangeEmail\attemptChange(), SpecialChangePassword\attemptReset(), and authenticateUserData().
LoginForm::initUser | ( | $ | u, |
$ | autocreate | ||
) | [private] |
Actually add a user to the database.
Give it a User object that has been initialised with a name.
$u | User object. |
$autocreate | boolean -- true if this is an autocreation via auth plugin |
Definition at line 440 of file SpecialUserlogin.php.
References $wgAuth.
Referenced by addNewAccountInternal(), and attemptAutoCreate().
LoginForm::load | ( | ) |
Loader.
Definition at line 76 of file SpecialUserlogin.php.
References $wgAuth, $wgEnableEmail, $wgHiddenPrefs, $wgRedirectOnLogin, SpecialPage\getRequest(), and Title\newFromText().
Referenced by authenticateUserData(), and execute().
LoginForm::mailPasswordInternal | ( | $ | u, |
$ | throttle = true , |
||
$ | emailTitle = 'passwordremindertitle' , |
||
$ | emailText = 'passwordremindertext' |
||
) |
$u | User object |
$throttle | Boolean |
$emailTitle | String: message name of email title |
$emailText | String: message name of email text |
Definition at line 819 of file SpecialUserlogin.php.
References $result, $wgNewPasswordExpiry, $wgScript, $wgServer, SpecialPage\getRequest(), SpecialPage\getUser(), SpecialPage\msg(), Status\newFatal(), and wfRunHooks().
Referenced by addNewAccountMailPassword().
LoginForm::mainLoginForm | ( | $ | msg, |
$ | msgtype = 'error' |
||
) |
Definition at line 957 of file SpecialUserlogin.php.
References $out, $user, $wgAuth, $wgCookieExpiration, $wgEmailConfirmToEdit, $wgEnableEmail, $wgEnableUserEmail, $wgHiddenPrefs, $wgLoginLanguageSelector, $wgPasswordResetRoutes, $wgSecureLogin, WebRequest\detectProtocol(), Html\element(), SpecialPage\getOutput(), SpecialPage\getRequest(), SpecialPage\getTitle(), SpecialPage\getUser(), makeLanguageSelector(), SpecialPage\msg(), setCreateaccountToken(), setLoginToken(), showCreateOrLoginLink(), userBlockedMessage(), wfReadOnly(), wfRunHooks(), and wfUrlencode().
Referenced by addNewAccountInternal(), addNewAccountMailPassword(), execute(), onCookieRedirectCheck(), processLogin(), and throttleHit().
Produce a bar of links which allow the user to select another language during login/registration but retain "returnto".
Definition at line 1246 of file SpecialUserlogin.php.
References SpecialPage\getLanguage(), makeLanguageSelectorLink(), and SpecialPage\msg().
Referenced by mainLoginForm().
LoginForm::makeLanguageSelectorLink | ( | $ | text, |
$ | lang | ||
) |
Create a language selector link for a particular language Links back to this page preserving type and returnto.
$text | Link text |
$lang | Language code |
Definition at line 1272 of file SpecialUserlogin.php.
References SpecialPage\getTitle(), and Linker\linkKnown().
Referenced by makeLanguageSelector().
LoginForm::onCookieRedirectCheck | ( | $ | type | ) |
Definition at line 1218 of file SpecialUserlogin.php.
References hasSessionCookie(), mainLoginForm(), SpecialPage\msg(), and successfulLogin().
Referenced by execute().
Definition at line 719 of file SpecialUserlogin.php.
References $user, $wgLang, $wgMemc, authenticateUserData(), clearLoginToken(), cookieRedirectCheck(), Language\factory(), SpecialPage\getContext(), SpecialPage\getRequest(), SpecialPage\getUser(), hasSessionCookie(), mainLoginForm(), SpecialPage\msg(), renewSessionId(), resetLoginForm(), successfulLogin(), userBlockedMessage(), wfEscapeWikiText(), and wfMemcKey().
Referenced by execute().
LoginForm::renewSessionId | ( | ) | [private] |
Renew the user's session id, using strong entropy.
Definition at line 1187 of file SpecialUserlogin.php.
References MWCryptRand\generateHex(), and wfCheckEntropy().
Referenced by processLogin().
LoginForm::resetLoginForm | ( | $ | error | ) |
Definition at line 805 of file SpecialUserlogin.php.
References Xml\element(), SpecialPage\getContext(), and SpecialPage\getOutput().
Referenced by processLogin().
static LoginForm::setCreateaccountToken | ( | ) | [static] |
Randomly generate a new createaccount token and attach it to the current session.
Definition at line 1171 of file SpecialUserlogin.php.
References MWCryptRand\generateHex().
Referenced by addNewAccountInternal(), and mainLoginForm().
static LoginForm::setLoginToken | ( | ) | [static] |
Randomly generate a new login token and attach it to the current session.
Definition at line 1145 of file SpecialUserlogin.php.
References MWCryptRand\generateHex().
Referenced by authenticateUserData(), SpecialChangePassword\execute(), and mainLoginForm().
LoginForm::showCreateOrLoginLink | ( | &$ | user | ) |
$user | User |
Definition at line 1110 of file SpecialUserlogin.php.
References $user.
Referenced by mainLoginForm().
LoginForm::successfulCreation | ( | ) | [private] |
Run any hooks registered for logins, then display a message welcoming the user.
Definition at line 883 of file SpecialUserlogin.php.
References displaySuccessfulLogin(), SpecialPage\getUser(), and wfRunHooks().
Referenced by addNewAccount().
LoginForm::successfulLogin | ( | ) | [private] |
Run any hooks registered for logins, then HTTP redirect to $this->mReturnTo (or Main Page if that's undefined).
Formerly we had a nice message here, but that's really not as useful as just being sent to wherever you logged in from. It should be clear that the action was successful, given the lack of error messages plus the appearance of your name in the upper right.
Definition at line 855 of file SpecialUserlogin.php.
References $wgSecureLogin, displaySuccessfulLogin(), SpecialPage\getOutput(), SpecialPage\getUser(), Title\newFromText(), Title\newMainPage(), and wfRunHooks().
Referenced by onCookieRedirectCheck(), and processLogin().
LoginForm::throttleHit | ( | $ | limit | ) | [private] |
Definition at line 1236 of file SpecialUserlogin.php.
References $limit, mainLoginForm(), and SpecialPage\msg().
Referenced by addNewAccountInternal().
LoginForm::userBlockedMessage | ( | Block $ | block | ) |
Output a message that informs the user that they cannot create an account because there is a block on them or their IP which prevents account creation.
Note that User::isBlockedFromCreateAccount(), which gets this block, ignores the 'hardblock' setting on blocks (bug 13611).
$block | Block the block causing this error |
Definition at line 927 of file SpecialUserlogin.php.
References $out, Block\getByName(), SpecialPage\getOutput(), Block\getTarget(), and SpecialPage\msg().
Referenced by addNewAccountInternal(), mainLoginForm(), and processLogin().
LoginForm::$mAbortLoginErrorMsg = 'login-abort-generic' |
Definition at line 51 of file SpecialUserlogin.php.
LoginForm::$mAction |
Definition at line 47 of file SpecialUserlogin.php.
LoginForm::$mCookieCheck |
Definition at line 46 of file SpecialUserlogin.php.
LoginForm::$mCreateaccount |
Definition at line 47 of file SpecialUserlogin.php.
LoginForm::$mCreateaccountMail |
Definition at line 47 of file SpecialUserlogin.php.
LoginForm::$mDomain |
Definition at line 48 of file SpecialUserlogin.php.
LoginForm::$mEmail |
Definition at line 48 of file SpecialUserlogin.php.
LoginForm::$mExtUser = null [private] |
Definition at line 57 of file SpecialUserlogin.php.
LoginForm::$mLanguage |
Definition at line 48 of file SpecialUserlogin.php.
LoginForm::$mLoaded = false [private] |
Definition at line 52 of file SpecialUserlogin.php.
LoginForm::$mLoginattempt |
Definition at line 48 of file SpecialUserlogin.php.
LoginForm::$mOverrideRequest = null [private] |
@ var WebRequest
Definition at line 62 of file SpecialUserlogin.php.
LoginForm::$mPassword |
Definition at line 46 of file SpecialUserlogin.php.
LoginForm::$mPosted |
Definition at line 46 of file SpecialUserlogin.php.
LoginForm::$mRealName |
Definition at line 50 of file SpecialUserlogin.php.
LoginForm::$mReason |
Definition at line 50 of file SpecialUserlogin.php.
LoginForm::$mRemember |
Definition at line 48 of file SpecialUserlogin.php.
LoginForm::$mReturnTo |
Definition at line 46 of file SpecialUserlogin.php.
LoginForm::$mReturnToQuery |
Definition at line 49 of file SpecialUserlogin.php.
LoginForm::$mRetype |
Definition at line 46 of file SpecialUserlogin.php.
LoginForm::$mSkipCookieCheck |
Definition at line 49 of file SpecialUserlogin.php.
LoginForm::$mStickHTTPS |
Definition at line 49 of file SpecialUserlogin.php.
LoginForm::$mToken |
Definition at line 49 of file SpecialUserlogin.php.
LoginForm::$mType |
Definition at line 50 of file SpecialUserlogin.php.
LoginForm::$mUsername |
Definition at line 46 of file SpecialUserlogin.php.
const LoginForm::ABORTED = 8 |
Definition at line 39 of file SpecialUserlogin.php.
Referenced by attemptAutoCreate(), authenticateUserData(), and ApiLogin\execute().
const LoginForm::CREATE_BLOCKED = 9 |
Definition at line 40 of file SpecialUserlogin.php.
Referenced by attemptAutoCreate(), and ApiLogin\execute().
const LoginForm::EMPTY_PASS = 6 |
Definition at line 37 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::ILLEGAL = 2 |
Definition at line 33 of file SpecialUserlogin.php.
Referenced by authenticateUserData(), and ApiLogin\execute().
const LoginForm::NEED_TOKEN = 12 |
Definition at line 43 of file SpecialUserlogin.php.
Referenced by authenticateUserData(), and ApiLogin\execute().
const LoginForm::NO_NAME = 1 |
Definition at line 32 of file SpecialUserlogin.php.
Referenced by authenticateUserData(), and ApiLogin\execute().
const LoginForm::NOT_EXISTS = 4 |
Definition at line 35 of file SpecialUserlogin.php.
Referenced by attemptAutoCreate(), and ApiLogin\execute().
const LoginForm::RESET_PASS = 7 |
Definition at line 38 of file SpecialUserlogin.php.
Referenced by authenticateUserData(), and ApiLogin\execute().
const LoginForm::SUCCESS = 0 |
Definition at line 31 of file SpecialUserlogin.php.
Referenced by attemptAutoCreate(), authenticateUserData(), and ApiLogin\execute().
const LoginForm::THROTTLED = 10 |
Definition at line 41 of file SpecialUserlogin.php.
Referenced by authenticateUserData(), and ApiLogin\execute().
const LoginForm::USER_BLOCKED = 11 |
Definition at line 42 of file SpecialUserlogin.php.
Referenced by authenticateUserData(), and ApiLogin\execute().
const LoginForm::WRONG_PASS = 5 |
Definition at line 36 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::WRONG_PLUGIN_PASS = 3 |
Definition at line 34 of file SpecialUserlogin.php.
Referenced by attemptAutoCreate(), and ApiLogin\execute().
const LoginForm::WRONG_TOKEN = 13 |
Definition at line 44 of file SpecialUserlogin.php.
Referenced by authenticateUserData(), and ApiLogin\execute().