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
 $mReturnToQuery
 $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)

Private Attributes

 $mExtUser = null


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 127 of file SpecialUserlogin.php.

References $result, $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 566 of file SpecialUserlogin.php.

References $wgAuth, $wgAutocreatePolicy, $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 415 of file SpecialUserlogin.php.

References $wgAuth, $wgAutocreatePolicy, $wgBlockDisablesLogin, $wgExternalAuthType, $wgMemc, $wgPasswordAttemptThrottle, $wgUser, attemptAutoCreate(), User::isUsableName(), User::newFromName(), ExternalUser::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 1120 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 1096 of file SpecialUserlogin.php.

References $wgRequest.

Referenced by mailPassword(), and processLogin().

LoginForm::cookieRedirectCheck ( type  )  [private]

Definition at line 1128 of file SpecialUserlogin.php.

References $wgOut, and SpecialPage::getTitleFor().

Referenced by addNewAccount(), and processLogin().

LoginForm::displaySuccessfulLogin ( msgname,
injected_html 
) [private]

Display a "login successful" page.

Definition at line 859 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 1104 of file SpecialUserlogin.php.

References $wgRequest.

static LoginForm::getLoginToken (  )  [static]

Get the login token from the current session.

Definition at line 1078 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 1070 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 375 of file SpecialUserlogin.php.

References $wgAuth.

Referenced by addNewAccountInternal(), and attemptAutoCreate().

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

Constructor.

Parameters:
$request WebRequest: a WebRequest object passed by reference
$par String: subpage parameter

Definition at line 53 of file SpecialUserlogin.php.

References $wgAuth, $wgEnableEmail, $wgHiddenPrefs, $wgRedirectOnLogin, and Title::newFromText().

LoginForm::mailPassword (  )  [private]

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

Parameters:
$u User object
$throttle Boolean
$emailTitle String: message name of email title
$emailText String: message name of email text
Returns:
Mixed: true on success, WikiError on failure
Access:
private

Definition at line 787 of file SpecialUserlogin.php.

References $result, $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 1170 of file SpecialUserlogin.php.

References $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 1197 of file SpecialUserlogin.php.

References $self, $wgUser, and SpecialPage::getTitleFor().

Referenced by makeLanguageSelector().

LoginForm::onCookieRedirectCheck ( type  )  [private]

Definition at line 1142 of file SpecialUserlogin.php.

References hasSessionCookie(), mainLoginForm(), successfulLogin(), wfMsg(), and wfMsgExt().

Referenced by execute().

LoginForm::processLogin (  ) 

LoginForm::resetLoginForm ( error  ) 

Definition at line 683 of file SpecialUserlogin.php.

References $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 1112 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 1086 of file SpecialUserlogin.php.

References $wgRequest, and User::generateToken().

Referenced by authenticateUserData(), mailPassword(), and mainLoginForm().

LoginForm::showCreateOrLoginLink ( &$  user  )  [private]

Definition at line 1051 of file SpecialUserlogin.php.

Referenced by mainLoginForm().

LoginForm::successfulCreation (  ) 

Run any hooks registered for logins, then display a message welcoming the user.

Access:
private

Definition at line 846 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 822 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 1160 of file SpecialUserlogin.php.

References mainLoginForm(), and wfMsgExt().

Referenced by addNewAccountInternal().

LoginForm::userBlockedMessage (  ) 

Definition at line 892 of file SpecialUserlogin.php.

References $wgOut, $wgUser, wfGetIP(), wfMsg(), and User::whoIs().

Referenced by addNewAccountInternal(), mainLoginForm(), and processLogin().

LoginForm::userNotPrivilegedMessage ( errors  ) 

Definition at line 876 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::$mExtUser = null [private]

Definition at line 46 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::$mReturnToQuery

Definition at line 44 of file SpecialUserlogin.php.

LoginForm::$mRetype

Definition at line 41 of file SpecialUserlogin.php.

LoginForm::$mSkipCookieCheck

Definition at line 44 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.

Referenced by ApiLogin::execute().

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.

Referenced by ApiLogin::execute().

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 Sat Apr 30 22:57:42 2011 for MediaWiki by  doxygen 1.5.9