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

Change subject: Formatting changes
......................................................................

Formatting changes

* Standardize style
* Break up long lines

Change-Id: Ie6df2eb19b3e3e5226df6863ba0f3a87094e11a9
---
M PluggableAuthBeginAuthenticationRequest.php
M PluggableAuthHooks.php
M PluggableAuthLogin.php
M PluggableAuthPrimaryAuthenticationProvider.php
M ext.PluggableAuthAutoLogin.js
5 files changed, 48 insertions(+), 23 deletions(-)


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

diff --git a/PluggableAuthBeginAuthenticationRequest.php 
b/PluggableAuthBeginAuthenticationRequest.php
index a08946f..b4716a5 100644
--- a/PluggableAuthBeginAuthenticationRequest.php
+++ b/PluggableAuthBeginAuthenticationRequest.php
@@ -24,14 +24,15 @@
 
 use \MediaWiki\Auth\ButtonAuthenticationRequest;
 
-class PluggableAuthBeginAuthenticationRequest extends 
ButtonAuthenticationRequest {
+class PluggableAuthBeginAuthenticationRequest extends
+       ButtonAuthenticationRequest {
 
        public function __construct() {
                parent::__construct(
                        'pluggableauthlogin',
-                       wfMessage('pluggableauth-loginbutton-label'),
-                       wfMessage('pluggableauth-loginbutton-help'),
-                       true);
+                       wfMessage( 'pluggableauth-loginbutton-label' ),
+                       wfMessage( 'pluggableauth-loginbutton-help' ), true
+               );
        }
 
 }
diff --git a/PluggableAuthHooks.php b/PluggableAuthHooks.php
index d550b8a..ee26983 100644
--- a/PluggableAuthHooks.php
+++ b/PluggableAuthHooks.php
@@ -45,7 +45,9 @@
                        $primaries = $providers['primaryauth'];
                        foreach ( $primaries as $key => $provider ) {
                                if ( in_array( $provider['class'], 
$passwordProviders ) ) {
-                                       unset( 
$GLOBALS['wgAuthManagerAutoConfig']['primaryauth'][$key] );
+                                       unset(
+                                               
$GLOBALS['wgAuthManagerAutoConfig']['primaryauth'][$key]
+                                       );
                                }
                        }
                }
@@ -60,7 +62,9 @@
         * @since 2.0
         *
         */
