LoginForm Class Reference
[SpecialPage]

implements Special:Login More...

List of all members.

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)


Detailed Description

implements Special:Login

Definition at line 24 of file SpecialUserlogin.php.


Member Function Documentation

LoginForm::addNewAccount (  ) 

LoginForm::addNewAccountInternal (  ) 

LoginForm::addNewAccountMailPassword (  ) 

Access:
private

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.

Returns:
integer Status code

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 (  ) 

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.

Parameters:
$u User object.
$autocreate boolean -- true if this is an autocreation via auth plugin
Returns:
User object.

Definition at line 371 of file SpecialUserlogin.php.

References $u, and $wgAuth.

Referenced by addNewAccountInternal(), and attemptAutoCreate().

LoginForm::LoginForm ( &$  request,
par = '' 
)

Constructor.

Parameters:
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]

LoginForm::mailPasswordInternal ( u,
throttle = true,
emailTitle = 'passwordremindertitle',
emailText = 'passwordremindertext' 
)

Parameters:
object user
bool throttle
string message name of email title
string message name of email text
Returns:
mixed true on success, WikiError on failure
Access:
private

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]

LoginForm::makeLanguageSelector (  ) 

Produce a bar of links which allow the user to select another language during login/registration but retain "returnto".

Returns:
string

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.

Parameters:
$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 (  ) 

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.

Access:
private

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.

Access:
private

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  ) 

Access:
private

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().


Member Data Documentation

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.

Definition at line 35 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

Definition at line 32 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

const LoginForm::ILLEGAL = 2

Definition at line 28 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

Definition at line 38 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

const LoginForm::NO_NAME = 1

Definition at line 27 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

Definition at line 30 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

Definition at line 33 of file SpecialUserlogin.php.

const LoginForm::SUCCESS = 0

Definition at line 26 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

Definition at line 36 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

Definition at line 37 of file SpecialUserlogin.php.

Definition at line 31 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

Definition at line 29 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().

Definition at line 39 of file SpecialUserlogin.php.

Referenced by ApiLogin::execute().


The documentation for this class was generated from the following file:

Generated on Tue Jun 22 13:54:24 2010 for MediaWiki by  doxygen 1.5.9