diff options
author | Max Magorsch <arzano@gentoo.org> | 2020-05-27 02:30:01 +0200 |
---|---|---|
committer | Max Magorsch <arzano@gentoo.org> | 2020-05-27 02:30:01 +0200 |
commit | 881c1e396ad9ace944b022394fdda1d1d95d3b51 (patch) | |
tree | ce22601f07aa36fb5ee31a28d9075c6163887153 /PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php | |
parent | Add OpenIDConnect extension for Gentoo SSO (diff) | |
download | extensions-881c1e396ad9ace944b022394fdda1d1d95d3b51.tar.gz extensions-881c1e396ad9ace944b022394fdda1d1d95d3b51.tar.bz2 extensions-881c1e396ad9ace944b022394fdda1d1d95d3b51.zip |
Add PluggableAuth extension for OpenID Connect
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php')
-rw-r--r-- | PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php b/PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php new file mode 100644 index 00000000..04831fb8 --- /dev/null +++ b/PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php @@ -0,0 +1,35 @@ +<?php + +use \MediaWiki\Auth\ButtonAuthenticationRequest; +use \MediaWiki\Auth\AuthManager; + +class PluggableAuthBeginAuthenticationRequest extends + ButtonAuthenticationRequest { + + public function __construct() { + if ( isset( $GLOBALS['wgPluggableAuth_ButtonLabelMessage'] ) ) { + $label = wfMessage( $GLOBALS['wgPluggableAuth_ButtonLabelMessage'] ); + } elseif ( $GLOBALS['wgPluggableAuth_ButtonLabel'] ) { + $label = new RawMessage( $GLOBALS['wgPluggableAuth_ButtonLabel'] ); + } else { + $label = wfMessage( 'pluggableauth-loginbutton-label' ); + } + parent::__construct( + 'pluggableauthlogin', + $label, + wfMessage( 'pluggableauth-loginbutton-help' ), + true ); + } + + /** + * Returns field information. + * @return array field information + */ + public function getFieldInfo() { + if ( $this->action !== AuthManager::ACTION_LOGIN ) { + return []; + } + return array_merge( $GLOBALS['wgPluggableAuth_ExtraLoginFields'], + parent::getFieldInfo() ); + } +} |