-       public static function onTitleReadWhitelist( $title, $user, 
&$whitelisted ) {
+       public static function onTitleReadWhitelist(
+               $title, $user, &$whitelisted
+       ) {
                $loginSpecialPages = 
ExtensionRegistry::getInstance()->getAttribute(
                        'PluggableAuthLoginSpecialPages' );
                foreach ( $loginSpecialPages as $page ) {
@@ -85,8 +89,9 @@
         * @param array $formDescriptor
         * @param $action
         */
-       public static function onAuthChangeFormFields( array $requests,
-               array $fieldInfo, array &$formDescriptor, $action) {
+       public static function onAuthChangeFormFields(
+               array $requests, array $fieldInfo, array &$formDescriptor, 
$action
+       ) {
                if ( isset( $formDescriptor['pluggableauthlogin'] ) ) {
                        $formDescriptor['pluggableauthlogin']['weight'] = 101;
                }
@@ -103,8 +108,9 @@
         * @param $inject_html
         * @param $old_name
         */
-       public static function deauthenticate( User &$user, $inject_html,
-               $old_name ) {
+       public static function deauthenticate(
+               User &$user, $inject_html, $old_name
+       ) {
                $old_user = User::newFromName( $old_name );
                if ( $old_user === false ) {
                        return true;
@@ -168,8 +174,9 @@
         * @param Title $title
         * @param SkinTemplate $skin
         */
-       public static function modifyLoginURLs( array &$personal_urls,
-               Title $title = null, SkinTemplate $skin = null ) {
+       public static function modifyLoginURLs(
+               array &$personal_urls, Title $title = null, SkinTemplate $skin 
= null
+       ) {
                if ( $GLOBALS['wgPluggableAuth_EnableAutoLogin'] ) {
                        unset( $personal_urls['logout'] );
                }
diff --git a/PluggableAuthLogin.php b/PluggableAuthLogin.php
index 1ab86bb..aec1b78 100644
--- a/PluggableAuthLogin.php
+++ b/PluggableAuthLogin.php
@@ -44,8 +44,9 @@
                $pluggableauth = PluggableAuth::singleton();
                $error = null;
                if ( $pluggableauth ) {
-                       if ( $pluggableauth->authenticate( $id, $username, 
$realname, $email,
-                                       $error ) ) {
+                       if (
+                               $pluggableauth->authenticate( $id, $username, 
$realname, $email, $error
+                               ) ) {
                                if ( is_null( $id ) ) {
                                        $user->loadDefaults( $username );
                                        $user->mName = $username;
@@ -60,7 +61,9 @@
                                        wfDebug( 'Authenticated existing user: 
' . $user->mName );
                                }
                                $authorized = true;
-                               Hooks::run( 'PluggableAuthUserAuthorization', [ 
$user, &$authorized ] );
+                               Hooks::run(
+                                       'PluggableAuthUserAuthorization', [ 
$user, &$authorized ]
+                               );
                                if ( $authorized ) {
                                        
$authManager->setAuthenticationSessionData(
                                                self::USERNAME_SESSION_KEY, 
$username );
@@ -71,12 +74,16 @@
                                        wfDebug( 'User is authorized.' );
                                } else {
                                        wfDebug( 'Authorization failure.' );
-                                       $error = wfMessage( 
'pluggableauth-not-authorized', $username )->text();
+                                       $error = wfMessage(
+                                               'pluggableauth-not-authorized', 
$username
+                                       )->text();
                                }
                        } 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 );
diff --git a/PluggableAuthPrimaryAuthenticationProvider.php 
b/PluggableAuthPrimaryAuthenticationProvider.php
index 97f72f9..cfee35b 100644
--- a/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/PluggableAuthPrimaryAuthenticationProvider.php
@@ -39,7 +39,8 @@
                }
                $url = Title::newFromText( 'Special:PluggableAuthLogin' 
)->getFullURL();
                $this->manager->setAuthenticationSessionData(
-                       PluggableAuthLogin::RETURNTOURL_SESSION_KEY, 
$request->returnToUrl );
+                       PluggableAuthLogin::RETURNTOURL_SESSION_KEY, 
$request->returnToUrl
+               );
                if ( isset( $_GET['returnto'] ) ) {
                        $returnto = $_GET['returnto'];
                } else {
@@ -93,11 +94,14 @@
                        PluggableAuthLogin::EMAIL_SESSION_KEY );
                if ( $user->mRealName != $realname || $user->mEmail != $email ) 
{
                        $rights = $user->getRights();
-                       if ( in_array( 'editmyprivateinfo', $rights ) && 
!$force) {
+                       if ( in_array( 'editmyprivateinfo', $rights ) && 
!$force ) {
                                wfDebug( 'User has editmyprivateinfo right.' );
                                wfDebug( 'Did not save updated real name and 
email address.' );
                        } else {
-                               wfDebug( 'User does not have editmyprivateinfo 
right or has just been created.' );
+                               wfDebug(
+                                       'User does not have editmyprivateinfo 
right ' .
+                                       'or has just been created.'
+                               );
                                $user->mRealName = $realname;
                                if ( $email && Sanitizer::validateEmail( $email 
) ) {
                                        $user->mEmail = $email;
@@ -132,11 +136,15 @@
                return self::TYPE_LINK;
        }
 
-       public function beginPrimaryAccountCreation( $user, $creator, array 
$reqs ) {
+       public function beginPrimaryAccountCreation(
+               $user, $creator, array $reqs
+       ) {
                return AuthenticationResponse::newAbstain();
        }
 
-       public function providerChangeAuthenticationData( AuthenticationRequest 
$req ) {
+       public function providerChangeAuthenticationData(
+               AuthenticationRequest $req
+       ) {
        }
 
        public function getAuthenticationRequests( $action, array $options ) {
diff --git a/ext.PluggableAuthAutoLogin.js b/ext.PluggableAuthAutoLogin.js
index 990c78f..a9e5c8f 100644
--- a/ext.PluggableAuthAutoLogin.js
+++ b/ext.PluggableAuthAutoLogin.js
@@ -49,7 +49,9 @@
                var query = uri.getQueryString();
                var namespace = mw.config.get( 'wgNamespaceIds' ).special;
                var title = mw.Title.makeTitle( namespace, 'Userlogin' );
-               var loginUrl = title.getUrl( { returnto: pageName, 
returntoquery: query } );
+                       var loginUrl = title.getUrl( {
+                                       returnto: pageName, returntoquery: query
+                       } );
                window.location = loginUrl;
        } );
 }( mediaWiki ) );

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

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

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

Reply via email to