MediaWiki
REL1_23
|
Implements Special:UserLogin. More...
Public Member Functions | |
__construct ($request=null) | |
addNewAccount () | |
addNewAccountInternal () | |
Make a new user account using the loaded data. | |
addNewAccountMailPassword () | |
attemptAutoCreate ($user) | |
Attempt to automatically create a user on login. | |
authenticateUserData () | |
Internally authenticate the login request. | |
cookieRedirectCheck ($type) | |
execute ($subPage) | |
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. | |
initUser ($u, $autocreate) | |
Actually add a user to the database. | |
load () | |
Loader. | |
mailPasswordInternal ($u, $throttle=true, $emailTitle= 'passwordremindertitle', $emailText= 'passwordremindertext') | |
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 () | |
showReturnToPage ($type, $returnTo= '', $returnToQuery= '', $stickHTTPs=false) | |
Add a "return to" link or redirect to it. | |
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 = null | |
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 |
Protected Member Functions | |
getGroupName () | |
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'. | |
resetLoginForm (Message $msg) | |
Show the Special:ChangePassword form, with custom message. | |
Protected Attributes | |
$mAction | |
$mCookieCheck | |
$mCreateaccount | |
$mCreateaccountMail | |
$mDomain | |
$mEmail | |
$mLanguage | |
$mLoginattempt | |
$mPassword | |
$mPosted | |
$mRealName | |
$mReason | |
$mRemember | |
$mReturnTo | |
$mReturnToQuery | |
$mRetype | |
$mSkipCookieCheck | |
$mStickHTTPS | |
$mToken | |
$mType | |
$mUsername | |
Private Member Functions | |
displaySuccessfulAction ($title, $msgname, $injected_html) | |
Display an "successful action" page. | |
executeReturnTo ($type) | |
Add a "return to" link or redirect to it. | |
mainLoginForm ($msg, $msgtype= 'error') | |
renewSessionId () | |
Renew the user's session id, using strong entropy. | |
showCreateOrLoginLink (&$user) | |
Whether the login/create account form should display a link to the other form (in addition to whatever the skin provides). | |
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). | |
Private Attributes | |
$mLoaded = false | |
WebRequest | $mOverrideRequest = null |
* | |
WebRequest | $mRequest = null |
Effective request; set at the beginning of load *. | |
$mSecureLoginUrl | |
$mTempPasswordUsed |
Implements Special:UserLogin.
Definition at line 29 of file SpecialUserlogin.php.
LoginForm::__construct | ( | $ | request = null | ) |
WebRequest | $request |
Definition at line 80 of file SpecialUserlogin.php.
Definition at line 276 of file SpecialUserlogin.php.
Referenced by execute().
Make a new user account using the loaded data.
PermissionsError|ReadOnlyError |
Definition at line 358 of file SpecialUserlogin.php.
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 767 of file SpecialUserlogin.php.
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 579 of file SpecialUserlogin.php.
static LoginForm::clearCreateaccountToken | ( | ) | [static] |
Remove any createaccount token attached to the current session.
Definition at line 1423 of file SpecialUserlogin.php.
static LoginForm::clearLoginThrottle | ( | $ | username | ) | [static] |
Clear the login attempt throttle hit count for the (username,current IP) tuple.
string | $username | The user name |
Definition at line 751 of file SpecialUserlogin.php.
Referenced by SpecialChangePassword\attemptReset().
static LoginForm::clearLoginToken | ( | ) | [static] |
Remove any login token attached to the current session.
Definition at line 1397 of file SpecialUserlogin.php.
LoginForm::cookieRedirectCheck | ( | $ | type | ) |
Definition at line 1443 of file SpecialUserlogin.php.
LoginForm::displaySuccessfulAction | ( | $ | title, |
$ | msgname, | ||
$ | injected_html | ||
) | [private] |
Display an "successful action" page.
string | Message | $title | page's title |
$msgname | string | |
$injected_html | string |
Definition at line 1042 of file SpecialUserlogin.php.
LoginForm::execute | ( | $ | subPage | ) |
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
string | null | $subPage |
Reimplemented from SpecialPage.
Definition at line 169 of file SpecialUserlogin.php.
References $query, $title, addNewAccount(), addNewAccountMailPassword(), array(), SpecialPage\getFullTitle(), SpecialPage\getOutput(), SpecialPage\getRequest(), global, load(), mainLoginForm(), onCookieRedirectCheck(), processLogin(), SpecialPage\setHeaders(), wfAppendQuery(), wfCanIPUseHTTPS(), and wfSetupSession().
LoginForm::executeReturnTo | ( | $ | type | ) | [private] |
Add a "return to" link or redirect to it.
$type | string, one of the following:
|
Definition at line 1121 of file SpecialUserlogin.php.
static LoginForm::getCreateaccountToken | ( | ) | [static] |
Get the createaccount token from the current session.
Definition at line 1406 of file SpecialUserlogin.php.
Referenced by ApiCreateAccount\execute(), ApiCreateAccountTest\testExistingUser(), ApiCreateAccountTest\testInvalidEmail(), ApiCreateAccountTest\testNoName(), and ApiCreateAccountTest\testNoPassword().
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 behavior.
Reimplemented from SpecialPage.
Definition at line 158 of file SpecialUserlogin.php.
LoginForm::getGroupName | ( | ) | [protected] |
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.
Reimplemented from SpecialPage.
Definition at line 1533 of file SpecialUserlogin.php.
static LoginForm::getLoginToken | ( | ) | [static] |
Get the login token from the current session.
Definition at line 1378 of file SpecialUserlogin.php.
Referenced by SpecialChangePassword\getFormFields(), SpecialChangePassword\onSubmit(), and SpecialChangePassword\onSuccess().
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 1368 of file SpecialUserlogin.php.
static LoginForm::incLoginThrottle | ( | $ | username | ) | [static] |
Increment the login attempt throttle hit count for the (username,current IP) tuple unless the throttle was already reached.
string | $username | The user name |
Definition at line 723 of file SpecialUserlogin.php.
Referenced by SpecialChangePassword\attemptReset().
LoginForm::initUser | ( | $ | u, |
$ | autocreate | ||
) |
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 542 of file SpecialUserlogin.php.
LoginForm::load | ( | ) |
LoginForm::mailPasswordInternal | ( | $ | u, |
$ | throttle = true , |
||
$ | emailTitle = 'passwordremindertitle' , |
||
$ | emailText = 'passwordremindertext' |
||
) |
$u | User object | |
$throttle | Boolean | |
string | $emailTitle | message name of email title |
string | $emailText | message name of email text |
Definition at line 955 of file SpecialUserlogin.php.
LoginForm::mainLoginForm | ( | $ | msg, |
$ | msgtype = 'error' |
||
) | [private] |
Definition at line 1159 of file SpecialUserlogin.php.
Referenced by execute().
Produce a bar of links which allow the user to select another language during login/registration but retain "returnto".
Definition at line 1479 of file SpecialUserlogin.php.
LoginForm::makeLanguageSelectorLink | ( | $ | text, |
$ | lang | ||
) |
Create a language selector link for a particular language Links back to this page preserving type and returnto.
string | $text | Link text |
string | $lang | Language code |
Definition at line 1507 of file SpecialUserlogin.php.
LoginForm::onCookieRedirectCheck | ( | $ | type | ) |
Definition at line 814 of file SpecialUserlogin.php.
Referenced by execute().
LoginForm::renewSessionId | ( | ) | [private] |
Renew the user's session id, using strong entropy.
Definition at line 1431 of file SpecialUserlogin.php.
LoginForm::resetLoginForm | ( | Message $ | msg | ) | [protected] |
Show the Special:ChangePassword form, with custom message.
Message | $msg |
Definition at line 934 of file SpecialUserlogin.php.
static LoginForm::setCreateaccountToken | ( | ) | [static] |
Randomly generate a new createaccount token and attach it to the current session.
Definition at line 1415 of file SpecialUserlogin.php.
Referenced by ApiCreateAccountTest\setUp().
static LoginForm::setLoginToken | ( | ) | [static] |
Randomly generate a new login token and attach it to the current session.
Definition at line 1387 of file SpecialUserlogin.php.
Referenced by SpecialChangePassword\getFormFields(), and SpecialChangePassword\onSuccess().
LoginForm::showCreateOrLoginLink | ( | &$ | user | ) | [private] |
Whether the login/create account form should display a link to the other form (in addition to whatever the skin provides).
$user | User |
Definition at line 1348 of file SpecialUserlogin.php.
LoginForm::showReturnToPage | ( | $ | type, |
$ | returnTo = '' , |
||
$ | returnToQuery = '' , |
||
$ | stickHTTPs = false |
||
) |
Add a "return to" link or redirect to it.
Extensions can use this to reuse the "return to" logic after inject steps (such as redirection) into the login process.
$type | string, one of the following:
| |
string | $returnTo | |
array | string | $returnToQuery | |
bool | $stickHTTPs | Keep redirect link on HTTPs |
Definition at line 1104 of file SpecialUserlogin.php.
LoginForm::successfulCreation | ( | ) | [private] |
Run any hooks registered for logins, then display a message welcoming the user.
Definition at line 1016 of file SpecialUserlogin.php.
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 996 of file SpecialUserlogin.php.
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 |
ErrorPageError |
Definition at line 1062 of file SpecialUserlogin.php.
LoginForm::$mAbortLoginErrorMsg = null |
Definition at line 45 of file SpecialUserlogin.php.
LoginForm::$mAction [protected] |
Definition at line 53 of file SpecialUserlogin.php.
LoginForm::$mCookieCheck [protected] |
Definition at line 51 of file SpecialUserlogin.php.
LoginForm::$mCreateaccount [protected] |
Definition at line 54 of file SpecialUserlogin.php.
LoginForm::$mCreateaccountMail [protected] |
Definition at line 55 of file SpecialUserlogin.php.
LoginForm::$mDomain [protected] |
Definition at line 59 of file SpecialUserlogin.php.
LoginForm::$mEmail [protected] |
Definition at line 58 of file SpecialUserlogin.php.
LoginForm::$mLanguage [protected] |
Definition at line 60 of file SpecialUserlogin.php.
LoginForm::$mLoaded = false [private] |
Definition at line 70 of file SpecialUserlogin.php.
LoginForm::$mLoginattempt [protected] |
Definition at line 56 of file SpecialUserlogin.php.
WebRequest LoginForm::$mOverrideRequest = null [private] |
*
Definition at line 73 of file SpecialUserlogin.php.
LoginForm::$mPassword [protected] |
Definition at line 48 of file SpecialUserlogin.php.
LoginForm::$mPosted [protected] |
Definition at line 52 of file SpecialUserlogin.php.
LoginForm::$mRealName [protected] |
Definition at line 67 of file SpecialUserlogin.php.
LoginForm::$mReason [protected] |
Definition at line 66 of file SpecialUserlogin.php.
LoginForm::$mRemember [protected] |
Definition at line 57 of file SpecialUserlogin.php.
WebRequest LoginForm::$mRequest = null [private] |
Effective request; set at the beginning of load *.
Definition at line 75 of file SpecialUserlogin.php.
LoginForm::$mReturnTo [protected] |
Definition at line 50 of file SpecialUserlogin.php.
LoginForm::$mReturnToQuery [protected] |
Definition at line 62 of file SpecialUserlogin.php.
LoginForm::$mRetype [protected] |
Definition at line 49 of file SpecialUserlogin.php.
LoginForm::$mSecureLoginUrl [private] |
Definition at line 71 of file SpecialUserlogin.php.
LoginForm::$mSkipCookieCheck [protected] |
Definition at line 61 of file SpecialUserlogin.php.
LoginForm::$mStickHTTPS [protected] |
Definition at line 64 of file SpecialUserlogin.php.
LoginForm::$mTempPasswordUsed [private] |
Definition at line 69 of file SpecialUserlogin.php.
LoginForm::$mToken [protected] |
Definition at line 63 of file SpecialUserlogin.php.
LoginForm::$mType [protected] |
Definition at line 65 of file SpecialUserlogin.php.
LoginForm::$mUsername [protected] |
Definition at line 47 of file SpecialUserlogin.php.
const LoginForm::ABORTED = 8 |
Definition at line 38 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::CREATE_BLOCKED = 9 |
Definition at line 39 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::EMPTY_PASS = 6 |
Definition at line 36 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::ILLEGAL = 2 |
Definition at line 32 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::NEED_TOKEN = 12 |
Definition at line 42 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::NO_NAME = 1 |
Definition at line 31 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::NOT_EXISTS = 4 |
Definition at line 34 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::RESET_PASS = 7 |
Definition at line 37 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::SUCCESS = 0 |
Definition at line 30 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::THROTTLED = 10 |
Definition at line 40 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::USER_BLOCKED = 11 |
Definition at line 41 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::WRONG_PASS = 5 |
Definition at line 35 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::WRONG_PLUGIN_PASS = 3 |
Definition at line 33 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().
const LoginForm::WRONG_TOKEN = 13 |
Definition at line 43 of file SpecialUserlogin.php.
Referenced by ApiLogin\execute().