Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384768 )

Change subject: Allow override of button text. Coding style.
......................................................................

Allow override of button text. Coding style.

Change-Id: I2bbbc7a1750945cb8d301780fcbcaf65ac405078
---
M extension.json
M includes/PluggableAuth.php
M includes/PluggableAuthBeginAuthenticationRequest.php
M includes/PluggableAuthLogin.php
M includes/PluggableAuthPrimaryAuthenticationProvider.php
5 files changed, 17 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PluggableAuth 
refs/changes/68/384768/1

diff --git a/extension.json b/extension.json
index 9b4954e..87bc7ed 100644
--- a/extension.json
+++ b/extension.json
@@ -50,6 +50,7 @@
                "PluggableAuth_EnableAutoLogin": false,
                "PluggableAuth_EnableLocalLogin": false,
                "PluggableAuth_EnableLocalProperties": false,
+               "PluggableAuth_ButtonLabel": null,
                "PluggableAuth_ExtraLoginFields": []
        },
        "manifest_version": 1
diff --git a/includes/PluggableAuth.php b/includes/PluggableAuth.php
index a0ea3f1..b85d8d1 100644
--- a/includes/PluggableAuth.php
+++ b/includes/PluggableAuth.php
@@ -5,11 +5,11 @@
        /**
         * @since 1.0
         *
-        * @param &$id
-        * @param &$username
-        * @param &$realname
-        * @param &$email
-        * @param &$errorMessage
+        * @param int &$id
+        * @param string &$username
+        * @param string &$realname
+        * @param string &$email
+        * @param string &$errorMessage
         */
        abstract public function authenticate( &$id, &$username, &$realname,
                &$email, &$errorMessage );
@@ -24,7 +24,7 @@
        /**
         * @since 1.0
         *
-        * @param $id
+        * @param int $id
         */
        abstract public function saveExtraAttributes( $id );
 
@@ -45,6 +45,5 @@
                }
                wfDebug( 'Could not get authentication plugin instance.' );
                return false;
-
        }
 }
diff --git a/includes/PluggableAuthBeginAuthenticationRequest.php 
b/includes/PluggableAuthBeginAuthenticationRequest.php
index fb3f151..da50eb2 100644
--- a/includes/PluggableAuthBeginAuthenticationRequest.php
+++ b/includes/PluggableAuthBeginAuthenticationRequest.php
@@ -7,11 +7,13 @@
        ButtonAuthenticationRequest {
 
        public function __construct() {
-               parent::__construct(
-                       'pluggableauthlogin',
-                       wfMessage('pluggableauth-loginbutton-label'),
-                       wfMessage('pluggableauth-loginbutton-help'),
-                       true);
+               if ( $GLOBALS['wgPluggableAuth_ButtonLabel'] ) {
+                       $label = new RawMessage( 
$GLOBALS['wgPluggableAuth_ButtonLabel'] );
+               } else {
+                       $label = wfMessage( 'pluggableauth-loginbutton-label' );
+               }
+               parent::__construct( 'pluggableauthlogin', $label,
+                       wfMessage( 'pluggableauth-loginbutton-help' ), true );
        }
 
        public function getFieldInfo() {
diff --git a/includes/PluggableAuthLogin.php b/includes/PluggableAuthLogin.php
index 113b226..8cf5f94 100644
--- a/includes/PluggableAuthLogin.php
+++ b/includes/PluggableAuthLogin.php
@@ -56,7 +56,7 @@
                        } else {
                                wfDebug( 'Authentication failure.' );
                                if ( is_null( $error ) ) {
-                                       $error = wfMessage( 
'pluggableauth-authentication-failure')->text();
+                                       $error = wfMessage( 
'pluggableauth-authentication-failure' )->text();
                                } else {
                                        if ( !is_string( $error ) ) {
                                                $error = strval( $error );
@@ -71,7 +71,7 @@
                }
                $returnToUrl = $authManager->getAuthenticationSessionData(
                        self::RETURNTOURL_SESSION_KEY );
-               if ( is_null( $returnToUrl) || count( $returnToUrl ) === 0 ) {
+               if ( is_null( $returnToUrl ) || count( $returnToUrl ) === 0 ) {
                        wfDebug( 'ERROR: return to URL is null or empty' );
                } else {
                        $this->getOutput()->redirect( $returnToUrl );
diff --git a/includes/PluggableAuthPrimaryAuthenticationProvider.php 
b/includes/PluggableAuthPrimaryAuthenticationProvider.php
index 3f47ca0..655bbff 100644
--- a/includes/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/includes/PluggableAuthPrimaryAuthenticationProvider.php
@@ -54,7 +54,7 @@
                                wfMessage( 
'pluggableauth-authentication-workflow-failure' ) );
                }
                $error = $this->manager->getAuthenticationSessionData(
-                       PluggableAuthLogin::ERROR_SESSION_KEY ) ;
+                       PluggableAuthLogin::ERROR_SESSION_KEY );
                if ( !is_null( $error ) ) {
                        $this->manager->removeAuthenticationSessionData(
                                PluggableAuthLogin::ERROR_SESSION_KEY );

-- 
To view, visit https://gerrit.wikimedia.org/r/384768
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2bbbc7a1750945cb8d301780fcbcaf65ac405078
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to