Public Member Functions | |
LoginForm (&$request, $par= '') | |
Constructor. | |
execute () | |
addNewAccountMailPassword () | |
addNewAccount () | |
addNewAccountInternal () | |
authenticateUserData () | |
Internally authenticate the login request. | |
attemptAutoCreate ($user) | |
Attempt to automatically create a user on login. | |
processLogin () | |
resetLoginForm ($error) | |
mailPasswordInternal ($u, $throttle=true, $emailTitle= 'passwordremindertitle', $emailText= 'passwordremindertext') | |
successfulLogin () | |
Run any hooks registered for logins, then HTTP redirect to $this->mReturnTo (or Main Page if that's undefined). | |
successfulCreation () | |
Run any hooks registered for logins, then display a message welcoming the user. | |
userNotPrivilegedMessage ($errors) | |
userBlockedMessage () | |
throttleHit ($limit) | |
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. | |
Static Public Member Functions | |
static | getLoginToken () |
Get the login token from the current session. | |
static | setLoginToken () |
Randomly generate a new login token and attach it to the current session. | |
static | clearLoginToken () |
Remove any login token attached to the current session. | |
static | getCreateaccountToken () |
Get the createaccount token from the current session. | |
static | setCreateaccountToken () |
Randomly generate a new createaccount token and attach it to the current session. | |
static | clearCreateaccountToken () |
Remove any createaccount token attached to the current session. | |
Public Attributes | |
const | SUCCESS = 0 |
const | NO_NAME = 1 |
const | ILLEGAL = 2 |
const | WRONG_PLUGIN_PASS = 3 |
const | NOT_EXISTS = 4 |
const | WRONG_PASS = 5 |
const | EMPTY_PASS = 6 |
const | RESET_PASS = 7 |
const | ABORTED = 8 |
const | CREATE_BLOCKED = 9 |
const | THROTTLED = 10 |
const | USER_BLOCKED = 11 |
const | NEED_TOKEN = 12 |
const | WRONG_TOKEN = 13 |
$mName | |
$mPassword | |
$mRetype | |
$mReturnTo | |
$mCookieCheck | |
$mPosted | |
$mAction | |
$mCreateaccount | |
$mCreateaccountMail | |
$mMailmypassword | |
$mLoginattempt | |
$mRemember | |
$mEmail | |
$mDomain | |
$mLanguage | |
$mSkipCookieCheck | |
$mToken | |
Private Member Functions | |
initUser ($u, $autocreate) | |
Actually add a user to the database. | |
mailPassword () | |
displaySuccessfulLogin ($msgname, $injected_html) | |
Display a "login successful" page. | |
mainLoginForm ($msg, $msgtype= 'error') | |
showCreateOrLoginLink (&$user) | |
hasSessionCookie () | |
Check if a session cookie is present. | |
cookieRedirectCheck ($type) | |
onCookieRedirectCheck ($type) |
Definition at line 24 of file SpecialUserlogin.php.
LoginForm::addNewAccount | ( | ) |
Definition at line 160 of file SpecialUserlogin.php.
References $error, $self, $u, $wgEmailAuthentication, $wgLoginLanguageSelector, $wgOut, $wgUser, addNewAccountInternal(), cookieRedirectCheck(), SpecialPage::getTitleFor(), hasSessionCookie(), WikiError::isError(), User::isValidEmailAddr(), successfulCreation(), wfMsgHtml(), wfMsgWikiHtml(), and wfRunHooks().
Referenced by execute().
LoginForm::addNewAccountInternal | ( | ) |
Definition at line 219 of file SpecialUserlogin.php.
References $key, $name, $u, $wgAccountCreationThrottle, $wgAuth, $wgEmailConfirmToEdit, $wgEnableSorbs, $wgMemc, $wgMinimalPasswordLength, $wgOut, $wgProxyWhitelist, $wgUser, clearCreateaccountToken(), initUser(), User::isValidEmailAddr(), mainLoginForm(), User::newFromName(), setCreateaccountToken(), throttleHit(), userBlockedMessage(), userNotPrivilegedMessage(), wfDebug(), wfGetIP(), wfMemcKey(), wfMsg(), wfMsgExt(), wfReadOnly(), and wfRunHooks().
Referenced by addNewAccount().
LoginForm::addNewAccountMailPassword | ( | ) |
Definition at line 121 of file SpecialUserlogin.php.
References $result, $u, $wgOut, WikiError::isError(), mailPasswordInternal(), mainLoginForm(), wfMsg(), 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.
Definition at line 538 of file SpecialUserlogin.php.
References $user, $wgAuth, $wgUser, initUser(), and wfDebug().
Referenced by authenticateUserData().
LoginForm::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 405 of file SpecialUserlogin.php.
References $count, $status, $u, $wgAuth, $wgMemc, $wgPasswordAttemptThrottle, $wgUser, attemptAutoCreate(), User::isUsableName(), User::newFromName(), setLoginToken(), wfDebug(), wfGetIP(), wfMemcKey(), and wfRunHooks().
Referenced by processLogin().
static LoginForm::clearCreateaccountToken | ( | ) | [static] |
Remove any createaccount token attached to the current session.
Definition at line 1060 of file SpecialUserlogin.php.
References $wgRequest.
Referenced by addNewAccountInternal().
static LoginForm::clearLoginToken | ( | ) | [static] |
Remove any login token attached to the current session.
Definition at line 1036 of file SpecialUserlogin.php.
References $wgRequest.
Referenced by mailPassword(), and processLogin().
LoginForm::cookieRedirectCheck | ( | $ | type | ) | [private] |
Definition at line 1068 of file SpecialUserlogin.php.
References $type, $wgOut, and SpecialPage::getTitleFor().
Referenced by addNewAccount(), and processLogin().
LoginForm::displaySuccessfulLogin | ( | $ | msgname, | |
$ | injected_html | |||
) | [private] |
Display a "login successful" page.
Definition at line 808 of file SpecialUserlogin.php.
References $wgOut, $wgUser, and wfMsg().
Referenced by successfulCreation(), and successfulLogin().
LoginForm::execute | ( | ) |
Definition at line 100 of file SpecialUserlogin.php.
References addNewAccount(), addNewAccountMailPassword(), mailPassword(), mainLoginForm(), onCookieRedirectCheck(), and processLogin().
static LoginForm::getCreateaccountToken | ( | ) | [static] |
Get the createaccount token from the current session.
Definition at line 1044 of file SpecialUserlogin.php.
References $wgRequest.
static LoginForm::getLoginToken | ( | ) | [static] |
Get the login token from the current session.
Definition at line 1018 of file SpecialUserlogin.php.
References $wgRequest.
LoginForm::hasSessionCookie | ( | ) | [private] |
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 1010 of file SpecialUserlogin.php.
References $wgDisableCookieCheck, and $wgRequest.
Referenced by addNewAccount(), onCookieRedirectCheck(), and processLogin().
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 371 of file SpecialUserlogin.php.
Referenced by addNewAccountInternal(), and attemptAutoCreate().
LoginForm::LoginForm | ( | &$ | request, | |
$ | par = '' | |||
) |
Constructor.
WebRequest | $request A WebRequest object passed by reference |
Definition at line 50 of file SpecialUserlogin.php.
References $wgAllowRealName, $wgAuth, $wgEnableEmail, $wgLang, and $wgRedirectOnLogin.
LoginForm::mailPassword | ( | ) | [private] |
Definition at line 648 of file SpecialUserlogin.php.
References $result, $u, $wgAuth, $wgOut, $wgPasswordReminderResendTime, $wgUser, clearLoginToken(), WikiError::isError(), mailPasswordInternal(), mainLoginForm(), User::newFromName(), setLoginToken(), wfMsg(), wfMsgExt(), wfMsgWikiHtml(), and wfReadOnly().
Referenced by execute().
LoginForm::mailPasswordInternal | ( | $ | u, | |
$ | throttle = true , |
|||
$ | emailTitle = 'passwordremindertitle' , |
|||
$ | emailText = 'passwordremindertext' | |||
) |
object | user | |
bool | throttle | |
string | message name of email title | |
string | message name of email text |
Definition at line 735 of file SpecialUserlogin.php.
References $result, $u, $wgNewPasswordExpiry, $wgScript, $wgServer, $wgUser, wfGetIP(), wfMsg(), wfMsgExt(), and wfRunHooks().
Referenced by addNewAccountMailPassword(), and mailPassword().
LoginForm::mainLoginForm | ( | $ | msg, | |
$ | msgtype = 'error' | |||
) | [private] |
Definition at line 870 of file SpecialUserlogin.php.
References $msg, $wgAllowRealName, $wgAuth, $wgCookieExpiration, $wgCookiePrefix, $wgEmailConfirmToEdit, $wgEnableEmail, $wgLoginLanguageSelector, $wgOut, $wgUser, SpecialPage::getTitleFor(), makeLanguageSelector(), setCreateaccountToken(), setLoginToken(), showCreateOrLoginLink(), userBlockedMessage(), wfMsg(), wfMsgHtml(), wfReadOnly(), wfRunHooks(), and wfUrlencode().
Referenced by addNewAccountInternal(), addNewAccountMailPassword(), execute(), mailPassword(), onCookieRedirectCheck(), processLogin(), and throttleHit().
LoginForm::makeLanguageSelector | ( | ) |
Produce a bar of links which allow the user to select another language during login/registration but retain "returnto".
Definition at line 1112 of file SpecialUserlogin.php.
References $langs, $msg, $wgLang, makeLanguageSelectorLink(), wfEmptyMsg(), wfMsgForContent(), and wfMsgHtml().
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 1139 of file SpecialUserlogin.php.
References $self, $text, $wgUser, and SpecialPage::getTitleFor().
Referenced by makeLanguageSelector().
LoginForm::onCookieRedirectCheck | ( | $ | type | ) | [private] |
Definition at line 1082 of file SpecialUserlogin.php.
References $type, $wgUser, hasSessionCookie(), mainLoginForm(), successfulLogin(), wfMsg(), and wfMsgExt().
Referenced by execute().
LoginForm::processLogin | ( | ) |
Definition at line 566 of file SpecialUserlogin.php.
References $code, $key, $wgAuth, $wgLang, $wgMemc, $wgRequest, $wgUser, authenticateUserData(), clearLoginToken(), cookieRedirectCheck(), Language::factory(), hasSessionCookie(), mainLoginForm(), resetLoginForm(), successfulLogin(), userBlockedMessage(), wfGetIP(), wfMemcKey(), wfMsg(), and wfMsgWikiHtml().
Referenced by execute().
LoginForm::resetLoginForm | ( | $ | error | ) |
Definition at line 638 of file SpecialUserlogin.php.
References $error, $wgOut, and Xml::element().
Referenced by processLogin().
static LoginForm::setCreateaccountToken | ( | ) | [static] |
Randomly generate a new createaccount token and attach it to the current session.
Definition at line 1052 of file SpecialUserlogin.php.
References $wgRequest, and User::generateToken().
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 1026 of file SpecialUserlogin.php.
References $wgRequest, and User::generateToken().
Referenced by authenticateUserData(), mailPassword(), and mainLoginForm().
LoginForm::showCreateOrLoginLink | ( | &$ | user | ) | [private] |
Definition at line 991 of file SpecialUserlogin.php.
References $user.
Referenced by mainLoginForm().
LoginForm::successfulCreation | ( | ) |
Run any hooks registered for logins, then display a message welcoming the user.
Definition at line 795 of file SpecialUserlogin.php.
References $wgOut, $wgUser, displaySuccessfulLogin(), and wfRunHooks().
Referenced by addNewAccount().
LoginForm::successfulLogin | ( | ) |
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 770 of file SpecialUserlogin.php.
References $wgOut, $wgUser, displaySuccessfulLogin(), Title::newFromText(), Title::newMainPage(), and wfRunHooks().
Referenced by onCookieRedirectCheck(), and processLogin().
LoginForm::throttleHit | ( | $ | limit | ) |
Definition at line 1102 of file SpecialUserlogin.php.
References mainLoginForm(), and wfMsgExt().
Referenced by addNewAccountInternal().
LoginForm::userBlockedMessage | ( | ) |
Definition at line 841 of file SpecialUserlogin.php.
References $wgOut, $wgUser, wfGetIP(), wfMsg(), and User::whoIs().
Referenced by addNewAccountInternal(), mainLoginForm(), and processLogin().
LoginForm::userNotPrivilegedMessage | ( | $ | errors | ) |
Definition at line 825 of file SpecialUserlogin.php.
References $wgOut, and wfMsg().
Referenced by addNewAccountInternal().
LoginForm::$mAction |
Definition at line 42 of file SpecialUserlogin.php.
LoginForm::$mCookieCheck |
Definition at line 41 of file SpecialUserlogin.php.
LoginForm::$mCreateaccount |
Definition at line 42 of file SpecialUserlogin.php.
LoginForm::$mCreateaccountMail |
Definition at line 42 of file SpecialUserlogin.php.
LoginForm::$mDomain |
Definition at line 43 of file SpecialUserlogin.php.
LoginForm::$mEmail |
Definition at line 43 of file SpecialUserlogin.php.
LoginForm::$mLanguage |
Definition at line 43 of file SpecialUserlogin.php.
LoginForm::$mLoginattempt |
Definition at line 43 of file SpecialUserlogin.php.
LoginForm::$mMailmypassword |
Definition at line 42 of file SpecialUserlogin.php.
LoginForm::$mName |
Definition at line 41 of file SpecialUserlogin.php.
LoginForm::$mPassword |
Definition at line 41 of file SpecialUserlogin.php.
LoginForm::$mPosted |
Definition at line 41 of file SpecialUserlogin.php.
LoginForm::$mRemember |
Definition at line 43 of file SpecialUserlogin.php.
LoginForm::$mReturnTo |
Definition at line 41 of file SpecialUserlogin.php.
LoginForm::$mRetype |
Definition at line 41 of file SpecialUserlogin.php.
LoginForm::$mSkipCookieCheck |
Definition at line 43 of file SpecialUserlogin.php.
LoginForm::$mToken |
Definition at line 44 of file SpecialUserlogin.php.
const LoginForm::ABORTED = 8 |
Definition at line 34 of file SpecialUserlogin.php.
const LoginForm::CREATE_BLOCKED = 9 |
const LoginForm::EMPTY_PASS = 6 |
const LoginForm::ILLEGAL = 2 |
const LoginForm::NEED_TOKEN = 12 |
const LoginForm::NO_NAME = 1 |
const LoginForm::NOT_EXISTS = 4 |
const LoginForm::RESET_PASS = 7 |
Definition at line 33 of file SpecialUserlogin.php.
const LoginForm::SUCCESS = 0 |
const LoginForm::THROTTLED = 10 |
const LoginForm::USER_BLOCKED = 11 |
Definition at line 37 of file SpecialUserlogin.php.
const LoginForm::WRONG_PASS = 5 |
const LoginForm::WRONG_PLUGIN_PASS = 3 |
const LoginForm::WRONG_TOKEN = 13 |