|
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) | |
| getDisplayMode () | |
| Get the display mode for the login form. | |
| getPreservedParams (array $options) | |
| Returns an URL query parameter array which contains state information that should be preserved when navigating to the next (or first) step of a login or signup process. | |
| isDisplayModePopup () | |
| Check if the current display mode is popup. | |
| 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. | |
Public Attributes | |
| const | DISPLAY_MODE_DEFAULT = self::DISPLAY_MODE_PAGE |
| Default display mode. | |
| const | DISPLAY_MODE_PAGE = 'page' |
| Display mode for full page. | |
| const | DISPLAY_MODE_PARAM_NAME = 'display' |
| URL parameter for display mode. | |
| const | DISPLAY_MODE_POPUP = 'popup' |
| Display mode for popup window. | |
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 53 of file LoginHelper.php.
| MediaWiki\Specials\Helpers\LoginHelper::getDisplayMode | ( | ) |
Get the display mode for the login form.
The display mode is determined by the 'display' request parameter. If not set or invalid, defaults to page mode.
Definition at line 131 of file LoginHelper.php.
| MediaWiki\Specials\Helpers\LoginHelper::getPreservedParams | ( | array | $options | ) |
Returns an URL query parameter array which contains state information that should be preserved when navigating to the next (or first) step of a login or signup process.
These parameters can be included in links / forms to preserve things like the layout or the language, which are normally preserved via user preferences, but during login/signup, probably not.
This is basically a wrapper around the AuthPreserveQueryParams hook to work around the fact that there is no easy way to add hook handlers in core.
| array | $options |
|
Definition at line 186 of file LoginHelper.php.
References MediaWiki\Specials\Helpers\getHookRunner().
|
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 49 of file LoginHelper.php.
| MediaWiki\Specials\Helpers\LoginHelper::isDisplayModePopup | ( | ) |
Check if the current display mode is popup.
Definition at line 143 of file LoginHelper.php.
| 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. Overridden 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 75 of file LoginHelper.php.
References MediaWiki\MainConfigNames\ForceHTTPS, MediaWiki\Specials\Helpers\getConfig(), MediaWiki\Specials\Helpers\getHookRunner(), PROTO_HTTP, PROTO_HTTPS, PROTO_RELATIVE, MediaWiki\MainConfigNames\RedirectOnLogin, MediaWiki\MainConfigNames\SecureLogin, and wfCgiToArray().
| const MediaWiki\Specials\Helpers\LoginHelper::DISPLAY_MODE_DEFAULT = self::DISPLAY_MODE_PAGE |
Default display mode.
Definition at line 28 of file LoginHelper.php.
| const MediaWiki\Specials\Helpers\LoginHelper::DISPLAY_MODE_PAGE = 'page' |
Display mode for full page.
Definition at line 25 of file LoginHelper.php.
| const MediaWiki\Specials\Helpers\LoginHelper::DISPLAY_MODE_PARAM_NAME = 'display' |
URL parameter for display mode.
Definition at line 31 of file LoginHelper.php.
| const MediaWiki\Specials\Helpers\LoginHelper::DISPLAY_MODE_POPUP = 'popup' |
Display mode for popup window.
Definition at line 22 of file LoginHelper.php.