[MediaWiki-commits] [Gerrit] Don't provide a "Already registered" option if GoogleLogin r... - change (mediawiki...GoogleLogin)

2016-04-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Don't provide a "Already registered" option if GoogleLogin 
replaces MW login
..


Don't provide a "Already registered" option if GoogleLogin replaces MW login

It doesn't make sense to redirect to the login form from Special:GoogleLogin
in this case, as GoogleLogin automatically redirects to Special:GoogleLogin
from Special:UserLogin.

Bug: T131984
Change-Id: I81c41c703cc808ddcff46807094364bc1132b428
---
M includes/specials/SpecialGoogleLogin.php
1 file changed, 6 insertions(+), 3 deletions(-)

Approvals:
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialGoogleLogin.php 
b/includes/specials/SpecialGoogleLogin.php
index e25c0fc..7c9322e 100644
--- a/includes/specials/SpecialGoogleLogin.php
+++ b/includes/specials/SpecialGoogleLogin.php
@@ -276,15 +276,18 @@
 */
private function createGoogleUserForm( $userInfo ) {
$request = $this->getRequest();
+   $glConfig = $this->mGoogleLogin->getGLConfig();
$out = $this->getOutput();
 
$out->addModules( array( 
'ext.GoogleLogin.specialGoogleLogin.chooseown' ) );
$out->setPageTitle( $this->msg( 
'googlelogin-form-choosename-title' )->text() );
 
// create an array of possible usernames
-   $names = array(
-   $this->msg( 'googlelogin-login-already-registered' 
)->text() => 'wpAlreadyRegistered'
-   );
+   $names = array();
+   if ( !$glConfig->get( 'GLReplaceMWLogin' ) ) {
+   $names[$this->msg( 
'googlelogin-login-already-registered' )->text()] =
+   'wpAlreadyRegistered';
+   }
if ( GoogleLogin::isValidUsername( $userInfo['displayName'] ) ) 
{
$names[$userInfo['displayName']] = 'wpDisplayName';
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I81c41c703cc808ddcff46807094364bc1132b428
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GoogleLogin
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Don't provide a "Already registered" option if GoogleLogin r... - change (mediawiki...GoogleLogin)

2016-04-06 Thread Florianschmidtwelzow (Code Review)
Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/282077

Change subject: Don't provide a "Already registered" option if GoogleLogin 
replaces MW login
..

Don't provide a "Already registered" option if GoogleLogin replaces MW login

It doesn't make sense to redirect to the login form from Special:GoogleLogin
in this case, as GoogleLogin automatically redirects to Special:GoogleLogin
from Special:UserLogin.

Bug: T131984
Change-Id: I81c41c703cc808ddcff46807094364bc1132b428
---
M includes/specials/SpecialGoogleLogin.php
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleLogin 
refs/changes/77/282077/1

diff --git a/includes/specials/SpecialGoogleLogin.php 
b/includes/specials/SpecialGoogleLogin.php
index e25c0fc..7c9322e 100644
--- a/includes/specials/SpecialGoogleLogin.php
+++ b/includes/specials/SpecialGoogleLogin.php
@@ -276,15 +276,18 @@
 */
private function createGoogleUserForm( $userInfo ) {
$request = $this->getRequest();
+   $glConfig = $this->mGoogleLogin->getGLConfig();
$out = $this->getOutput();
 
$out->addModules( array( 
'ext.GoogleLogin.specialGoogleLogin.chooseown' ) );
$out->setPageTitle( $this->msg( 
'googlelogin-form-choosename-title' )->text() );
 
// create an array of possible usernames
-   $names = array(
-   $this->msg( 'googlelogin-login-already-registered' 
)->text() => 'wpAlreadyRegistered'
-   );
+   $names = array();
+   if ( !$glConfig->get( 'GLReplaceMWLogin' ) ) {
+   $names[$this->msg( 
'googlelogin-login-already-registered' )->text()] =
+   'wpAlreadyRegistered';
+   }
if ( GoogleLogin::isValidUsername( $userInfo['displayName'] ) ) 
{
$names[$userInfo['displayName']] = 'wpDisplayName';
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81c41c703cc808ddcff46807094364bc1132b428
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GoogleLogin
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits