[MediaWiki-commits] [Gerrit] Add $options parameter for testUserForCreation() - change (mediawiki...AntiSpoof)

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

Change subject: Add $options parameter for testUserForCreation()
..


Add $options parameter for testUserForCreation()

And use it to skip the check when it indicates testForAccountCreation()
is going to be called for a more thorough check.

Change-Id: I4af8b3b692f60c42f8685b90be5936da7ba4e2e2
---
M AntiSpoofPreAuthenticationProvider.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/AntiSpoofPreAuthenticationProvider.php 
b/AntiSpoofPreAuthenticationProvider.php
index f61de77..ede77ae 100644
--- a/AntiSpoofPreAuthenticationProvider.php
+++ b/AntiSpoofPreAuthenticationProvider.php
@@ -94,12 +94,12 @@
return StatusValue::newGood();
}
 
-   public function testUserForCreation( $user, $autocreate ) {
+   public function testUserForCreation( $user, $autocreate, array $options 
= [] ) {
$sv = StatusValue::newGood();
 
// For "cancreate" checks via the API, test if the current user 
could
// create the username.
-   if ( $this->antiSpoofAccounts && !$autocreate &&
+   if ( $this->antiSpoofAccounts && !$autocreate && empty( 
$options['creating'] ) &&
!RequestContext::getMain()->getUser()->isAllowed( 
'override-antispoof' )
) {
$sv->merge( $this->testUserInternal( $user, false, new 
NullLogger ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4af8b3b692f60c42f8685b90be5936da7ba4e2e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: master
Gerrit-Owner: Anomie 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add $options parameter for testUserForCreation() - change (mediawiki...AntiSpoof)

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

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

Change subject: Add $options parameter for testUserForCreation()
..

Add $options parameter for testUserForCreation()

And use it to skip the check when it indicates testForAccountCreation()
is going to be called for a more thorough check.

Change-Id: I4af8b3b692f60c42f8685b90be5936da7ba4e2e2
---
M AntiSpoofPreAuthenticationProvider.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AntiSpoof 
refs/changes/48/294848/1

diff --git a/AntiSpoofPreAuthenticationProvider.php 
b/AntiSpoofPreAuthenticationProvider.php
index f61de77..ede77ae 100644
--- a/AntiSpoofPreAuthenticationProvider.php
+++ b/AntiSpoofPreAuthenticationProvider.php
@@ -94,12 +94,12 @@
return StatusValue::newGood();
}
 
-   public function testUserForCreation( $user, $autocreate ) {
+   public function testUserForCreation( $user, $autocreate, array $options 
= [] ) {
$sv = StatusValue::newGood();
 
// For "cancreate" checks via the API, test if the current user 
could
// create the username.
-   if ( $this->antiSpoofAccounts && !$autocreate &&
+   if ( $this->antiSpoofAccounts && !$autocreate && empty( 
$options['creating'] ) &&
!RequestContext::getMain()->getUser()->isAllowed( 
'override-antispoof' )
) {
$sv->merge( $this->testUserInternal( $user, false, new 
NullLogger ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4af8b3b692f60c42f8685b90be5936da7ba4e2e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: master
Gerrit-Owner: Anomie 

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