|
MediaWiki master
|
Helper functions for the login form that need to be shared with other special pages (such as CentralAuth's SpecialCentralLogin). More...
Inherits MediaWiki\Context\ContextSource.

Public Member Functions | |
| __construct (IContextSource $context) | |
| showReturnToPage ( $type, $returnTo='', $returnToQuery='', $stickHTTPS=false, $returnToAnchor='') | |
| Show a return link or redirect to it. | |
Public Member Functions inherited from MediaWiki\Context\ContextSource | |
| canUseWikiPage () | |
| Check whether a WikiPage object can be get with getWikiPage(). | |
| exportSession () | |
| Export the resolved user IP, HTTP headers, user ID, and session ID. | |
| getActionName () | |
| Get the action name for the current web request. | |
| getAuthority () | |
| getConfig () | |
| getContext () | |
| Get the base IContextSource object. | |
| getCsrfTokenSet () | |
| Get a repository to obtain and match CSRF tokens. | |
| getLanguage () | |
| getLanguageCode () | |
| getOutput () | |
| getRequest () | |
| getSkin () | |
| getTiming () | |
| getTitle () | |
| getUser () | |
| getWikiPage () | |
| Get the WikiPage object. | |
| msg ( $key,... $params) | |
| Get a Message object with context set Parameters are the same as wfMessage() | |
| setContext (IContextSource $context) | |
Static Public Member Functions | |
| static | getValidErrorMessages () |
| Returns an array of all error and warning messages that can be displayed on Special:UserLogin or Special:CreateAccount through the ?error or ?warning GET parameters. | |
Helper functions for the login form that need to be shared with other special pages (such as CentralAuth's SpecialCentralLogin).
Definition at line 18 of file LoginHelper.php.
| MediaWiki\Specials\Helpers\LoginHelper::__construct | ( | IContextSource | $context | ) |
Definition at line 66 of file LoginHelper.php.
|
static |
Returns an array of all error and warning messages that can be displayed on Special:UserLogin or Special:CreateAccount through the ?error or ?warning GET parameters.
Special:UserLogin and Special:CreateAccount can show an error or warning message on the form when coming from another page using the aforementioned GET parameters.
Further keys can be added by the LoginFormValidErrorMessages hook. If a message key is not in this list, then no redirect will be performed to Special:UserLogin or Special:CreateAccount.
Definition at line 56 of file LoginHelper.php.
References MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\Exception\UserNotLoggedIn\report().
| MediaWiki\Specials\Helpers\LoginHelper::showReturnToPage | ( | $type, | |
| $returnTo = '', | |||
| $returnToQuery = '', | |||
| $stickHTTPS = false, | |||
| $returnToAnchor = '' ) |
Show a return link or redirect to it.
Extensions can change where the link should point or inject content into the page (which will change it from redirect to link mode).
| string | $type | One of the following:
|
| string | $returnTo | Title of page to return to. Overriden by $wgRedirectOnLogin when that is set (and $type is not 'error'). |
| array | string | $returnToQuery | Query parameters to return to. |
| bool | $stickHTTPS | Keep redirect link on HTTPS. Ignored (treated as true) if $wgForceHTTPS is true. |
| string | $returnToAnchor | A string to append to the URL, presumed to be either a fragment including the leading hash or an empty string. |
Definition at line 88 of file LoginHelper.php.
References MediaWiki\MainConfigNames\ForceHTTPS, PROTO_HTTP, PROTO_HTTPS, PROTO_RELATIVE, MediaWiki\MainConfigNames\RedirectOnLogin, MediaWiki\MainConfigNames\SecureLogin, and wfCgiToArray().