[MediaWiki-commits] [Gerrit] Adding a maintenance script to confirm the validity of entri... - change (mediawiki...CentralAuth)

2013-05-17 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding a maintenance script to confirm the validity of entries 
in centralauth.localnames.
..

Adding a maintenance script to confirm the validity of entries in 
centralauth.localnames.

The script can also delete the invalid entries.

Change-Id: I40ea8bc5231825da9b08de2846ba79c7f393c78d
---
A maintenance/checkLocalNames.php
1 file changed, 142 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/43/64443/1

diff --git a/maintenance/checkLocalNames.php b/maintenance/checkLocalNames.php
new file mode 100644
index 000..254ac44
--- /dev/null
+++ b/maintenance/checkLocalNames.php
@@ -0,0 +1,142 @@
+?php
+
+if ( PHP_SAPI != 'cli' ) {
+   print This script must be run from a shell;
+   die();
+}
+
+if ( getenv( 'MW_INSTALL_PATH' ) ) {
+   $IP = getenv( 'MW_INSTALL_PATH' );
+} else {
+   $IP = __DIR__ . '/../../..';
+}
+require_once( $IP/maintenance/Maintenance.php );
+
+class CheckLocalNames extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+   $this-mDescription = Checks the contents of the localnames 
table and deletes invalid entries;
+   $this-start = microtime( true );
+   $this-deleted = 0;
+   $this-total = 0;
+   $this-dryrun = true;
+   $this-wiki = null;
+   $this-verbose = false;
+   $this-batchSize = 1000;
+
+   $this-addOption( 'delete', 'Performs delete operations on the 
offending entries', false, false );
+   $this-addOption( 'wiki', 'If specified, only runs against 
local names from this wiki', false, true, 'u' );
+   $this-addOption( 'verbose', 'Prints more information', false, 
true, 'v' );
+   }
+
+   public function execute() {
+
+   $centralMaster = CentralAuthUser::getCentralDB();
+   $centralSlave = CentralAuthUser::getCentralSlaveDB();
+
+   if ( $this-getOption( 'delete', false ) === true ) {
+   $this-dryrun = false;
+   }
+   if ( $this-getOption( 'wiki', false ) !== false ) {
+   $this-wiki = true;
+   }
+   if ( $this-getOption( 'verbose', false ) !== false ) {
+   $this-verbose = true;
+   }
+
+   // since the keys on localnames are not conducive to batch 
operations and
+   // because of the database shards, grab a list of the wikis and 
we will
+   // iterate from there
+   $wikis = array();
+   if ( !is_null( $this-wiki ) ) {
+   $wikis[] = $this-wiki;
+   } else {
+   $result = $centralSlave-select(
+   'localnames',
+   array( 'ln_wiki' ),
+   ,
+   __FUNCTION__,
+   array( distinct, order by ln_wiki ASC )
+   );
+
+   foreach( $result as $row ) {
+   $wikis[] = $row-ln_wiki;
+   }
+   }
+
+   // iterate through the wikis
+   foreach( $wikis as $wiki ) {
+   $localdb = wfGetLB( $wiki )-getConnection( DB_SLAVE , 
array(), $wiki );
+   $lastUsername = ;
+
+   $this-output( Checking localnames for $wiki ...\n );
+
+   // batch query localnames from the wiki
+   do{
+   $this-output( \t ... querying from 
'$lastUsername'\n );
+   $result = $centralSlave-select(
+   'localnames',
+   array( 'ln_user' ),
+   array(
+ln_wiki =  . 
$centralSlave-addQuotes( $wiki ),
+ln_user   . 
$centralSlave-addQuotes( $lastUsername )
+   ),
+   __FUNCTION__,
+   array(
+limit $this-batchSize,
+order by ln_name ASC
+   )
+   );
+
+   // iterate through each of the localnames to 
confirm that a local user
+   foreach( $result as $u ){
+   $localUser = $localdb-select(
+   'user',
+ 

[MediaWiki-commits] [Gerrit] Output on creating account - change (mediawiki...CentralAuth)

2013-05-17 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Output on creating account
..


Output on creating account

Remove trailing '

Change-Id: I91ae12816bff6d5b6a5ce315c45bae03efc281eb
---
M maintenance/createLocalAccount.php
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/maintenance/createLocalAccount.php 
b/maintenance/createLocalAccount.php
index 43ec35a..f91c4fb 100644
--- a/maintenance/createLocalAccount.php
+++ b/maintenance/createLocalAccount.php
@@ -16,7 +16,7 @@
public function execute() {
$username = $this-getArg( 0 );
if ( !User::isValidUserName( $username ) ) {
-   $this-error( '$username' is an invalid username\n' );
+   $this-error( '$username' is an invalid username\n );
die( 1 );
}
 
@@ -24,7 +24,7 @@
// Normalize username
$username = $user-getName();
if ( $user-getId() ) {
-   $this-error( User '$username' already exists\n' );
+   $this-error( User '$username' already exists\n );
} else {
global $wgAuth;
 
@@ -47,6 +47,7 @@
# Update user count
$ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
$ssUpdate-doUpdate();
+   $this-output( User '$username' created );
}
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I91ae12816bff6d5b6a5ce315c45bae03efc281eb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Reedy re...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Changing private to protected on a few functions. - change (mediawiki/core)

2013-05-16 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Changing private to protected on a few functions.
..

Changing private to protected on a few functions.

This is required for auth plugins to be able to send customized
email confirmation and migration emails.  For example, we need to
send emails from CentralAuth that will both confirm the email
address and then run through Special:MergeAccount attempting to
attach as many local accounts as possible.

Change-Id: If281aa6219e5a0b80252b0deac7ee0c4f74c3d58
---
M includes/User.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/13/64213/1

diff --git a/includes/User.php b/includes/User.php
index 1d87d40..e2cbb81 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -912,7 +912,7 @@
 *
 * @param $item String
 */
-   private function setItemLoaded( $item ) {
+   protected function setItemLoaded( $item ) {
if ( is_array( $this-mLoadedItems ) ) {
$this-mLoadedItems[$item] = true;
}
@@ -3668,7 +3668,7 @@
 * @param $expiration \mixed Accepts the expiration time
 * @return String New token
 */
-   private function confirmationToken( $expiration ) {
+   protected function confirmationToken( $expiration ) {
global $wgUserEmailConfirmationTokenExpiry;
$now = time();
$expires = $now + $wgUserEmailConfirmationTokenExpiry;
@@ -3686,7 +3686,7 @@
 * @param string $token Accepts the email confirmation token
 * @return String New token URL
 */
-   private function confirmationTokenUrl( $token ) {
+   protected function confirmationTokenUrl( $token ) {
return $this-getTokenUrl( 'ConfirmEmail', $token );
}
 
@@ -3695,7 +3695,7 @@
 * @param string $token Accepts the email confirmation token
 * @return String New token URL
 */
-   private function invalidationTokenUrl( $token ) {
+   protected function invalidationTokenUrl( $token ) {
return $this-getTokenUrl( 'InvalidateEmail', $token );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If281aa6219e5a0b80252b0deac7ee0c4f74c3d58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding a maintenance script to resend email confirmation ema... - change (mediawiki...CentralAuth)

2013-05-16 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding a maintenance script to resend email confirmation emails.
..

Adding a maintenance script to resend email confirmation emails.

Instead of Special:ConfirmEmail, the links direct to Special:MergeAccount
which has been modified to confirm an email address when a token is present.
This allows us to start the migration process and get the users straight into
the account migration flow without having to modify already translated
messages and requiring them to manually enter the workflow.

Change-Id: Ia6ee70420cb87f523339cfd5a7b391a1fcedb6a2
---
M CentralAuth.php
A ConfirmAndMigrateUser.php
A maintenance/sendConfirmAndMigrateEmail.php
3 files changed, 202 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/16/64216/1

diff --git a/CentralAuth.php b/CentralAuth.php
index 9aaff35..0595f8a 100644
--- a/CentralAuth.php
+++ b/CentralAuth.php
@@ -190,6 +190,9 @@
 $wgAutoloadClasses['ApiQueryWikiSets'] = $caBase/api/ApiQueryWikiSets.php;
 $wgAutoloadClasses['CentralAuthReadOnlyError'] = 
$caBase/CentralAuthReadOnlyError.php;
 
+// only used by maintenance/sendConfirmAndMigrateEmail.php
+$wgAutoloadClasses['ConfirmAndMigrateUser'] = 
$caBase/ConfirmAndMigrateUser.php;
+
 $wgExtensionMessagesFiles['SpecialCentralAuth'] = 
$caBase/CentralAuth.i18n.php;
 $wgExtensionMessagesFiles['SpecialCentralAuthAliases'] = 
$caBase/CentralAuth.alias.php;
 
diff --git a/ConfirmAndMigrateUser.php b/ConfirmAndMigrateUser.php
new file mode 100644
index 000..147a99d
--- /dev/null
+++ b/ConfirmAndMigrateUser.php
@@ -0,0 +1,79 @@
+?php
+
+class ConfirmAndMigrateUser extends User {
+
+   public function __construct() {
+   parent::__construct();
+   }
+
+   /**
+* Static factory method for creation from username.
+*
+* This is slightly less efficient than newFromId(), so use newFromId() 
if
+* you have both an ID and a name handy.
+*
+* @param string $name Username, validated by Title::newFromText()
+* @param string|Bool $validate Validate username. Takes the same 
parameters as
+*User::getCanonicalName(), except that true is accepted as an alias
+*for 'valid', for BC.
+*
+* @return ConfirmAndMigrateUser|bool ConfirmAndMigrateUser object, or 
false if the
+*username is invalid (e.g. if it contains illegal characters or is 
an IP address).
+*If the username is not present in the database, the result will 
be a user object
+*with a name, zero user ID and default settings.
+*/
+   public static function newFromName( $name, $validate = 'valid' ) {
+   if ( $validate === true ) {
+   $validate = 'valid';
+   }
+   $name = self::getCanonicalName( $name, $validate );
+   if ( $name === false ) {
+   return false;
+   } else {
+   # Create unloaded user object
+   $u = new ConfirmAndMigrateUser;
+   $u-mName = $name;
+   $u-mFrom = 'name';
+   $u-setItemLoaded( 'name' );
+   return $u;
+   }
+   }
+
+   /**
+* Generate a new e-mail confirmation token and send a 
confirmation/invalidation
+* mail to the user's given address.
+*
+* @return Status object
+*/
+   public function sendConfirmAndMigrateMail() {
+   global $wgLang;
+   $tokenLife = 28 * 24 * 60 * 60; // 28 days
+
+   $expiration = null; // gets passed-by-ref and defined in next 
line.
+   $token = $this-confirmationToken( $expiration );
+
+   // we want this token to last a little bit longer since we are 
cold-emailing
+   // users and we really want as many responses as possible
+   $now = time();
+   $expires = $now + $tokenLife;
+   $expiration = wfTimestamp( TS_MW, $expires );
+   $this-mEmailTokenExpires = $expiration;
+
+   // create a token url for MergeAccount since we have added 
email
+   // confirmation there
+   $url = $this-getTokenUrl( 'MergeAccount', $token );
+   $invalidateURL = $this-invalidationTokenUrl( $token );
+   $this-saveSettings();
+
+   return $this-sendMail(
+   wfMessage( 'centralauth-finishglobaliseemail_subject' 
)-text(),
+   wfMessage( centralauth-finishglobaliseemail_body,
+   $this-getRequest()-getIP(),
+   $this-getName(),
+   $url,
+

[MediaWiki-commits] [Gerrit] Update: Adding aa_method to AccountAudit - change (mediawiki/core)

2013-05-16 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Update: Adding aa_method to AccountAudit
..

Update: Adding aa_method to AccountAudit

Change-Id: I2636eef7eba9d212555666465e30195460ec1c16
---
M extensions/AccountAudit
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/64228/1

diff --git a/extensions/AccountAudit b/extensions/AccountAudit
index cbe4fd7..80524fb 16
--- a/extensions/AccountAudit
+++ b/extensions/AccountAudit
-Subproject commit cbe4fd769fc1f962243009ad543bd8bfc115ff31
+Subproject commit 80524fb0047789d6d042575711282629744faad7

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2636eef7eba9d212555666465e30195460ec1c16
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Update: Adding aa_method to AccountAudit - change (mediawiki/core)

2013-05-16 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Update: Adding aa_method to AccountAudit
..

Update: Adding aa_method to AccountAudit

Change-Id: Ib559dd921e58a62562b770eb44c2a553e211ccd6
---
M extensions/AccountAudit
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/64230/1

diff --git a/extensions/AccountAudit b/extensions/AccountAudit
index aea1705..80524fb 16
--- a/extensions/AccountAudit
+++ b/extensions/AccountAudit
-Subproject commit aea1705ab5d3ef3d94a937ffa72fca589b46d209
+Subproject commit 80524fb0047789d6d042575711282629744faad7

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib559dd921e58a62562b770eb44c2a553e211ccd6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf4
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Update: Adding aa_method to AccountAudit - change (mediawiki/core)

2013-05-16 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Update: Adding aa_method to AccountAudit
..


Update: Adding aa_method to AccountAudit

Change-Id: Ib559dd921e58a62562b770eb44c2a553e211ccd6
---
M extensions/AccountAudit
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/extensions/AccountAudit b/extensions/AccountAudit
index aea1705..80524fb 16
--- a/extensions/AccountAudit
+++ b/extensions/AccountAudit
-Subproject commit aea1705ab5d3ef3d94a937ffa72fca589b46d209
+Subproject commit 80524fb0047789d6d042575711282629744faad7

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib559dd921e58a62562b770eb44c2a553e211ccd6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf4
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Update: Adding aa_method to AccountAudit - change (mediawiki/core)

2013-05-16 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Update: Adding aa_method to AccountAudit
..


Update: Adding aa_method to AccountAudit

Change-Id: I2636eef7eba9d212555666465e30195460ec1c16
---
M extensions/AccountAudit
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/extensions/AccountAudit b/extensions/AccountAudit
index cbe4fd7..80524fb 16
--- a/extensions/AccountAudit
+++ b/extensions/AccountAudit
-Subproject commit cbe4fd769fc1f962243009ad543bd8bfc115ff31
+Subproject commit 80524fb0047789d6d042575711282629744faad7

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2636eef7eba9d212555666465e30195460ec1c16
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding i18n msg for merge request email - change (mediawiki...CentralAuth)

2013-05-14 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding i18n msg for merge request email
..

Adding i18n msg for merge request email

Change-Id: I1d1d2b693b663e4e3219e52d4a325b55c30232c5
---
M CentralAuth.i18n.php
1 file changed, 19 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/31/63731/1

diff --git a/CentralAuth.i18n.php b/CentralAuth.i18n.php
index 7e17e0a..6a36cfc 100644
--- a/CentralAuth.i18n.php
+++ b/CentralAuth.i18n.php
@@ -419,6 +419,25 @@
 If you are just trying to log in as another user, please log out first.',
'centralauth-warning-notloggedin' = 'You are not currently logged in.',
'centralauth-warning-notattached' = 'The local account is not attached 
to a global one.',
+
+   // Final unification
+   'centralauth-finishglobaliseemail_body'  = 'Your email address has 
been set as associated
+with the account $2 on all Wikimedia projects, with your main account being
+on {{SITENAME}}.
+
+To confirm that this account really does belong to you, merge in any of your
+accounts that we could not do automatically, and allow you to recover your
+account if you lose your password, please open this link in your browser:
+
+$3
+
+If the account does *not* belong to you, follow this link to cancel the email
+address confirmation:
+
+$5
+
+This confirmation code will expire at $4.'
+
 );
 
 /** Message documentation (Message documentation)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d1d2b693b663e4e3219e52d4a325b55c30232c5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding the ability to confirm email address while sending us... - change (mediawiki...CentralAuth)

2013-05-14 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding the ability to confirm email address while sending users 
to Special:MergeAccount
..

Adding the ability to confirm email address while sending users to 
Special:MergeAccount

Change-Id: I0b797a13500988f3c2272af89c1bc9578fbf
---
M specials/SpecialMergeAccount.php
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/99/63799/1

diff --git a/specials/SpecialMergeAccount.php b/specials/SpecialMergeAccount.php
index bd1bc6a..bbf97a9 100644
--- a/specials/SpecialMergeAccount.php
+++ b/specials/SpecialMergeAccount.php
@@ -11,6 +11,19 @@
global $wgUser;
$this-setHeaders();
 
+   if ( !is_null( $subpage ) ) {
+   $user = User::newFromConfirmationCode( $subpage );
+
+   if ( is_object( $user ) ) {
+   $user-confirmEmail();
+   $user-saveSettings();
+   $this-getOutput()-addWikiMsg( 
'confirmemail_success' );
+   } else {
+   $this-getOutput()-addWikiMsg( 
'confirmemail_invalid' );
+   // return; // Let's be greedy and still show 
them MergeAccount
+   }
+   }
+
if ( !$this-userCanExecute( $wgUser ) ) {
$this-getOutput()-addWikiMsg( 
'centralauth-merge-denied' );
$this-getOutput()-addWikiMsg( 
'centralauth-readmore-text' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b797a13500988f3c2272af89c1bc9578fbf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding function to set the MW:Sitesupport-url - change (mediawiki...WikimediaMaintenance)

2013-05-13 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding function to set the MW:Sitesupport-url
..

Adding function to set the MW:Sitesupport-url

Change-Id: I79914683688ab8f6fab08622efeda480fb295c3f
---
M addWiki.php
1 file changed, 20 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance 
refs/changes/94/63594/1

diff --git a/addWiki.php b/addWiki.php
index 22118fa..029f601 100644
--- a/addWiki.php
+++ b/addWiki.php
@@ -164,6 +164,8 @@
 
$article-doEdit( $this-getFirstArticle( $ucsite, $name ), '', 
EDIT_NEW | EDIT_AUTOSUMMARY );
 
+   $this-setFundraisingLink( $domain, $lang );
+
$this-output( Adding to dblists\n );
 
# Add to dblist
@@ -230,6 +232,24 @@
 
 EOT;
}
+
+   private function setFundraisingLink( $domain, $language ) {
+
+   $title = Title::newFromText( Mediawiki:Sitesupport-url );
+   $this-output( Writing sidebar donate link to  . 
$title-getPrefixedDBkey() . \n );
+   $article = WikiPage::factory( $title );
+
+   // There is likely a better way to create the link, but it 
seems like one
+   // cannot count on interwiki links at this point
+   $linkurl = https://donate.wikimedia.org/?; . http_build_query( 
array(
+   utm_source = donate,
+   utm_medium = sidebar,
+   utm_campaign = $domain,
+   uselang = $language
+   ) );
+
+   return $article-doEdit( $linkurl, 'Setting sidebar link', 
EDIT_NEW );
+   }
 }
 
 $maintClass = AddWiki;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79914683688ab8f6fab08622efeda480fb295c3f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating default sitesupport-url - change (mediawiki...WikimediaMessages)

2013-05-13 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating default sitesupport-url
..

Updating default sitesupport-url

Change-Id: Ib9e54028cf697385780a4eb55d6caf2fb986592d
---
M WikimediaMessages.i18n.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/95/63595/1

diff --git a/WikimediaMessages.i18n.php b/WikimediaMessages.i18n.php
index afcb04d..4963acc 100644
--- a/WikimediaMessages.i18n.php
+++ b/WikimediaMessages.i18n.php
@@ -14,7 +14,7 @@
 
 $messages['en'] = array(
'wikimediamessages-desc' = 'Wikimedia specific messages',
-   'sitesupport-url'= 
'https://wikimediafoundation.org/wiki/Donate/Now/en?utm_source=donateutm_medium=sidebarutm_campaign=spontaneous_donation',
 # do not translate this URL to other languages until a donation page, approved 
by Wikimedia Foundation, exists
+   'sitesupport-url'= 
'https://donate.wikimedia.org/?utm_source=donateutm_medium=sidebarutm_campaign=spontaneoususelang=en',
 # do not change anything except the uselang for the link
'sitesupport'= 'Donate',
'tooltip-n-sitesupport'  = 'Support us',
'sidebar'=  '* navigation

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9e54028cf697385780a4eb55d6caf2fb986592d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Slight refactoring of migrateAccount for better stats. Addi... - change (mediawiki...CentralAuth)

2013-05-10 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Slight refactoring of migrateAccount for better stats.  Adding 
resetting of authToken.
..

Slight refactoring of migrateAccount for better stats.  Adding resetting of 
authToken.

Change-Id: I72aba3594ebd19d92bac66e84d5c1b6ffb45fd95
---
M maintenance/migrateAccount.php
1 file changed, 27 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/45/63145/1

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
index ddd3a96..c1fb128 100644
--- a/maintenance/migrateAccount.php
+++ b/maintenance/migrateAccount.php
@@ -17,12 +17,14 @@
parent::__construct();
$this-mDescription = Migrates the specified local account to 
a global account;
$this-start = microtime( true );
+   $this-partial = 0;
$this-migrated = 0;
$this-total = 0;
$this-safe = false;
$this-dbBackground = null;
$this-batchSize = 1000;
$this-autoMigrate = false;
+   $this-resetToken = false;
 
$this-addOption( 'auto', 'Allows migration using 
CentralAuthUser::attemptAutoMigration defaults', false, false );
$this-addOption( 'userlist', 'List of usernames to migrate in 
the format username\thomewiki, where \thomewiki is optional', false, true );
@@ -30,6 +32,7 @@
$this-addOption( 'homewiki', 'The wiki to set as the homewiki. 
Can only be used with --username', false, true, 'h' );
$this-addOption( 'safe', 'Only migrates accounts with one 
instance of the username across all wikis', false, false );
$this-addOption( 'attachmissing', 'Attach matching local 
accounts to global account', false, false );
+   $this-addOption( 'resettoken', 'Allows for the reset of auth 
tokens in certain circumstances', false, false );
}
 
public function execute() {
@@ -41,6 +44,9 @@
}
if ( $this-getOption( 'auto', false ) !== false ) {
$this-autoMigrate = true;
+   }
+   if ( $this-getOption( 'resettoken', false ) !== false ) {
+   $this-resetToken = true;
}
 
// check to see if we are processing a single username
@@ -95,6 +101,7 @@
$this-output( CentralAuth account migration for:  . 
$username . \n);
 
$central = new CentralAuthUser( $username );
+   $unattached = $central-queryUnattached();
 
/**
 * Migration with an existing global account
@@ -104,7 +111,6 @@
$this-getOption( 'attachmissing', false )
 !is_null( 
$central-getEmailAuthenticationTimestamp() )
){
-   $unattached = $central-queryUnattached();
foreach ( $unattached as $wiki = $local ) {
if (
$central-getEmail() == 
$local['email']
@@ -112,10 +118,8 @@
){
$this-output( ATTACHING: 
$username@$wiki\n );
$central-attach( $wiki, 'mail' 
);
-   $this-migrated++;
}
}
-   return true;
} else {
$this-output( ERROR: A global account already 
exists for: $username\n );
}
@@ -124,8 +128,6 @@
 * Migration without an existing global account
 */
else {
-   $unattached = $central-queryUnattached();
-
if ( count( $unattached ) == 0 ) {
$this-output( ERROR: No local accounts found 
for: $username\n );
return false;
@@ -167,31 +169,41 @@
// all of the emails are the same and confirmed
if ( $emailMatch ) {
$this-output( Email addresses match and are 
confirmed for: $username\n );
-   if ( $central-storeAndMigrate() ) {
-   $this-migrated++;
-   return true;
-   }
+   $central-storeAndMigrate();
} else {
if ( isset( $central-mHomeWiki ) || 
$this-autoMigrate ) {
-

[MediaWiki-commits] [Gerrit] Updates to CentralAuth maintenance script - change (mediawiki/core)

2013-05-10 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updates to CentralAuth maintenance script
..

Updates to CentralAuth maintenance script

Change-Id: I8fc08ce54e1417293fb3628fd081b52eeaef3c1a
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/63238/1

diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index c0f55f1..a138547 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit c0f55f1989d4f20ed464bf4617b5403ce3f7a078
+Subproject commit a138547306f7b2ef2438550251f0df0987ec2842

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fc08ce54e1417293fb3628fd081b52eeaef3c1a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updates to CentralAuth maintenance script - change (mediawiki/core)

2013-05-10 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Updates to CentralAuth maintenance script
..


Updates to CentralAuth maintenance script

Change-Id: I8fc08ce54e1417293fb3628fd081b52eeaef3c1a
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index c0f55f1..a138547 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit c0f55f1989d4f20ed464bf4617b5403ce3f7a078
+Subproject commit a138547306f7b2ef2438550251f0df0987ec2842

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8fc08ce54e1417293fb3628fd081b52eeaef3c1a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Whitespace fix followup to I72aba35 - change (mediawiki...CentralAuth)

2013-05-10 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Whitespace fix followup to I72aba35
..

Whitespace fix followup to I72aba35

Change-Id: Icd4c44a1dfd1d7365ea1b74e051473926059c5ba
---
M maintenance/migrateAccount.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/39/63239/1

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
index 3503777..ec64311 100644
--- a/maintenance/migrateAccount.php
+++ b/maintenance/migrateAccount.php
@@ -183,8 +183,7 @@
if ( count( $unattachedAfter ) == 0 ) {
$this-migrated++;
return;
-   }
-   elseif ( count( $unattachedAfter )  0  count( 
$unattachedAfter )  count( $unattached ) ) {
+   } elseif ( count( $unattachedAfter )  0  count( 
$unattachedAfter )  count( $unattached ) ) {
$this-partial++;
$this-output( INFO: Incomplete migration for 
'$username'\n );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd4c44a1dfd1d7365ea1b74e051473926059c5ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Enabling wgCentralAuthAutoMigrate on all wikis - change (operations/mediawiki-config)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Enabling wgCentralAuthAutoMigrate on all wikis
..

Enabling wgCentralAuthAutoMigrate on all wikis

Change-Id: I4df22355bf0119abfee179a4c65318d4c3697887
---
M wmf-config/InitialiseSettings.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/95/62995/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 6ca00ac..f9c595f 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12535,6 +12535,10 @@
'default' = false,
'loginwiki' = true,
 ),
+
+'wgCentralAuthAutoMigrate' = array(
+   'default' = true,
+),
 );
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4df22355bf0119abfee179a4c65318d4c3697887
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Enabling wgCentralAuthAutoMigrate on all wikis - change (operations/mediawiki-config)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Enabling wgCentralAuthAutoMigrate on all wikis
..


Enabling wgCentralAuthAutoMigrate on all wikis

Change-Id: I4df22355bf0119abfee179a4c65318d4c3697887
---
M wmf-config/InitialiseSettings.php
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 6ca00ac..f9c595f 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12535,6 +12535,10 @@
'default' = false,
'loginwiki' = true,
 ),
+
+'wgCentralAuthAutoMigrate' = array(
+   'default' = true,
+),
 );
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4df22355bf0119abfee179a4c65318d4c3697887
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: CSteipp cste...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Enabling wfDebugLog for CentralAuth - change (operations/mediawiki-config)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Enabling wfDebugLog for CentralAuth
..

Enabling wfDebugLog for CentralAuth

Change-Id: Id0ffc98194cb6d16bc40f1f966985814c18aa31c
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/01/63001/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index f9c595f..e0271b2 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4274,6 +4274,7 @@
'mobile'  = udp://$wmfUdp2logDest/mobile,
// 'mwsearch' = udp://$wmfUdp2logDest/mwsearch,
'temp-debug' = udp://$wmfUdp2logDest/temp-debug, // generic 
admin debug log
+   'CentralAuth' = udp://$wmfUdp2logDest/centralauth, // 
-pgehres 2013/05/09, tmp for SUL finalization
),
 
'+enwiki' = array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0ffc98194cb6d16bc40f1f966985814c18aa31c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Enabling wfDebugLog for CentralAuth - change (operations/mediawiki-config)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Enabling wfDebugLog for CentralAuth
..


Enabling wfDebugLog for CentralAuth

Change-Id: Id0ffc98194cb6d16bc40f1f966985814c18aa31c
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Reedy: Looks good to me, but someone else must approve
  Pgehres: Verified; Looks good to me, approved



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index f9c595f..e0271b2 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4274,6 +4274,7 @@
'mobile'  = udp://$wmfUdp2logDest/mobile,
// 'mwsearch' = udp://$wmfUdp2logDest/mwsearch,
'temp-debug' = udp://$wmfUdp2logDest/temp-debug, // generic 
admin debug log
+   'CentralAuth' = udp://$wmfUdp2logDest/centralauth, // 
-pgehres 2013/05/09, tmp for SUL finalization
),
 
'+enwiki' = array(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id0ffc98194cb6d16bc40f1f966985814c18aa31c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: CSteipp cste...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Reedy re...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding CentralAuthVerbose wfDebugLog. - change (mediawiki...CentralAuth)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding CentralAuthVerbose wfDebugLog.
..

Adding CentralAuthVerbose wfDebugLog.

Changing the more chatty log lines to the verbose group.

Change-Id: If634a75edc9dcc6beec084e8e3ac96258fcd80d3
---
M CentralAuthUser.php
1 file changed, 11 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/08/63008/1

diff --git a/CentralAuthUser.php b/CentralAuthUser.php
index 93c1294..469b4d8 100644
--- a/CentralAuthUser.php
+++ b/CentralAuthUser.php
@@ -167,7 +167,7 @@
return;
}
 
-   wfDebugLog( 'CentralAuth', Loading state for global user 
{$this-mName} from DB );
+   wfDebugLog( 'CentralAuthVerbose', Loading state for global 
user {$this-mName} from DB );
 
// Get the master. We want to make sure we've got up to date 
information
// since we're caching it.
@@ -201,7 +201,7 @@
}
// We need the user id from the database, but this should be 
checked by the getId accessor.
 
-   wfDebugLog( 'CentralAuth', Loading groups for global user 
{$this-mName} );
+   wfDebugLog( 'CentralAuthVerbose', Loading groups for global 
user {$this-mName} );
 
$dbr = self::getCentralDB(); // We need the master.
 
@@ -287,7 +287,7 @@
 
if ( !is_array( $cache ) || $cache['mVersion']  
$this-mVersion ) {
// Out of date cache.
-   wfDebugLog( 'CentralAuth', Global User: cache miss for 
{$this-mName},  .
+   wfDebugLog( 'CentralAuthVerbose', Global User: cache 
miss for {$this-mName},  .
version {$cache['mVersion']}, expected 
{$this-mVersion} );
wfProfileOut( __METHOD__ );
return false;
@@ -307,7 +307,7 @@
 * @param $fromMaster Bool
 */
protected function loadFromCacheObject( $object, $fromMaster = false ) {
-   wfDebugLog( 'CentralAuth', Loading CentralAuthUser for user 
{$this-mName} from cache object );
+   wfDebugLog( 'CentralAuthVerbose', Loading CentralAuthUser for 
user {$this-mName} from cache object );
foreach ( self::$mCacheVars as $var ) {
$this-$var = $object[$var];
}
@@ -351,7 +351,7 @@
}
 
$obj = $this-getCacheObject();
-   wfDebugLog( 'CentralAuth', Saving user {$this-mName} to 
cache. );
+   wfDebugLog( 'CentralAuthVerbose', Saving user {$this-mName} 
to cache. );
$wgMemc-set( $this-getCacheKey(), $obj, 86400 );
 }
 
@@ -886,7 +886,7 @@
 
if ( count( $remaining ) == 0 ) {
wfDebugLog( 'CentralAuth',
-   Successfull auto migration for '$this-mName' 
);
+   Successful auto migration for '$this-mName' 
);
return true;
}
 
@@ -2238,12 +2238,12 @@
 
public function invalidateCache() {
if ( !$this-mDelayInvalidation ) {
-   wfDebugLog( 'CentralAuth', Updating cache for global 
user {$this-mName} );
+   wfDebugLog( 'CentralAuthVerbose', Updating cache for 
global user {$this-mName} );
 
// Reload the state and overwrite the cache.
$this-loadStateNoCache();
} else {
-   wfDebugLog( 'CentralAuth', Deferring cache 
invalidation because we're in a transaction );
+   wfDebugLog( 'CentralAuthVerbose', Deferring cache 
invalidation because we're in a transaction );
}
}
 
@@ -2253,7 +2253,7 @@
public function quickInvalidateCache() {
global $wgMemc;
 
-   wfDebugLog( 'CentralAuth', Quick cache invalidation for global 
user {$this-mName} );
+   wfDebugLog( 'CentralAuthVerbose', Quick cache invalidation for 
global user {$this-mName} );
 
$wgMemc-delete( $this-getCacheKey() );
}
@@ -2265,7 +2265,7 @@
 * Intended to be used for things like migration.
 */
public function endTransaction() {
-   wfDebugLog( 'CentralAuth', Finishing CentralAuthUser 
cache-invalidating transaction );
+   wfDebugLog( 'CentralAuthVerbose', Finishing CentralAuthUser 
cache-invalidating transaction );
$this-mDelayInvalidation = false;
$this-invalidateCache();
}
@@ -2277,7 +2277,7 @@
 * Intended to be used for things like migration.
 */
public function startTransaction() {
-   wfDebugLog( 'CentralAuth', Beginning 

[MediaWiki-commits] [Gerrit] Modifying CentralAuthUser-attemptAutoMigration to allow for... - change (mediawiki...CentralAuth)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Modifying CentralAuthUser-attemptAutoMigration to allow for 
home wiki specification.
..

Modifying CentralAuthUser-attemptAutoMigration to allow for home wiki 
specification.

Checks to see if mHomeWiki is set and, if so, does not determine the home wiki
using chooseHomeWiki().  This allows us to set the home wiki in migrateAccount
before running attemptAutoMigration ensuring that the correct account wins.

Change-Id: Ib9364e7a49e3f17f4ca63118b2234d340e862d67
---
M CentralAuthUser.php
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/11/63011/1

diff --git a/CentralAuthUser.php b/CentralAuthUser.php
index 93c1294..204fff1 100644
--- a/CentralAuthUser.php
+++ b/CentralAuthUser.php
@@ -796,8 +796,16 @@
return false;
}
 
+   if ( isset( $this-mHomeWiki ) ) {
+   if ( !array_key_exists( $this-mHomeWiki, $migrationSet 
) ) {
+   wfDebugLog( 'CentralAuth',
+   Invalid home wiki specification 
'$this-mName'@'$this-mHomeWiki' );
+   return false;
+   }
+   } else {
+   $this-mHomeWiki = $this-chooseHomeWiki( $migrationSet 
);
+   }
 
-   $this-mHomeWiki = $this-chooseHomeWiki( $migrationSet );
$home = $migrationSet[$this-mHomeWiki];
$this-mEmail = $home['email'];
$this-mEmailAuthenticated = $home['emailAuthenticated'];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9364e7a49e3f17f4ca63118b2234d340e862d67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Modifications to migrateAccount to allow specifying the home... - change (mediawiki...CentralAuth)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Modifications to migrateAccount to allow specifying the home 
wiki
..

Modifications to migrateAccount to allow specifying the home wiki

Change-Id: Ie45d6d6e464797800944157265aa37263a84b156
---
M maintenance/migrateAccount.php
1 file changed, 44 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/15/63015/1

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
index f03b0c0..d496541 100644
--- a/maintenance/migrateAccount.php
+++ b/maintenance/migrateAccount.php
@@ -22,9 +22,12 @@
$this-safe = false;
$this-dbBackground = null;
$this-batchSize = 1000;
+   $this-autoMigrate = false;
 
-   $this-addOption( 'userlist', 'List of usernames to migrate', 
false, true );
+   $this-addOption( 'auto', 'Allows migration using 
CentralAuthUser::attemptAutoMigration defaults', false, false );
+   $this-addOption( 'userlist', 'List of usernames to migrate in 
the format username\thomewiki, where \thomewiki is optional', false, true );
$this-addOption( 'username', 'The user name to migrate', 
false, true, 'u' );
+   $this-addOption( 'homewiki', 'The wiki to set as the homewiki. 
Can only be used with --username', false, true, 'h' );
$this-addOption( 'safe', 'Only migrates accounts with one 
instance of the username across all wikis', false, false );
$this-addOption( 'attachmissing', 'Attach matching local 
accounts to global account', false, false );
}
@@ -33,10 +36,18 @@
 
$this-dbBackground = CentralAuthUser::getCentralSlaveDB();
 
+   if ( $this-getOption( 'safe', false ) !== false ) {
+   $this-safe = true;
+   }
+   if ( $this-getOption( 'auto', false ) !== false ) {
+   $this-autoMigrate = true;
+   }
+
// check to see if we are processing a single username
if ( $this-getOption( 'username', false ) !== false ) {
$username = $this-getOption( 'username' );
-   $this-migrate( $username );
+   $homewiki = $this-getOption( 'homewiki', null );
+   $this-migrate( $username, $homewiki );
 
} elseif ( $this-getOption( 'userlist', false ) !== false ) {
$list = $this-getOption( 'userlist' );
@@ -49,10 +60,19 @@
$this-output( ERROR - Could not open file: 
$list );
exit( 1 );
}
-   while( $username = fgets( $file ) ) {
-   $username = trim( $username ); // trim the \n
-   $this-migrate( $username );
-
+   while( $line = trim( fgets( $file ) ) ) {
+   $values = explode( \t, $line );
+   switch( count( $values ) ){
+   case 1:
+   $this-migrate( $values[0] );
+   break;
+   case 2:
+   $this-migrate( $values[0], 
$values[1] );
+   break;
+   default:
+   $this-output( ERROR: Invalid 
account specification: '$line'\n );
+   continue;
+   }
if ( $this-total % $this-batchSize == 0 ) {
$this-output( Waiting for slaves to 
catch up ...  );
wfWaitForSlaves( false, 'centralauth' );
@@ -70,7 +90,7 @@
$this-output( done.\n );
}
 
-   function migrate( $username ) {
+   function migrate( $username, $homewiki=null ) {
$this-total++;
$this-output( CentralAuth account migration for:  . 
$username . \n);
 
@@ -119,6 +139,14 @@
return false;
}
 
+   if ( isset( $homewiki ) ) {
+   if ( !array_key_exists( $homewiki, $unattached 
) ) {
+   $this-output( ERROR: Unattached user 
not found for $username@$homewiki );
+   return false;
+   }
+   $central-mHomeWiki = $homewiki;
+   }
+
// check that all 

[MediaWiki-commits] [Gerrit] Adding a bit of logging to distinguish $wgCentralAuthAutoMig... - change (mediawiki...CentralAuth)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding a bit of logging to distinguish 
$wgCentralAuthAutoMigrate migrations from others.
..

Adding a bit of logging to distinguish $wgCentralAuthAutoMigrate migrations 
from others.

Change-Id: I7281788682df793dea594a10e290c314f731d791
---
M CentralAuthPlugin.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/75/63075/1

diff --git a/CentralAuthPlugin.php b/CentralAuthPlugin.php
index 4cb77d5..4a8be03 100644
--- a/CentralAuthPlugin.php
+++ b/CentralAuthPlugin.php
@@ -55,6 +55,8 @@
//
// That may or may not include the current wiki.
//
+   wfDebugLog( 'CentralAuth',
+   plugin: attempting wgCentralAuthAutoMigrate 
for '$username' );
$central-attemptPasswordMigration( $password );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7281788682df793dea594a10e290c314f731d791
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updates to CentralAuth for SUL finalization - change (mediawiki/core)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updates to CentralAuth for SUL finalization
..

Updates to CentralAuth for SUL finalization

Change-Id: I581b7cede28be4a4e4fafddb02413cad3fffa573
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/63084/1

diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index 06c7a36..23b01e6 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit 06c7a36e9b73bb9e9946261bf90bec58ad72b6df
+Subproject commit 23b01e60abd73815cd8d058ba9eca86998972957

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I581b7cede28be4a4e4fafddb02413cad3fffa573
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updates to CentralAuth for SUL finalization - change (mediawiki/core)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Updates to CentralAuth for SUL finalization
..


Updates to CentralAuth for SUL finalization

Change-Id: I581b7cede28be4a4e4fafddb02413cad3fffa573
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index 06c7a36..23b01e6 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit 06c7a36e9b73bb9e9946261bf90bec58ad72b6df
+Subproject commit 23b01e60abd73815cd8d058ba9eca86998972957

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I581b7cede28be4a4e4fafddb02413cad3fffa573
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Moving one more debug log line to the CentralAuthVerbose group - change (mediawiki...CentralAuth)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Moving one more debug log line to the CentralAuthVerbose group
..

Moving one more debug log line to the CentralAuthVerbose group

Change-Id: If63cd3f08935906b9f5de0ebab8656fc5c3dce42
---
M CentralAuthUser.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/86/63086/1

diff --git a/CentralAuthUser.php b/CentralAuthUser.php
index a45bd5f..7077639 100644
--- a/CentralAuthUser.php
+++ b/CentralAuthUser.php
@@ -1673,7 +1673,7 @@
return;
}
 
-   wfDebugLog( 'CentralAuth', Loading attached wiki list for 
global user {$this-mName} from DB );
+   wfDebugLog( 'CentralAuthVerbose', Loading attached wiki list 
for global user {$this-mName} from DB );
 
$dbw = self::getCentralDB();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If63cd3f08935906b9f5de0ebab8656fc5c3dce42
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] One more minor update to CentralAuth logging - change (mediawiki/core)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: One more minor update to CentralAuth logging
..

One more minor update to CentralAuth logging

Change-Id: Ia128adc612bbfd46e2816a15da759ee54be1199d
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/63090/1

diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index 23b01e6..c0f55f1 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit 23b01e60abd73815cd8d058ba9eca86998972957
+Subproject commit c0f55f1989d4f20ed464bf4617b5403ce3f7a078

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia128adc612bbfd46e2816a15da759ee54be1199d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Actually enabling - change (operations/mediawiki-config)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Actually enabling
..

Actually enabling

Change-Id: Iacbfdf2ce30f7da35a1a2f2787709088fe0b6a09
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/94/63094/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 1221c0a..ee8478d 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1583,6 +1583,9 @@
 
// Let's give it another try
$wgCentralAuthCreateOnView = true;
+
+   // Attempt to attach unattached accounts by password on login
+   $wgCentralAuthAutoMigrate = true;
 }
 
 // taking it live 2006-12-15 brion
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index efc7fe4..37a527e 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12534,10 +12534,6 @@
'default' = false,
'loginwiki' = true,
 ),
-
-'wgCentralAuthAutoMigrate' = array(
-   'default' = true,
-),
 );
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacbfdf2ce30f7da35a1a2f2787709088fe0b6a09
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Actually enabling - change (operations/mediawiki-config)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Actually enabling
..


Actually enabling

Change-Id: Iacbfdf2ce30f7da35a1a2f2787709088fe0b6a09
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 3 insertions(+), 4 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 1221c0a..ee8478d 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1583,6 +1583,9 @@
 
// Let's give it another try
$wgCentralAuthCreateOnView = true;
+
+   // Attempt to attach unattached accounts by password on login
+   $wgCentralAuthAutoMigrate = true;
 }
 
 // taking it live 2006-12-15 brion
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index efc7fe4..37a527e 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12534,10 +12534,6 @@
'default' = false,
'loginwiki' = true,
 ),
-
-'wgCentralAuthAutoMigrate' = array(
-   'default' = true,
-),
 );
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iacbfdf2ce30f7da35a1a2f2787709088fe0b6a09
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Making sure state is loaded before resetting the auth token - change (mediawiki...CentralAuth)

2013-05-09 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Making sure state is loaded before resetting the auth token
..

Making sure state is loaded before resetting the auth token

Change-Id: I4c07451cb93cce6008fcc7c23705a813c05bc18e
---
M CentralAuthUser.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/07/63107/1

diff --git a/CentralAuthUser.php b/CentralAuthUser.php
index 7077639..8acbf7e 100644
--- a/CentralAuthUser.php
+++ b/CentralAuthUser.php
@@ -2061,6 +2061,9 @@
 * not randomly log users out (so on logout, as is done currently, is a 
good time).
 */
function resetAuthToken() {
+   // Load state, since its hard to reset the token without it
+   $this-loadState();
+
// Generate a random token.
$this-mAuthToken = MWCryptRand::generateHex( 32 );
$this-mStateDirty = true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c07451cb93cce6008fcc7c23705a813c05bc18e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Disabling Fundraier Redirect to WMFr per their request - change (mediawiki...FundraiserLandingPage)

2013-05-07 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Disabling Fundraier Redirect to WMFr per their request
..


Disabling Fundraier Redirect to WMFr per their request

Change-Id: I0f4a59035d5aa1f55e158c9493760daa5ff1870a
---
M FundraiserLandingPage.php
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/FundraiserLandingPage.php b/FundraiserLandingPage.php
index bfe4666..bf45639 100644
--- a/FundraiserLandingPage.php
+++ b/FundraiserLandingPage.php
@@ -58,9 +58,11 @@
 $wgFundraiserLandingPageChapters = array(
'CH' = fundraiserlandingpage-wmch-landing-page,
'DE' = fundraiserlandingpage-wmde-landing-page,
-   'FR' = fundraiserlandingpage-wmfr-landing-page,
+// 'FR' = fundraiserlandingpage-wmfr-landing-page, // disabled May 2013 
per WMFr request
 // 'GB' = fundraiserlandingpage-wmuk-landing-page, // disabled for 2012 
per agreement with WMUK
 
+/*
+ * All French Territories disabled May 2013 per WMFr request
// French Territories per WMFr email 2012-06-13
'GP' = fundraiserlandingpage-wmfr-landing-page, // Guadeloupe
'MQ' = fundraiserlandingpage-wmfr-landing-page, // Martinique
@@ -74,6 +76,7 @@
'BL' = fundraiserlandingpage-wmfr-landing-page, // Saint Barthélemy
'MF' = fundraiserlandingpage-wmfr-landing-page, // Collectivity of 
San Martin
'TF' = fundraiserlandingpage-wmfr-landing-page, // French Southern 
and Antarctic Lands
+*/
 
 );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f4a59035d5aa1f55e158c9493760daa5ff1870a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FundraiserLandingPage
Gerrit-Branch: master
Gerrit-Owner: Katie Horn kh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding aa_method field to track login method. - change (mediawiki...AccountAudit)

2013-05-01 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding aa_method field to track login method.
..

Adding aa_method field to track login method.

Change-Id: I823c873da8670ee158eee0b00759e2df8d5ef5b2
---
M AccountAudit.body.php
M AccountAudit.hooks.php
M accountaudit.sql
3 files changed, 26 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AccountAudit 
refs/changes/01/61801/1

diff --git a/AccountAudit.body.php b/AccountAudit.body.php
index 4fe05b6..b15c1db 100644
--- a/AccountAudit.body.php
+++ b/AccountAudit.body.php
@@ -2,6 +2,9 @@
 
 class AccountAudit {
 
+   const ACCESS_METHOD_DEFAULT = 0;
+   const ACCESS_METHOD_MOBILE = 1;
+
/**
 * Updates the aa_lastlogin value for the specified user
 *
@@ -19,12 +22,18 @@
$db = wfGetDB( DB_MASTER );
$method = __METHOD__;
 
-   $db-onTransactionIdle( function() use ( $user, $now, $db, 
$method ) {
+   $requestMethod = self::ACCESS_METHOD_DEFAULT;
+   if ( MobileContext::singleton()-shouldDisplayMobileView() ) {
+   $requestMethod = self::ACCESS_METHOD_MOBILE;
+   }
+
+   $db-onTransactionIdle( function() use ( $user, $requestMethod, 
$now, $db, $method ) {
if ( $db-getType() === 'mysql' ) { // MySQL-specific 
implementation
$db-query(
INSERT INTO  . $db-tableName( 
'accountaudit_login' ) .
-   ( aa_user, aa_lastlogin ) 
VALUES ( .
+   ( aa_user, aa_method, 
aa_lastlogin ) VALUES ( .
$db-addQuotes( $user-getId() 
) . ,  .
+   $db-addQuotes( $requestMethod 
) . ,  .
$db-addQuotes( $db-timestamp( 
$now ) ) .
) ON DUPLICATE KEY UPDATE 
aa_lastlogin =  .
$db-addQuotes( $db-timestamp( 
$now ) ),
@@ -34,13 +43,17 @@
$db-update(
'accountaudit_login',
array( 'aa_lastlogin' = 
$db-timestamp( $now ) ),
-   array( 'aa_user' = $user-getId() ),
+   array( 'aa_user' = $user-getId(), 
'aa_method' = $requestMethod ),
$method
);
-   if ( $db-affectedRows() == 0 ) { // no row 
existed for that user
+   if ( $db-affectedRows() == 0 ) { // no row 
existed for that user, method
$db-insert(
'accountaudit_login',
-   array( 'aa_user' = 
$user-getId(), 'aa_lastlogin' =  $db-timestamp( $now ) ),
+   array(
+'aa_user' = 
$user-getId(),
+'aa_method' = 
$requestMethod,
+'aa_lastlogin' =  
$db-timestamp( $now )
+   ),
$method,
array( 'IGNORE', )
);
diff --git a/AccountAudit.hooks.php b/AccountAudit.hooks.php
index 8867a60..a625e9c 100644
--- a/AccountAudit.hooks.php
+++ b/AccountAudit.hooks.php
@@ -31,8 +31,9 @@
 * @return bool
 */
static function loadExtensionSchemaUpdates( DatabaseUpdater $updater ) {
-   $updater-addExtensionTable( 'accountaudit_login',
-   __DIR__ . '/accountaudit.sql', true );
+   $updater-addExtensionTable( 'accountaudit_login', __DIR__ . 
'/accountaudit.sql' );
+   $updater-addExtensionField( 'accountaudit_login', 'aa_method',
+   __DIR__ . '/patches/add_method.sql' );
return true;
}
 }
\ No newline at end of file
diff --git a/accountaudit.sql b/accountaudit.sql
index f228ffc..f36c1de 100644
--- a/accountaudit.sql
+++ b/accountaudit.sql
@@ -4,10 +4,13 @@
 --
 CREATE TABLE /*$wgDBprefix*/accountaudit_login (
   -- Key to user_id
-  aa_user int unsigned NOT NULL PRIMARY KEY,
+  aa_user int unsigned NOT NULL,
+  aa_method tinyint unsigned NOT NULL DEFAULT 0,
 
   -- This is a timestamp which is updated when a user logs in
   aa_lastlogin varbinary(14) default null
 ) /*$wgDBTableOptions*/;
 
-CREATE INDEX 

[MediaWiki-commits] [Gerrit] Unsetting the email address for a user when the email addres... - change (mediawiki/core)

2013-05-01 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Unsetting the email address for a user when the email address 
is invalidated.
..

Unsetting the email address for a user when the email address is invalidated.

Change-Id: I2a8445745f04540e7962695c3116bb247d81fd94
---
M includes/User.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/07/61907/1

diff --git a/includes/User.php b/includes/User.php
index 37a384c..cb73cda 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -3723,6 +3723,7 @@
$this-mEmailToken = null;
$this-mEmailTokenExpires = null;
$this-setEmailAuthenticationTimestamp( null );
+   $this-mEmail = null;
wfRunHooks( 'InvalidateEmailComplete', array( $this ) );
return true;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a8445745f04540e7962695c3116bb247d81fd94
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding UserInvalidateEmailComplete hook to CentralAuth. - change (mediawiki...CentralAuth)

2013-05-01 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding UserInvalidateEmailComplete hook to CentralAuth.
..

Adding UserInvalidateEmailComplete hook to CentralAuth.

Change-Id: I6f3d284c3f6b23e4baa9f11134d6bcd318d5fabb
---
M CentralAuth.php
M CentralAuthHooks.php
2 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/12/61912/1

diff --git a/CentralAuth.php b/CentralAuth.php
index 9aaff35..0273bec 100644
--- a/CentralAuth.php
+++ b/CentralAuth.php
@@ -207,6 +207,7 @@
 $wgHooks['UserArrayFromResult'][] = 'CentralAuthHooks::onUserArrayFromResult';
 $wgHooks['UserGetEmail'][] = 'CentralAuthHooks::onUserGetEmail';
 $wgHooks['UserGetEmailAuthenticationTimestamp'][] = 
'CentralAuthHooks::onUserGetEmailAuthenticationTimestamp';
+$wgHooks['UserInvalidateEmailComplete'][] = 
'CentralAuthHooks::onUserInvalidateEmailComplete';
 $wgHooks['UserSetEmail'][] = 'CentralAuthHooks::onUserSetEmail';
 $wgHooks['UserSaveSettings'][] = 'CentralAuthHooks::onUserSaveSettings';
 $wgHooks['UserSetEmailAuthenticationTimestamp'][] = 
'CentralAuthHooks::onUserSetEmailAuthenticationTimestamp';
diff --git a/CentralAuthHooks.php b/CentralAuthHooks.php
index 6dc45d1..7b76055 100644
--- a/CentralAuthHooks.php
+++ b/CentralAuthHooks.php
@@ -708,6 +708,20 @@
 
/**
 * @param $user
+* @return bool
+*/
+   static function onUserInvalidateEmailComplete( $user ) {
+   $ca = CentralAuthUser::getInstance( $user );
+   if ( $ca-isAttached() ) {
+   $ca-setEmail( null );
+   $ca-setEmailAuthenticationTimestamp( null );
+   $ca-saveSettings();
+   }
+   return true;
+   }
+
+   /**
+* @param $user
 * @param $email
 * @return bool
 */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f3d284c3f6b23e4baa9f11134d6bcd318d5fabb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Enabling Extension:AccountAudit on all wikis - change (operations/mediawiki-config)

2013-04-30 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Enabling Extension:AccountAudit on all wikis
..

Enabling Extension:AccountAudit on all wikis

Change-Id: Ied4938e5df3912e655323d1cf0e2d77f33c35b1b
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/39/61639/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index b7d6cce..4494dc1 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12408,8 +12408,7 @@
'donatewiki' = false,
 ),
 'wmgUseAccountAudit' = array(
-   'default' = false,
-   'test2wiki' = true
+   'default' = true,
 )
 );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied4938e5df3912e655323d1cf0e2d77f33c35b1b
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Documentation tweaks - change (mediawiki...AccountAudit)

2013-04-30 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Documentation tweaks
..

Documentation tweaks

Change-Id: I29ba81a1892b3934a3be86a3cc0e77edb2357e05
---
M AccountAudit.i18n.php
M AccountAudit.php
2 files changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AccountAudit 
refs/changes/46/61646/1

diff --git a/AccountAudit.i18n.php b/AccountAudit.i18n.php
index 716c281..91cee02 100644
--- a/AccountAudit.i18n.php
+++ b/AccountAudit.i18n.php
@@ -3,7 +3,7 @@
 $messages = array();
 
 $messages['en'] = array(
-   'accountaudit-desc' = Used to assist the WMF in completing the audit 
and unification of non-global accounts that exist across the WMF's projects,
+   'accountaudit-desc' = 'This extension is used to audit active/inactive 
user accounts.',
 );
 
 /** Message documentation (Message documentation)
diff --git a/AccountAudit.php b/AccountAudit.php
index 1d8377f..a16068e 100644
--- a/AccountAudit.php
+++ b/AccountAudit.php
@@ -1,7 +1,8 @@
 ?php
 /*
- * Extension:AccountAudit. This extension is used to assist the WMF in 
completing the audit
- * and unification of non-global accounts that exist across the WMF's projects.
+ * Extension:AccountAudit. This extension is used to audit active/inactive 
user accounts
+ * by, at least initially, keeping track of the timestamp of the most recent 
login action
+ * for a user on a wiki.
  *
  * @author Peter Gehres pgeh...@wikimedia.org
  */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29ba81a1892b3934a3be86a3cc0e77edb2357e05
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AccountAudit
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Enabling Extension:AccountAudit on all wikis - change (operations/mediawiki-config)

2013-04-30 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Enabling Extension:AccountAudit on all wikis
..


Enabling Extension:AccountAudit on all wikis

Change-Id: Ied4938e5df3912e655323d1cf0e2d77f33c35b1b
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index b7d6cce..4494dc1 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12408,8 +12408,7 @@
'donatewiki' = false,
 ),
 'wmgUseAccountAudit' = array(
-   'default' = false,
-   'test2wiki' = true
+   'default' = true,
 )
 );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ied4938e5df3912e655323d1cf0e2d77f33c35b1b
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding configuration variables for Extension:AccountAudit - change (operations/mediawiki-config)

2013-04-29 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding configuration variables for Extension:AccountAudit
..

Adding configuration variables for Extension:AccountAudit

Change-Id: I5b38c047156b5cb050e4d2daaed8a601e6654bb0
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/99/61499/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 070287d..895aaa1 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2748,6 +2748,10 @@
$wgGroupPermissions['zeroadmin']['zero-edit'] = true;
 }
 
+if ( $wmgUseAccountAudit ) {
+   require_once( $IP/extensions/AccountAudit/AccountAudit.php );
+}
+
 // On Special:Version, link to useful release notes
 $wgHooks['SpecialVersionVersionUrl'][] = function( $wgVersion, $versionUrl ) {
$matches = array();
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index a1e15da..8093c5c 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12397,6 +12397,10 @@
'foundationwiki' = false,
'collabwiki' = false,
'donatewiki' = false,
+),
+'wmfUseAccountAudit' = array(
+   'default' = false,
+   'test2wiki' = true
 )
 );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b38c047156b5cb050e4d2daaed8a601e6654bb0
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding Extension:AccountAudit - change (mediawiki/core)

2013-04-29 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding Extension:AccountAudit
..

Adding Extension:AccountAudit

Change-Id: I4407d88fee0d8f29bf3e52cf552a2217ad454cb0
---
M .gitmodules
A extensions/AccountAudit
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/61500/1

diff --git a/.gitmodules b/.gitmodules
index 3ce124d..ffdb2e6 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -454,3 +454,6 @@
 [submodule extensions/TemplateData]
path = extensions/TemplateData
url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/TemplateData.git
+[submodule extensions/AccountAudit]
+   path = extensions/AccountAudit
+   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AccountAudit.git
diff --git a/extensions/AccountAudit b/extensions/AccountAudit
new file mode 16
index 000..cbe4fd7
--- /dev/null
+++ b/extensions/AccountAudit
+Subproject commit cbe4fd769fc1f962243009ad543bd8bfc115ff31

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4407d88fee0d8f29bf3e52cf552a2217ad454cb0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf2
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding Extension:AccountAudit - change (mediawiki/core)

2013-04-29 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding Extension:AccountAudit
..

Adding Extension:AccountAudit

Change-Id: I8f1389172746084476c972d3c176a3b4f79db451
---
M .gitmodules
A extensions/AccountAudit
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/01/61501/1

diff --git a/.gitmodules b/.gitmodules
index 3ce124d..ffdb2e6 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -454,3 +454,6 @@
 [submodule extensions/TemplateData]
path = extensions/TemplateData
url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/TemplateData.git
+[submodule extensions/AccountAudit]
+   path = extensions/AccountAudit
+   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AccountAudit.git
diff --git a/extensions/AccountAudit b/extensions/AccountAudit
new file mode 16
index 000..cbe4fd7
--- /dev/null
+++ b/extensions/AccountAudit
+Subproject commit cbe4fd769fc1f962243009ad543bd8bfc115ff31

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f1389172746084476c972d3c176a3b4f79db451
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding Extension:AccountAudit - change (mediawiki/core)

2013-04-29 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Adding Extension:AccountAudit
..


Adding Extension:AccountAudit

Change-Id: I8f1389172746084476c972d3c176a3b4f79db451
---
M .gitmodules
A extensions/AccountAudit
2 files changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/.gitmodules b/.gitmodules
index 3ce124d..ffdb2e6 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -454,3 +454,6 @@
 [submodule extensions/TemplateData]
path = extensions/TemplateData
url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/TemplateData.git
+[submodule extensions/AccountAudit]
+   path = extensions/AccountAudit
+   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AccountAudit.git
diff --git a/extensions/AccountAudit b/extensions/AccountAudit
new file mode 16
index 000..cbe4fd7
--- /dev/null
+++ b/extensions/AccountAudit
+Subproject commit cbe4fd769fc1f962243009ad543bd8bfc115ff31

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f1389172746084476c972d3c176a3b4f79db451
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding Extension:AccountAudit - change (mediawiki/core)

2013-04-29 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Adding Extension:AccountAudit
..


Adding Extension:AccountAudit

Change-Id: I4407d88fee0d8f29bf3e52cf552a2217ad454cb0
---
M .gitmodules
A extensions/AccountAudit
2 files changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/.gitmodules b/.gitmodules
index 3ce124d..ffdb2e6 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -454,3 +454,6 @@
 [submodule extensions/TemplateData]
path = extensions/TemplateData
url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/TemplateData.git
+[submodule extensions/AccountAudit]
+   path = extensions/AccountAudit
+   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AccountAudit.git
diff --git a/extensions/AccountAudit b/extensions/AccountAudit
new file mode 16
index 000..cbe4fd7
--- /dev/null
+++ b/extensions/AccountAudit
+Subproject commit cbe4fd769fc1f962243009ad543bd8bfc115ff31

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4407d88fee0d8f29bf3e52cf552a2217ad454cb0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf2
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding configuration variables for Extension:AccountAudit - change (operations/mediawiki-config)

2013-04-29 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Adding configuration variables for Extension:AccountAudit
..


Adding configuration variables for Extension:AccountAudit

Change-Id: I5b38c047156b5cb050e4d2daaed8a601e6654bb0
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
M wmf-config/extension-list
3 files changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 070287d..895aaa1 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2748,6 +2748,10 @@
$wgGroupPermissions['zeroadmin']['zero-edit'] = true;
 }
 
+if ( $wmgUseAccountAudit ) {
+   require_once( $IP/extensions/AccountAudit/AccountAudit.php );
+}
+
 // On Special:Version, link to useful release notes
 $wgHooks['SpecialVersionVersionUrl'][] = function( $wgVersion, $versionUrl ) {
$matches = array();
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index a1e15da..1af99bb 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12397,6 +12397,10 @@
'foundationwiki' = false,
'collabwiki' = false,
'donatewiki' = false,
+),
+'wmgUseAccountAudit' = array(
+   'default' = false,
+   'test2wiki' = true
 )
 );
 
diff --git a/wmf-config/extension-list b/wmf-config/extension-list
index e50029f..abbef1f 100644
--- a/wmf-config/extension-list
+++ b/wmf-config/extension-list
@@ -1,4 +1,5 @@
 $IP/extensions/AbuseFilter/AbuseFilter.php
+$IP/extensions/AccountAudit/AccountAudit.php
 $IP/extensions/AntiBot/AntiBot.php
 $IP/extensions/AntiSpoof/AntiSpoof.php
 $IP/extensions/ApiSandbox/ApiSandbox.php

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b38c047156b5cb050e4d2daaed8a601e6654bb0
Gerrit-PatchSet: 3
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Reedy re...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding the ability for CentralAuth to login a user with an a... - change (mediawiki...CentralAuth)

2013-04-26 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding the ability for CentralAuth to login a user with an 
altername username.
..

Adding the ability for CentralAuth to login a user with an altername username.

As part of the SUL finalization, we are going to need to rename a not
insignificant number of users to $username~$wiki. Since not all users
have an email address and to reduce confusion we are adding the ability
for CentralAuth to attempt to authenticate them to alternate usernames
on a failed login attempt.

Change-Id: I0b191f76714b6da1ed63b9af709b5e21ce5ee24a
---
M CentralAuth.php
M CentralAuthPlugin.php
2 files changed, 78 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/74/61074/1

diff --git a/CentralAuth.php b/CentralAuth.php
index bfd06d9..b144b31 100644
--- a/CentralAuth.php
+++ b/CentralAuth.php
@@ -148,6 +148,14 @@
 $wgCentralAuthReadOnly = false;
 
 /**
+ * As part of the SUL finalization some accounts will have to be forcibly 
renamed.
+ * If true, use the rename pattern to see if the provided credentials work on
+ * any renamed accounts that exist.
+ * @var bool
+ */
+$wgCentralAuthCheckForRenamedAccount = false;
+
+/**
  * Initialization of the autoloaders, and special extension pages.
  */
 $caBase = __DIR__;
diff --git a/CentralAuthPlugin.php b/CentralAuthPlugin.php
index 2790d15..305d22f 100644
--- a/CentralAuthPlugin.php
+++ b/CentralAuthPlugin.php
@@ -8,6 +8,15 @@
  */
 
 class CentralAuthPlugin extends AuthPlugin {
+
+   /**
+* Indicates that an alternate username was used to log in the user and 
the User
+* object should be updated on a call to updateUser().
+*
+* @var String: The username if an alternate has been used
+*/
+   public $alternateUsername = null;
+
/**
 * Check whether there exists a user account with the given name.
 * The name will be normalized to MediaWiki's requirements, so
@@ -35,7 +44,7 @@
 * @public
 */
function authenticate( $username, $password ) {
-   global $wgCentralAuthAutoMigrate;
+   global $wgCentralAuthAutoMigrate, 
$wgCentralAuthCheckForRenamedAccount;
 
$central = new CentralAuthUser( $username );
if ( !$central-exists() ) {
@@ -47,6 +56,10 @@
}
 
$passwordMatch = $central-authenticate( $password ) == ok;
+
+   if ( !$passwordMatch  $wgCentralAuthCheckForRenamedAccount ) {
+   return $this-authenticateAlternate( $username, 
$password );
+   }
 
if ( $passwordMatch  $wgCentralAuthAutoMigrate ) {
// If the user passed in the global password, we can 
identify
@@ -81,6 +94,47 @@
}
 
/**
+* Checks alternate usernames of the form $username~wiki in the 
post-SUL finalization
+* era.  This is a temporary function and should be removed at some 
point in the
+* future after an appropriate period.
+*
+* @param $username String: username.
+* @param $password String: user password.
+* @return bool
+* @public
+*/
+   function authenticateAlternate( $username, $password ) {
+   global $wgCentralAuthCheckForRenamedAccount;
+   if ( !$wgCentralAuthCheckForRenamedAccount ) {
+   return false;
+   }
+
+   $dbr = CentralAuthUser::getCentralSlaveDB();
+   $alternameNames = $dbr-select(
+   'globaluser',
+   array( 'gu_name' ),
+   array( 'gu_name LIKE ' . $dbr-addQuotes( $username . 
~% ) ),
+   __METHOD__
+   );
+
+   foreach ( $alternameNames as $an ) {
+   $alternateUsername = $an['gu_name'];
+   $central = new CentralAuthUser( $alternateUsername );
+
+   if ( $central-authenticate( $password ) == ok ) {
+   wfDebugLog(
+   'CentralAuth',
+   plugin: alternate authentication 
succeeded as '$alternateUsername'
+   );
+   $this-alternateUsername = $alternateUsername;
+   return true;
+   }
+   }
+
+   return false;
+   }
+
+   /**
 * Check if a user should authenticate locally if the global 
authentication fails.
 * If either this or strict() returns true, local authentication is not 
used.
 *
@@ -107,13 +161,22 @@
 * @return bool
 */
public function updateUser( $user ) {
+   global 

[MediaWiki-commits] [Gerrit] DO NOT SUBMIT: Block creation of clashing local accounts - change (mediawiki...CentralAuth)

2013-04-24 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: DO NOT SUBMIT: Block creation of clashing local accounts
..

DO NOT SUBMIT: Block creation of clashing local accounts

Blocks the creation of new local accounts with usernames that clash with
lcoal accounts on other wikis, but for which no gloabl account exists.

Change-Id: I79ba1445740f8d4b831088a09c9918b6f2b8f904
---
M CentralAuth.php
M CentralAuthHooks.php
2 files changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/86/60686/1

diff --git a/CentralAuth.php b/CentralAuth.php
index bfd06d9..ff105a8 100644
--- a/CentralAuth.php
+++ b/CentralAuth.php
@@ -148,6 +148,13 @@
 $wgCentralAuthReadOnly = false;
 
 /**
+ * Disallow the creation of new local accounts that clash with a local account
+ * on another wiki, even if there is no global account with that name.
+ * @var bool
+ */
+$wgCentralAuthAbortNewClashingLocal = false;
+
+/**
  * Initialization of the autoloaders, and special extension pages.
  */
 $caBase = __DIR__;
diff --git a/CentralAuthHooks.php b/CentralAuthHooks.php
index 3733186..14c7e72 100644
--- a/CentralAuthHooks.php
+++ b/CentralAuthHooks.php
@@ -105,8 +105,12 @@
 * @return bool
 */
static function onAbortNewAccount( $user, $abortError ) {
+   global $wgCentralAuthAbortNewClashingLocal;
$centralUser = CentralAuthUser::getInstance( $user );
-   if ( $centralUser-exists() ) {
+   if (
+   $centralUser-exists() ||
+   ( $wgCentralAuthAbortNewClashingLocal  count( 
$centralUser-queryUnattached() )  0 )
+   ) {
$abortError = wfMessage( 'centralauth-account-exists' 
)-text();
return false;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79ba1445740f8d4b831088a09c9918b6f2b8f904
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updates to migrateAccount. - change (mediawiki...CentralAuth)

2013-04-22 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updates to migrateAccount.
..

Updates to migrateAccount.

Adding the ability to attach matching local accounts to a global account,
the abilty to merge a number of local accounts if the email addresses
match and are confirmed, and also some preparation for the next steps.

Change-Id: I71ee8b635051b8c7a7176bbba1b5a30d27ffea98
---
M maintenance/migrateAccount.php
1 file changed, 71 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/05/60305/1

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
index 5041e97..aea2001 100644
--- a/maintenance/migrateAccount.php
+++ b/maintenance/migrateAccount.php
@@ -26,6 +26,7 @@
$this-addOption( 'userlist', 'List of usernames to migrate', 
false, true );
$this-addOption( 'username', 'The user name to migrate', 
false, true, 'u' );
$this-addOption( 'safe', 'Only migrates accounts with one 
instance of the username across all wikis', false, false );
+   $this-addOption( 'attachmissing', 'Attach matching local 
accounts to global account', false, false );
}
 
public function execute() {
@@ -73,46 +74,83 @@
$this-total++;
$this-output( CentralAuth account migration for:  . 
$username . \n);
 
-   $globalusers = $this-dbBackground-select(
-   'globaluser',
-   array( 'gu_name' ),
-   array( 'gu_name' = $username ),
-   __METHOD__
-   );
+   $central = new CentralAuthUser( $username );
 
-   if ( $globalusers-numRows()  0 ) {
-   $this-output( ERROR: A global account already exists 
for: $username\n );
-   return false;
-   }
-
-   $localusers = $this-dbBackground-select(
-   'localnames',
-   array( 'ln_name', 'ln_wiki' ),
-   array( 'ln_name' = $username ),
-   __METHOD__
-   );
-
-   if ( $localusers-numRows() == 0 ) {
-   $this-output( ERROR: No local accounts found for: 
$username\n );
-   return false;
-   }
-
-   if ( $this-safe ) {
-   if ( $localusers-numRows() !== 1 ) {
-   $this-output( ERROR: More than 1 local user 
account found for username: $username\n );
-   foreach( $localusers as $row ) {
-   $this-output( \t . $row-ln_name . 
@ . $row-ln_wiki . \n );
+   /**
+* Migration with an existing global account
+*/
+   if ( $central-exists() ) {
+   if (
+   $this-getOption( 'attachmissing', false )
+!is_null( 
$central-getEmailAuthenticationTimestamp() )
+   ){
+   $unattached = $central-queryUnattached();
+   foreach ( $unattached as $wiki = $local ) {
+   if (
+   $central-getEmail() == 
$local['email']
+!is_null( 
$local['emailAuthenticated'] )
+   ){
+   $this-output( ATTACHING: 
$username@$wiki\n );
+   $central-attach( $wiki, 'mail' 
);
+   $this-migrated++;
+   }
}
+   return true;
+   } else {
+   $this-output( ERROR: A global account already 
exists for: $username\n );
return false;
}
}
+   /**
+* Migration without an existing global account
+*/
+   else {
+   $unattached = $central-queryUnattached();
 
-   $central = new CentralAuthUser( $username );
-   if ( $central-storeAndMigrate() ) {
-   $this-migrated++;
-   return true;
+   if ( count( $unattached ) == 0 ) {
+   $this-output( ERROR: No local accounts found 
for: $username\n );
+   return false;
+   }
+
+   if ( $this-safe ) {
+   if ( count( $unattached ) !== 1 ) {
+   

[MediaWiki-commits] [Gerrit] Updates to migrateAccount.php for performance. - change (mediawiki...CentralAuth)

2013-04-16 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updates to migrateAccount.php for performance.
..

Updates to migrateAccount.php for performance.

Adding the option to pass a list of usernames with each username on
a new line to prevent having to initialise an instance of MW for each
username that we are migrating in hopes that this is the cause of the
script being so slow.

Also adding a wfWaitForSlaves() call since we have a good opportunity
to do so.

Change-Id: I382d5501fa1cf209b26db5a52b45b6d04c7f3c65
---
M maintenance/migrateAccount.php
1 file changed, 75 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/78/59378/1

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
index 5b82781..7171eda 100644
--- a/maintenance/migrateAccount.php
+++ b/maintenance/migrateAccount.php
@@ -14,76 +14,105 @@
$this-start = microtime( true );
$this-migrated = 0;
$this-total = 0;
-   $this-username = '';
$this-safe = false;
+   $this-dbBackground = null;
 
-   $this-addOption( 'username', 'The user name to migrate', true, 
true, 'u' );
+   $this-addOption( 'userlist', 'List of usernames to migrate', 
false, true );
+   $this-addOption( 'username', 'The user name to migrate', 
false, true, 'u' );
$this-addOption( 'safe', 'Only migrates accounts with one 
instance of the username across all wikis', false, false );
}
 
public function execute() {
-   $this-username = $this-getOption( 'username' );
-   $this-safe = $this-getOption( 'safe' );
 
-   $this-output( CentralAuth account migration for:  . 
$this-username . \n);
+   $this-dbBackground = CentralAuthUser::getCentralSlaveDB();
 
-   $dbBackground = CentralAuthUser::getCentralSlaveDB();
+   // check to see if we are processing a single username
+   if ( $this-getOption( 'username', false ) !== false ) {
+   $username = $this-getOption( 'username' );
+   $this-migrate( $username );
 
-   $globalusers = $dbBackground-select(
-   'globaluser',
-   array( 'gu_name' ),
-   array( 'gu_name' = $this-username ),
-   __METHOD__
-   );
-
-   if ( $globalusers-numRows()  0 ) {
-   $this-output( ERROR: A global account already exists 
for: $this-username\n );
-   exit( 1 );
}
-
-   $localusers = $dbBackground-select(
-   'localnames',
-   array( 'ln_name', 'ln_wiki' ),
-   array( 'ln_name' = $this-username ),
-   __METHOD__
-   );
-
-   if ( $localusers-numRows() == 0 ) {
-   $this-output( ERROR: No local accounts found for: 
$this-username\n );
-   exit( 1 );
-   }
-
-   if ( $this-safe ) {
-   if ( $localusers-numRows() !== 1 ) {
-   $this-output( ERROR: More than 1 local user 
account found for username: $this-username\n );
-   foreach( $localusers as $row ) {
-   $this-output( \t . $row-ln_name . 
@ . $row-ln_wiki . \n );
-   }
-   $this-output( ABORTING\n );
+   elseif ( $this-getOption( 'userlist', false ) !== false ) {
+   $list = $this-getOption( 'userlist' );
+   if ( !is_file( $list ) ) {
+   $this-output( ERROR - File not found: $list 
);
exit( 1 );
}
-   }
-
-   $this-total++;
-
-   $central = new CentralAuthUser( $this-username );
-   if ( $central-storeAndMigrate() ) {
-   $this-migrated++;
+   $file = fopen( $list, 'r' );
+   if ( $file === false ) {
+   $this-output( ERROR - Could not open file: 
$list );
+   exit( 1 );
+   }
+   while( $username = fgets( $file ) ) {
+   $username = trim( $username ); // trim the \n
+   $this-migrate( $username );
+   }
+   fclose( $file );
}
 
$this-migratePassOneReport();
$this-output( done.\n );
+
+   echo Waiting for slaves to catch up ... 

[MediaWiki-commits] [Gerrit] Updating CentralAuth / Special:MigrateAccount - change (mediawiki/core)

2013-04-16 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating CentralAuth / Special:MigrateAccount
..

Updating CentralAuth / Special:MigrateAccount

Change-Id: I0bed9de9b98d171718bf4f81d1e7e5f183dda150
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/59456/1

diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index f7ee775..e2ac150 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit f7ee775a29b65761b0b8d38ea328a63e8adfe48d
+Subproject commit e2ac1507d5fa40ea1dca1cfb5aff2569a368858f

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bed9de9b98d171718bf4f81d1e7e5f183dda150
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf1
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth / Special:MigrateAccount - change (mediawiki/core)

2013-04-16 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Updating CentralAuth / Special:MigrateAccount
..


Updating CentralAuth / Special:MigrateAccount

Change-Id: I0bed9de9b98d171718bf4f81d1e7e5f183dda150
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index f7ee775..e2ac150 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit f7ee775a29b65761b0b8d38ea328a63e8adfe48d
+Subproject commit e2ac1507d5fa40ea1dca1cfb5aff2569a368858f

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0bed9de9b98d171718bf4f81d1e7e5f183dda150
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf1
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth / Special:MigrateAccount - change (mediawiki/core)

2013-04-16 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating CentralAuth / Special:MigrateAccount
..

Updating CentralAuth / Special:MigrateAccount

Change-Id: I3bff42ff53105a5d3aa609a270b2d9c89acde503
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/60/59460/1

diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index c3db5c8..e2ac150 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit c3db5c8e93e46fa5024730e5e53878a947594f77
+Subproject commit e2ac1507d5fa40ea1dca1cfb5aff2569a368858f

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3bff42ff53105a5d3aa609a270b2d9c89acde503
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf2
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth / Special:MigrateAccount - change (mediawiki/core)

2013-04-16 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Updating CentralAuth / Special:MigrateAccount
..


Updating CentralAuth / Special:MigrateAccount

Change-Id: I3bff42ff53105a5d3aa609a270b2d9c89acde503
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index c3db5c8..e2ac150 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit c3db5c8e93e46fa5024730e5e53878a947594f77
+Subproject commit e2ac1507d5fa40ea1dca1cfb5aff2569a368858f

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3bff42ff53105a5d3aa609a270b2d9c89acde503
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf2
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding username to the header line for better error grepping. - change (mediawiki...CentralAuth)

2013-04-11 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding username to the header line for better error grepping.
..

Adding username to the header line for better error grepping.

Change-Id: Ie6cabd3f351dd0b6d9d38695b35d3a361ac8385e
---
M maintenance/migrateAccount.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/34/58834/1

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
index 38b7821..5b82781 100644
--- a/maintenance/migrateAccount.php
+++ b/maintenance/migrateAccount.php
@@ -55,7 +55,7 @@
 
if ( $this-safe ) {
if ( $localusers-numRows() !== 1 ) {
-   $this-output( ERROR: More than 1 local user 
account found for username:\n );
+   $this-output( ERROR: More than 1 local user 
account found for username: $this-username\n );
foreach( $localusers as $row ) {
$this-output( \t . $row-ln_name . 
@ . $row-ln_wiki . \n );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6cabd3f351dd0b6d9d38695b35d3a361ac8385e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralNotice to deploy branch - change (mediawiki/core)

2013-04-11 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating CentralNotice to deploy branch
..

Updating CentralNotice to deploy branch

Change-Id: Id4fb03125a7a83c4823edbcda200948a34969e6c
---
M extensions/CentralNotice
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/58836/1

diff --git a/extensions/CentralNotice b/extensions/CentralNotice
index 68f0262..05ef61a 16
--- a/extensions/CentralNotice
+++ b/extensions/CentralNotice
-Subproject commit 68f0262be838320ecc9c87eb4485c28b0699bc1f
+Subproject commit 05ef61a0899948939bcd71016e1dcd56b0037b40

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4fb03125a7a83c4823edbcda200948a34969e6c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf1
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralNotice to deploy branch - change (mediawiki/core)

2013-04-11 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating CentralNotice to deploy branch
..

Updating CentralNotice to deploy branch

Change-Id: I35942f864f1f644db2ba1234da87ebaa493a9f2b
---
M extensions/CentralNotice
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/58837/1

diff --git a/extensions/CentralNotice b/extensions/CentralNotice
index 83ccc83..05ef61a 16
--- a/extensions/CentralNotice
+++ b/extensions/CentralNotice
-Subproject commit 83ccc83332195d1619b2442831ee15e672d25130
+Subproject commit 05ef61a0899948939bcd71016e1dcd56b0037b40

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35942f864f1f644db2ba1234da87ebaa493a9f2b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf12
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth maintenance script - change (mediawiki/core)

2013-04-11 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating CentralAuth maintenance script
..

Updating CentralAuth maintenance script

Change-Id: Ia50a7a5a4f1e9a1d1c01105cfd85de99fff005ea
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/58838/1

diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index e33044c..f7ee775 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit e33044cc0bc14a3033b04cded22763e16124012c
+Subproject commit f7ee775a29b65761b0b8d38ea328a63e8adfe48d

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia50a7a5a4f1e9a1d1c01105cfd85de99fff005ea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf1
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding more verbose handling to the --safe option. - change (mediawiki...CentralAuth)

2013-04-10 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding more verbose handling to the --safe option.
..

Adding more verbose handling to the --safe option.

It will now list the multiple accounts that it found and that cause
--safe to fail.

Change-Id: Idd2f8b685782d8c8a8220f1aa342c0b2807fd017
---
M maintenance/migrateAccount.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/44/58544/1

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
index f2505bb..55f75f7 100644
--- a/maintenance/migrateAccount.php
+++ b/maintenance/migrateAccount.php
@@ -34,7 +34,10 @@
__METHOD__ );
 
if ( $result-numRows() !== 1 ) {
-   $this-output( ERROR: More than 1 user account 
found for username.\n );
+   $this-output( ERROR: More than 1 user account 
found for username:\n );
+   foreach( $result as $row ) {
+   $this-output( \t . $row-ln_name . 
@ . $row-ln_wiki . \n );
+   }
$this-output( ABORTING\n );
exit(1);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd2f8b685782d8c8a8220f1aa342c0b2807fd017
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] More verbose logging and checking for migrateAccount. - change (mediawiki...CentralAuth)

2013-04-10 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: More verbose logging and checking for migrateAccount.
..

More verbose logging and checking for migrateAccount.

Change-Id: Idf09768908e9dacf9cd1830862830d9c6589e29c
---
M maintenance/migrateAccount.php
1 file changed, 32 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/20/58620/1

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
index 55f75f7..38b7821 100644
--- a/maintenance/migrateAccount.php
+++ b/maintenance/migrateAccount.php
@@ -25,26 +25,44 @@
$this-username = $this-getOption( 'username' );
$this-safe = $this-getOption( 'safe' );
 
-   if ( $this-safe ) {
-   $dbBackground = CentralAuthUser::getCentralSlaveDB();
-   $result = $dbBackground-select(
-   'localnames',
-   array( 'ln_wiki' ),
-   array( 'ln_name' = $this-username ),
-   __METHOD__ );
+   $this-output( CentralAuth account migration for:  . 
$this-username . \n);
 
-   if ( $result-numRows() !== 1 ) {
-   $this-output( ERROR: More than 1 user account 
found for username:\n );
-   foreach( $result as $row ) {
+   $dbBackground = CentralAuthUser::getCentralSlaveDB();
+
+   $globalusers = $dbBackground-select(
+   'globaluser',
+   array( 'gu_name' ),
+   array( 'gu_name' = $this-username ),
+   __METHOD__
+   );
+
+   if ( $globalusers-numRows()  0 ) {
+   $this-output( ERROR: A global account already exists 
for: $this-username\n );
+   exit( 1 );
+   }
+
+   $localusers = $dbBackground-select(
+   'localnames',
+   array( 'ln_name', 'ln_wiki' ),
+   array( 'ln_name' = $this-username ),
+   __METHOD__
+   );
+
+   if ( $localusers-numRows() == 0 ) {
+   $this-output( ERROR: No local accounts found for: 
$this-username\n );
+   exit( 1 );
+   }
+
+   if ( $this-safe ) {
+   if ( $localusers-numRows() !== 1 ) {
+   $this-output( ERROR: More than 1 local user 
account found for username:\n );
+   foreach( $localusers as $row ) {
$this-output( \t . $row-ln_name . 
@ . $row-ln_wiki . \n );
}
$this-output( ABORTING\n );
-   exit(1);
-
+   exit( 1 );
}
}
-
-   $this-output( CentralAuth account migration for:  . 
$this-username );
 
$this-total++;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf09768908e9dacf9cd1830862830d9c6589e29c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth to master, updating maintenance/migrate... - change (mediawiki/core)

2013-04-10 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating CentralAuth to master, updating 
maintenance/migrateAccount.php
..

Updating CentralAuth to master, updating maintenance/migrateAccount.php

Change-Id: I0f3a5290b14fc70c62cdabfd44966be0b3959e5f
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/58628/1

diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index 3b506ca..e33044c 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit 3b506cab7410978c65e213be39e6ab8466d669a0
+Subproject commit e33044cc0bc14a3033b04cded22763e16124012c

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f3a5290b14fc70c62cdabfd44966be0b3959e5f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf1
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth to master, updating maintenance/migrate... - change (mediawiki/core)

2013-04-10 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Updating CentralAuth to master, updating 
maintenance/migrateAccount.php
..


Updating CentralAuth to master, updating maintenance/migrateAccount.php

Change-Id: I0f3a5290b14fc70c62cdabfd44966be0b3959e5f
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index 3b506ca..e33044c 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit 3b506cab7410978c65e213be39e6ab8466d669a0
+Subproject commit e33044cc0bc14a3033b04cded22763e16124012c

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f3a5290b14fc70c62cdabfd44966be0b3959e5f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf1
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding functions to User.php to upgrade password storage on ... - change (mediawiki/core)

2013-03-26 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding functions to User.php to upgrade password storage on 
login.
..

Adding functions to User.php to upgrade password storage on login.

Change-Id: If5ca00a19180ca034edb8f9a04efb6469de07d0a
---
A LocalSettings_old.php
M includes/User.php
2 files changed, 147 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/79/56079/1

diff --git a/LocalSettings_old.php b/LocalSettings_old.php
new file mode 100644
index 000..d4078c0
--- /dev/null
+++ b/LocalSettings_old.php
@@ -0,0 +1,135 @@
+?php
+# This file was automatically generated by the MediaWiki 1.21alpha
+# installer. If you make manual changes, please keep track in case you
+# need to recreate them later.
+#
+# See includes/DefaultSettings.php for all configurable settings
+# and their default values, but don't forget to make changes in _this_
+# file, not there.
+#
+# Further documentation for configuration settings may be found at:
+# http://www.mediawiki.org/wiki/Manual:Configuration_settings
+
+# Protect against web entry
+if ( !defined( 'MEDIAWIKI' ) ) {
+   exit;
+}
+
+## Uncomment this to disable output compression
+# $wgDisableOutputCompression = true;
+
+$wgSitename  = Dev Wiki;
+$wgMetaNamespace = Dev_Wiki;
+
+## The URL base path to the directory containing the wiki;
+## defaults for all runtime URL paths are based off of this.
+## For more information on customizing the URLs
+## (like /w/index.php/Page_title to /wiki/Page_title) please see:
+## http://www.mediawiki.org/wiki/Manual:Short_URL
+$wgScriptPath   = ;
+$wgScriptExtension  = .php;
+
+## The protocol and server name to use in fully-qualified URLs
+$wgServer   = http://core.local;;
+
+## The relative URL path to the skins directory
+$wgStylePath= $wgScriptPath/skins;
+
+## The relative URL path to the logo.  Make sure you change this from the 
default,
+## or else you'll overwrite your logo when you upgrade!
+$wgLogo = $wgStylePath/common/images/wiki.png;
+
+## UPO means: this is also a user preference option
+
+$wgEnableEmail  = true;
+$wgEnableUserEmail  = true; # UPO
+
+$wgEmergencyContact = apa...@mediawiki.dev.local;
+$wgPasswordSender   = apa...@mediawiki.dev.local;
+
+$wgEnotifUserTalk  = false; # UPO
+$wgEnotifWatchlist = false; # UPO
+$wgEmailAuthentication = true;
+
+## Database settings
+$wgDBtype   = mysql;
+$wgDBserver = localhost;
+$wgDBname   = core_mediawiki;
+$wgDBuser   = mediawiki;
+$wgDBpassword   = wikiwiki123;
+
+# MySQL specific settings
+$wgDBprefix = ;
+
+# MySQL table options to use during installation or update
+$wgDBTableOptions   = ENGINE=InnoDB, DEFAULT CHARSET=utf8;
+
+# Experimental charset support for MySQL 5.0.
+$wgDBmysql5 = false;
+
+## Shared memory settings
+$wgMainCacheType= CACHE_NONE;
+$wgMemCachedServers = array();
+
+## To enable image uploads, make sure the 'images' directory
+## is writable, then set this to true:
+$wgEnableUploads  = true;
+$wgUseImageMagick = true;
+$wgImageMagickConvertCommand = /usr/bin/convert;
+
+# InstantCommons allows wiki to use images from http://commons.wikimedia.org
+$wgUseInstantCommons  = false;
+
+## If you use ImageMagick (or any other shell command) on a
+## Linux server, this will need to be set to the name of an
+## available UTF-8 locale
+$wgShellLocale = en_US.utf8;
+
+## If you want to use image uploads under safe mode,
+## create the directories images/archive, images/thumb and
+## images/temp, and make them all writable. Then uncomment
+## this, if it's not already uncommented:
+#$wgHashedUploadDirectory = false;
+
+## Set $wgCacheDirectory to a writable directory on the web server
+## to make your wiki go slightly faster. The directory should not
+## be publically accessible from the web.
+#$wgCacheDirectory = $IP/cache;
+
+# Site language code, should be one of the list in ./languages/Names.php
+$wgLanguageCode = en;
+
+$wgSecretKey = 
300917f9eb53e46e39a1d64ee881a7bb213eaeea1b8c529cb0ebc7f3c8069e62;
+
+# Site upgrade key. Must be set to a string (default provided) to turn on the
+# web installer while LocalSettings.php is in place
+$wgUpgradeKey = 24ed725adca38a1b;
+
+## Default skin: you can change the default skin. Use the internal symbolic
+## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
+$wgDefaultSkin = vector;
+
+## For attaching licensing metadata to pages, and displaying an
+## appropriate copyright notice / icon. GNU Free Documentation
+## License and Creative Commons licenses are supported so far.
+$wgRightsPage = ; # Set to the title of a wiki page that describes your 
license/copyright
+$wgRightsUrl  = ;
+$wgRightsText = ;
+$wgRightsIcon = ;
+
+# Path to the GNU diff3 utility. Used for conflict resolution.
+$wgDiff3 = /usr/bin/diff3;
+
+# 

[MediaWiki-commits] [Gerrit] Moving 2011 script. - change (wikimedia...civicrm)

2013-03-22 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Moving 2011 script.
..

Moving 2011 script.

Change-Id: Ie6e0be82b8dba5f8ec289ac7aa4965af502d21ab
---
R sites/all/modules/thank_you/make_thank_you_2011.php
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm 
refs/changes/79/55279/1

diff --git a/sites/all/modules/thank_you/make_thank_you.php 
b/sites/all/modules/thank_you/make_thank_you_2011.php
similarity index 100%
rename from sites/all/modules/thank_you/make_thank_you.php
rename to sites/all/modules/thank_you/make_thank_you_2011.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6e0be82b8dba5f8ec289ac7aa4965af502d21ab
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/civicrm
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] New TY generation script for 2012 TY email - change (wikimedia...civicrm)

2013-03-22 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: New TY generation script for 2012 TY email
..

New TY generation script for 2012 TY email

Change-Id: I39b8abd693ae2afe5a1d6f311f8c462890e8b350
---
A sites/all/modules/thank_you/make_thank_you.php
1 file changed, 309 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm 
refs/changes/81/55281/1

diff --git a/sites/all/modules/thank_you/make_thank_you.php 
b/sites/all/modules/thank_you/make_thank_you.php
new file mode 100644
index 000..bdc7d8b
--- /dev/null
+++ b/sites/all/modules/thank_you/make_thank_you.php
@@ -0,0 +1,309 @@
+?php
+
+/**
+ * NOTE: THIS FILE SHOULD NOT BE RUN IN PRODUCTION*
+ **
+ * To generate templates, run php make_thank_you.php on your local  *
+ * machine.  Version control will let you know what changes, if any,  *
+ * were made to existing templates and what templates are new.  After *
+ * review, commit the templates to the repository and then pull those *
+ * into production.   *
+ **
+ * It is HIGHLY recommended that you send test Thank You emails for a *
+ * translation before commit them to the repository.  *
+ **
+ **/
+
+$valid_translation_states = array(
+   'ready',
+   'proofread',
+   'translated', // what exactly is this state?
+);
+
+/**
+ * This function builds a valid URL by joining the base URL with a
+ * valid query string that is generated from the passed key, value pairs.
+ *
+ * @param $base_url string the base URL
+ * @param $params array an array of key/value pairs for the querystring
+ * @return string the resulting URL
+ */
+function build_query( $base_url, $params ){
+   $url = $base_url . '?';
+
+   foreach( $params as $p = $v ){
+   $url .= $p . '=';
+   if( is_array( $v ) ){
+   $v = implode( '|', $v );
+   }
+   $url .= $v . '';
+   }
+   $url = rtrim( $url, '' );
+
+   return $url;
+}
+
+/**
+ * TODO: document
+ *
+ * @param $title string The title of the page to be retrieved
+ * @param $lang string The language of the page to be retrieved
+ * @return array json array with the translations for the given language
+ */
+function get_translation( $title, $lang ){
+
+   $base_url = https://meta.wikimedia.org/w/api.php;;
+   $params = array(
+   'action' = 'query',
+   'list' = 'messagecollection',
+   'mcgroup' = $title,
+   'mclanguage' = $lang,
+   'mcprop' = 'translation|properties',
+   'format' = 'json'
+   );
+
+   $url = build_query( $base_url, $params );
+
+   $c = curl_init( $url );
+   curl_setopt_array( $c, array(
+   CURLOPT_HEADER = FALSE,
+   CURLOPT_RETURNTRANSFER = TRUE,
+   CURLOPT_USERAGENT = PHP/cURL - WMF Fundraising Translation 
Grabber - fr-t...@wikimedia.org
+   ));
+
+   $r = curl_exec( $c );
+   curl_close( $c );
+
+   $j = json_decode( $r, true );
+
+   return $j;
+}
+
+/**
+ * Checks the json array to see if all translations are present and that all
+ * translations meet the minimum status level for publication
+ *
+ * @param $json array containing the translations for a given language
+ * @return boolean
+ */
+function check_translation( $json ){
+   global $valid_translation_states;
+
+   // check for the essential elements
+   if( !array_key_exists( 'query', $json ) ||
+   !array_key_exists( 'messagecollection', $json['query'] ) ||
+   !array_key_exists( 'metadata', $json['query'] ) ||
+   !array_key_exists( 'resultsize', $json['query']['metadata'] )
+   ){
+   print Missing required fields in JSON.\n;
+   return false;
+   }
+   // this number is arbitrary to 2012's letter
+   if( $json['query']['metadata']['resultsize'] != 24 ){
+   print Incorrect number of translated elements. Expected 24, 
got  . $json['query']['metadata']['resultsize'] . \n;
+   return false;
+   }
+
+   foreach( $json['query']['messagecollection'] as $message ){
+   // check for required keys
+   if( !array_key_exists( 'key', $message ) ||
+   !array_key_exists( 'translation', $message ) ||
+   !array_key_exists( 'properties', $message ) ||
+   !array_key_exists( 

[MediaWiki-commits] [Gerrit] Adding html2tet library for creating plaintext emails - change (wikimedia...civicrm)

2013-03-22 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding html2tet library for creating plaintext emails
..

Adding html2tet library for creating plaintext emails

Change-Id: I96e72411a2f8e0687fb099545ff6215b35360445
---
A sites/all/modules/thank_you/html2text.php
1 file changed, 487 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm 
refs/changes/91/55291/1

diff --git a/sites/all/modules/thank_you/html2text.php 
b/sites/all/modules/thank_you/html2text.php
new file mode 100644
index 000..ed46373
--- /dev/null
+++ b/sites/all/modules/thank_you/html2text.php
@@ -0,0 +1,487 @@
+?php
+
+/*
+ *   *
+ * class.html2text.inc   *
+ *   *
+ *
+ *   *
+ * Converts HTML to formatted plain text *
+ *   *
+ * Copyright (c) 2005-2007 Jon Abernathy j...@chuggnutt.com *
+ * All rights reserved.  *
+ *   *
+ * This script is free software; you can redistribute it and/or modify   *
+ * it under the terms of the GNU General Public License as published by  *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version.   *
+ *   *
+ * The GNU General Public License can be found at*
+ * http://www.gnu.org/copyleft/gpl.html. *
+ *   *
+ * This script is distributed in the hope that it will be useful,*
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of*
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  *
+ * GNU General Public License for more details.  *
+ *   *
+ * Author(s): Jon Abernathy j...@chuggnutt.com  *
+ *   *
+ * Last modified: 08/08/07   *
+ *   *
+ */
+
+
+/**
+ *  Takes HTML and converts it to formatted, plain text.
+ *
+ *  Thanks to Alexander Krug (http://www.krugar.de/) to pointing out and
+ *  correcting an error in the regexp search array. Fixed 7/30/03.
+ *
+ *  Updated set_html() function's file reading mechanism, 9/25/03.
+ *
+ *  Thanks to Joss Sanglier (http://www.dancingbear.co.uk/) for adding
+ *  several more HTML entity codes to the $search and $replace arrays.
+ *  Updated 11/7/03.
+ *
+ *  Thanks to Darius Kasperavicius (http://www.dar.dar.lt/) for
+ *  suggesting the addition of $allowed_tags and its supporting function
+ *  (which I slightly modified). Updated 3/12/04.
+ *
+ *  Thanks to Justin Dearing for pointing out that a replacement for the
+ *  TH tag was missing, and suggesting an appropriate fix.
+ *  Updated 8/25/04.
+ *
+ *  Thanks to Mathieu Collas (http://www.myefarm.com/) for finding a
+ *  display/formatting bug in the _build_link_list() function: email
+ *  readers would show the left bracket and number ([1) as part of the
+ *  rendered email address.
+ *  Updated 12/16/04.
+ *
+ *  Thanks to Wojciech Bajon (http://histeria.pl/) for submitting code
+ *  to handle relative links, which I hadn't considered. I modified his
+ *  code a bit to handle normal HTTP links and MAILTO links. Also for
+ *  suggesting three additional HTML entity codes to search for.
+ *  Updated 03/02/05.
+ *
+ *  Thanks to Jacob Chandler for pointing out another link condition
+ *  for the _build_link_list() function: https.
+ *  Updated 04/06/05.
+ *
+ *  Thanks to Marc Bertrand (http://www.dresdensky.com/) for
+ *  suggesting a revision to the word wrapping functionality; if you
+ *  specify a $width of 0 or less, word wrapping will be ignored.
+ *  Updated 11/02/06.
+ *
+ *  *** Big housecleaning updates below:
+ *
+ *  Thanks to Colin Brown (http://www.sparkdriver.co.uk/) for
+ *  suggesting the fix to handle /li and blank lines (whitespace).
+ *  Christian Basedau (http://www.movetheweb.de/) also suggested the
+ *  blank lines 

[MediaWiki-commits] [Gerrit] A few little modifications to the original html2text for our... - change (wikimedia...civicrm)

2013-03-22 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: A few little modifications to the original html2text for our 
use cases
..

A few little modifications to the original html2text for our use cases

Change-Id: I50ed561270348143df0ed661d6b131f191bd5496
---
M sites/all/modules/thank_you/html2text.php
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm 
refs/changes/92/55292/1

diff --git a/sites/all/modules/thank_you/html2text.php 
b/sites/all/modules/thank_you/html2text.php
index ed46373..4460254 100644
--- a/sites/all/modules/thank_you/html2text.php
+++ b/sites/all/modules/thank_you/html2text.php
@@ -430,16 +430,16 @@
$text = preg_replace(/\n\s+\n/, \n\n, $text);
$text = preg_replace(/[\n]{3,}/, \n\n, $text);
 
-   // Add link list
-   if ( !empty($this-_link_list) ) {
-   $text .= \n\nLinks:\n--\n . $this-_link_list;
-   }
-
// Wrap the text to a readable format
// for PHP versions = 4.0.2. Default width is 75
// If width is 0 or less, don't wrap the text.
if ( $this-width  0 ) {
$text = wordwrap($text, $this-width);
+   }
+
+   // Add link list
+   if ( !empty($this-_link_list) ) {
+   $text .= \n\nLinks:\n--\n . $this-_link_list;
}
 
$this-text = $text;
@@ -474,7 +474,7 @@
} else {
$this-_link_count++;
$this-_link_list .= [ . $this-_link_count . ]  . 
$this-url;
-   if ( substr($link, 0, 1) != '/' ) {
+   if ( substr($link, 0, 1) != '/'  substr($link, 0, 2) 
!= '{{') {
$this-_link_list .= '/';
}
$this-_link_list .= $link\n;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50ed561270348143df0ed661d6b131f191bd5496
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/civicrm
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding support for html2text to the TY email generator. - change (wikimedia...civicrm)

2013-03-22 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding support for html2text to the TY email generator.
..

Adding support for html2text to the TY email generator.

Change-Id: Icdefadb7a1f6ce8e237c8680cfc3bfa89689d9e2
---
M sites/all/modules/thank_you/make_thank_you.php
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm 
refs/changes/93/55293/1

diff --git a/sites/all/modules/thank_you/make_thank_you.php 
b/sites/all/modules/thank_you/make_thank_you.php
index bdc7d8b..fc8a06f 100644
--- a/sites/all/modules/thank_you/make_thank_you.php
+++ b/sites/all/modules/thank_you/make_thank_you.php
@@ -14,6 +14,8 @@
  **
  **/
 
+require_once 'html2text.php';
+
 $valid_translation_states = array(
'ready',
'proofread',
@@ -280,6 +282,19 @@
 
 /**
  *
+ * @param $htmlfilename
+ * @param $outfilename
+ */
+function generate_txt_2012( $htmlfilename, $outfilename ) {
+
+   $html = new html2text( $htmlfilename, true );
+   $outfile = fopen( $outfilename, 'w' );
+   fwrite( $outfile, $html-get_text() );
+   fclose( $outfile );
+}
+
+/**
+ *
  */
 
 $titles = array(
@@ -302,6 +317,7 @@
if ( check_translation( $json ) ){
add_helper_keys( $json );
generate_html_2012( $l, $json, 
templates/html/thank_you.$l.html );
+   generate_txt_2012( templates/html/thank_you.$l.html, 
templates/txt/thank_you.$l.txt );
linewrap( templates/html/thank_you.$l.html, 90 );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdefadb7a1f6ce8e237c8680cfc3bfa89689d9e2
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/civicrm
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth to master. - change (mediawiki/core)

2013-03-20 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating CentralAuth to master.
..

Updating CentralAuth to master.

Change-Id: I9b711c8909d00537500bd013b17162a7fb729b2c
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/04/54904/1

diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index e855a4f..cff0119 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit e855a4fa66a13edc6ce56b92997db38ec98063a4
+Subproject commit cff01199aada53b61d43ab8bb907822a77652961

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b711c8909d00537500bd013b17162a7fb729b2c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf12
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth to master. - change (mediawiki/core)

2013-03-20 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating CentralAuth to master.
..

Updating CentralAuth to master.

Change-Id: Ia73f1ba616e42b3034f9d67c00ef6db370d77e81
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/54905/1

diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index 3cc3cb9..cff0119 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit 3cc3cb92cc83ee48b2b0dd1ab3a201a8ea461d83
+Subproject commit cff01199aada53b61d43ab8bb907822a77652961

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia73f1ba616e42b3034f9d67c00ef6db370d77e81
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf11
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth to master. - change (mediawiki/core)

2013-03-20 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Updating CentralAuth to master.
..


Updating CentralAuth to master.

Change-Id: I9b711c8909d00537500bd013b17162a7fb729b2c
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index e855a4f..cff0119 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit e855a4fa66a13edc6ce56b92997db38ec98063a4
+Subproject commit cff01199aada53b61d43ab8bb907822a77652961

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b711c8909d00537500bd013b17162a7fb729b2c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf12
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating CentralAuth to master. - change (mediawiki/core)

2013-03-20 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Updating CentralAuth to master.
..


Updating CentralAuth to master.

Change-Id: Ia73f1ba616e42b3034f9d67c00ef6db370d77e81
---
M extensions/CentralAuth
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/extensions/CentralAuth b/extensions/CentralAuth
index 3cc3cb9..cff0119 16
--- a/extensions/CentralAuth
+++ b/extensions/CentralAuth
-Subproject commit 3cc3cb92cc83ee48b2b0dd1ab3a201a8ea461d83
+Subproject commit cff01199aada53b61d43ab8bb907822a77652961

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia73f1ba616e42b3034f9d67c00ef6db370d77e81
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf11
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Fix wfWaitForSlaves() so the $wiki parameter actually works ... - change (mediawiki/core)

2013-03-20 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Fix wfWaitForSlaves() so the $wiki parameter actually works 
correctly
..

Fix wfWaitForSlaves() so the $wiki parameter actually works correctly

Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
---
M includes/GlobalFunctions.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/54973/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 99f5eb5..017ab7d 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3655,7 +3655,7 @@
// bug 27975 - Don't try to wait for slaves if there are none
// Prevents permission error when getting master position
if ( $lb-getServerCount()  1 ) {
-   $dbw = $lb-getConnection( DB_MASTER );
+   $dbw = $lb-getConnection( DB_MASTER, array(), $wiki );
$pos = $dbw-getMasterPos();
$lb-waitForAll( $pos );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix wfWaitForSlaves() so the $wiki parameter actually works ... - change (mediawiki/core)

2013-03-20 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Fix wfWaitForSlaves() so the $wiki parameter actually works 
correctly
..

Fix wfWaitForSlaves() so the $wiki parameter actually works correctly

Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
---
M includes/GlobalFunctions.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/81/54981/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 79a4920..c0b3e9f 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3694,7 +3694,7 @@
// bug 27975 - Don't try to wait for slaves if there are none
// Prevents permission error when getting master position
if ( $lb-getServerCount()  1 ) {
-   $dbw = $lb-getConnection( DB_MASTER );
+   $dbw = $lb-getConnection( DB_MASTER, array(), $wiki );
$pos = $dbw-getMasterPos();
$lb-waitForAll( $pos );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf11
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix wfWaitForSlaves() so the $wiki parameter actually works ... - change (mediawiki/core)

2013-03-20 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Fix wfWaitForSlaves() so the $wiki parameter actually works 
correctly
..

Fix wfWaitForSlaves() so the $wiki parameter actually works correctly

Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
---
M includes/GlobalFunctions.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/83/54983/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 016736f..e1e1234 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3655,7 +3655,7 @@
// bug 27975 - Don't try to wait for slaves if there are none
// Prevents permission error when getting master position
if ( $lb-getServerCount()  1 ) {
-   $dbw = $lb-getConnection( DB_MASTER );
+   $dbw = $lb-getConnection( DB_MASTER, array(), $wiki );
$pos = $dbw-getMasterPos();
$lb-waitForAll( $pos );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf12
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix wfWaitForSlaves() so the $wiki parameter actually works ... - change (mediawiki/core)

2013-03-20 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Fix wfWaitForSlaves() so the $wiki parameter actually works 
correctly
..


Fix wfWaitForSlaves() so the $wiki parameter actually works correctly

Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
---
M includes/GlobalFunctions.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 016736f..e1e1234 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3655,7 +3655,7 @@
// bug 27975 - Don't try to wait for slaves if there are none
// Prevents permission error when getting master position
if ( $lb-getServerCount()  1 ) {
-   $dbw = $lb-getConnection( DB_MASTER );
+   $dbw = $lb-getConnection( DB_MASTER, array(), $wiki );
$pos = $dbw-getMasterPos();
$lb-waitForAll( $pos );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf12
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix wfWaitForSlaves() so the $wiki parameter actually works ... - change (mediawiki/core)

2013-03-20 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Fix wfWaitForSlaves() so the $wiki parameter actually works 
correctly
..


Fix wfWaitForSlaves() so the $wiki parameter actually works correctly

Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
---
M includes/GlobalFunctions.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 79a4920..c0b3e9f 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3694,7 +3694,7 @@
// bug 27975 - Don't try to wait for slaves if there are none
// Prevents permission error when getting master position
if ( $lb-getServerCount()  1 ) {
-   $dbw = $lb-getConnection( DB_MASTER );
+   $dbw = $lb-getConnection( DB_MASTER, array(), $wiki );
$pos = $dbw-getMasterPos();
$lb-waitForAll( $pos );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1f3da5921f2d724e10c448700ea8b958ff159451
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf11
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding wfWaitForSlaves before we melt the centralauth cluster. - change (mediawiki...CentralAuth)

2013-03-19 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding wfWaitForSlaves before we melt the centralauth cluster.
..

Adding wfWaitForSlaves before we melt the centralauth cluster.

Also fixing OBO error and increasing chunk size.

Change-Id: Idac8c11142f0e64acf088aa4037d00f6b7eecbbc
---
M maintenance/migratePass0.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/06/54806/1

diff --git a/maintenance/migratePass0.php b/maintenance/migratePass0.php
index 909130d..601533d 100644
--- a/maintenance/migratePass0.php
+++ b/maintenance/migratePass0.php
@@ -16,7 +16,7 @@
 function migratePassZero() {
global $wgDBname;
$dbr = wfGetDB( DB_SLAVE );
-   $chunkSize = 1000;
+   $chunkSize = 1;
 
$start = microtime( true );
$migrated = 0;
@@ -27,7 +27,7 @@
 
$lastUser = $dbr-selectField( 'user', 'MAX(user_id)', '', __FUNCTION__ 
);
for ( $min = 0; $min = $lastUser; $min += $chunkSize ) {
-   $max = $min + $chunkSize;
+   $max = $min + $chunkSize - 1;
$result = $dbr-select( 'user',
array( 'user_id', 'user_name' ),
user_id BETWEEN $min AND $max,
@@ -48,6 +48,10 @@
min( $max, $lastUser ) / $lastUser * 100.0,
$delta,
$rate );
+
+   echo Waiting for slaves to catch up ... ;
+   wfWaitForSlaves( false, 'centralauth' );
+   echo done\n;
}
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idac8c11142f0e64acf088aa4037d00f6b7eecbbc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding maintenance class for migrating a single account from... - change (mediawiki...CentralAuth)

2013-03-18 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding maintenance class for migrating a single account from 
local to global.
..

Adding maintenance class for migrating a single account from local to global.

Change-Id: I6f91c697706a5e4feba2125773c6c3c259a6e29e
---
A maintenance/migrateAccount.php
1 file changed, 69 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/93/54593/1

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
new file mode 100644
index 000..f2f2021
--- /dev/null
+++ b/maintenance/migrateAccount.php
@@ -0,0 +1,69 @@
+?php
+
+if ( getenv( 'MW_INSTALL_PATH' ) ) {
+   $IP = getenv( 'MW_INSTALL_PATH' );
+} else {
+   $IP = __DIR__ . '/../../..';
+}
+require_once( $IP/maintenance/Maintenance.php );
+
+class MigrateAccount extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+   $this-mDescription = Migrates the specified local account to 
a global account;
+   $this-start = microtime( true );
+   $this-migrated = 0;
+   $this-total = 0;
+   $this-username = '';
+   $this-safe = false;
+
+   $this-addOption( 'username', 'The user name to migrate', true, 
true, 'u' );
+   $this-addOption( 'safe', 'Only migrates accounts with one 
instance of the username across all wikis', false, false );
+   }
+
+   public function execute() {
+   $this-username = $this-getOption( 'username' );
+   $this-safe = $this-getOption( 'safe' );
+
+   if ( $this-safe ) {
+   $dbBackground = CentralAuthUser::getCentralSlaveDB();
+   $result = $dbBackground-select(
+   'localnames',
+   array( 'ln_wiki' ),
+   array( 'ln_name' = $this-username ),
+   __METHOD__ );
+
+   if ( $result-numRows() !== 1 ) {
+   $this-output( ERROR: More than 1 user account 
found for username.\n );
+   $this-output( ABORTING\n );
+   exit(1);
+
+   }
+   }
+
+   $this-output( CentralAuth account migration for:  . 
$this-username );
+
+   $central = new CentralAuthUser( $this-username );
+   if ( $central-storeAndMigrate() ) {
+   $this-migrated++;
+   }
+
+   $this-migratePassOneReport();
+   $this-output( done.\n );
+   }
+
+   function migratePassOneReport() {
+   $delta = microtime( true ) - $this-start;
+   $this-output( sprintf( %s processed %d usernames (%.1f/sec), 
%d (%.1f%%) fully migrated (username: %s)\n,
+   wfTimestamp( TS_DB ),
+   $this-total,
+   $this-total / $delta,
+   $this-migrated,
+   $this-migrated / $this-total * 100.0,
+   $this-username
+   ) );
+   }
+}
+
+$maintClass = MigrateAccount;
+require_once( RUN_MAINTENANCE_IF_MAIN );
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f91c697706a5e4feba2125773c6c3c259a6e29e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Initial commit of Extension:AccountAudit. - change (mediawiki...AccountAudit)

2013-03-13 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Initial commit of Extension:AccountAudit.
..

Initial commit of Extension:AccountAudit.

The extension adds a table for tracking the timestamp of the most recent
login for a user.  This will allow us to determine the (in)activity of a
user and thusly whether or not we can unilaterally rename the user in the
event of clashing local accounts during unification.

Change-Id: I163682c55031e77bba02d67cd62839f9541adc99
---
A .gitreview
A AccountAudit.body.php
A AccountAudit.hooks.php
A AccountAudit.i18n.php
A AccountAudit.php
A accountaudit.sql
6 files changed, 132 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AccountAudit 
refs/changes/83/53683/1

diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..1f89536
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/AccountAudit.git
+defaultbranch=master
diff --git a/AccountAudit.body.php b/AccountAudit.body.php
new file mode 100644
index 000..4c469b7
--- /dev/null
+++ b/AccountAudit.body.php
@@ -0,0 +1,36 @@
+?php
+
+class AccountAudit {
+
+   /**
+* Updates the aa_lastlogin value for the specified user
+*
+* @param $user User the user that just logged in
+*
+* @return bool
+*/
+   static function updateLastLogin( $user ) {
+
+   $now = wfTimestamp( TS_MW, time() );
+
+   $db = wfGetDB( DB_MASTER );
+   $db-insert(
+   'accountaudit_login',
+   array( 'aa_user' = $user-mId, 'aa_lastlogin' = $now 
),
+   __METHOD__,
+   array( 'IGNORE' )
+   );
+
+   if ( $db-affectedRows() == 0 ) { // duplicate key existed
+   $db-update(
+   'accountaudit_login',
+   array( 'aa_lastlogin' = $now, ),
+   array( 'aa_user' = $user-mId, ),
+   __METHOD__
+   );
+   }
+
+   return true;
+   }
+
+}
\ No newline at end of file
diff --git a/AccountAudit.hooks.php b/AccountAudit.hooks.php
new file mode 100644
index 000..9dae851
--- /dev/null
+++ b/AccountAudit.hooks.php
@@ -0,0 +1,23 @@
+?php
+
+class AccountAuditHooks {
+
+   /**
+* Implementation of the hook for onUserLoginComplete.
+*
+* Calls AccountAudit::updateLastLogin to update the timestamp of the 
last
+* login for the user
+*
+* @param User $user
+* @param $inject_html
+*
+* @return bool
+*/
+   function onUserLoginComplete( User $user, $inject_html ) {
+
+   AccountAudit::updateLastLogin( $user );
+
+   // Always return true, we should never block execution on 
failure
+   return true;
+   }
+}
\ No newline at end of file
diff --git a/AccountAudit.i18n.php b/AccountAudit.i18n.php
new file mode 100644
index 000..7d81dd3
--- /dev/null
+++ b/AccountAudit.i18n.php
@@ -0,0 +1,13 @@
+?php
+
+$messages = array();
+
+$messages['en'] = array(
+   'accountaudit-desc' = 'This extension is used to assist the WMF in 
completing the audit an unification of non-global accounts that exist across 
the WMF\'s projects',
+);
+
+/** Message documentation (Message documentation)
+ */
+$messages['qqq'] = array(
+   'accountaudit-desc' = '{{desc}}',
+);
\ No newline at end of file
diff --git a/AccountAudit.php b/AccountAudit.php
new file mode 100644
index 000..780042b
--- /dev/null
+++ b/AccountAudit.php
@@ -0,0 +1,42 @@
+?php
+/*
+ * Extension:AccountAudit. This extension is used to assist the WMF in 
completing the audit
+ * an unification of non-global accounts that exist across the WMF's projects.
+ *
+ * @author Peter Gehres pgeh...@wikimedia.org
+ */
+
+if ( !defined( 'MEDIAWIKI' ) ) {
+   echo EOT
+To install the AccountAudit extension, put the following line in 
LocalSettings.php:
+require_once( \$IP/extensions/AccountAudit/AccountAudit.php );
+EOT;
+   exit( 1 );
+}
+
+$wgExtensionCredits[ 'other' ][ ] = array(
+   'path'   = __FILE__,
+   'name'   = 'AccountAudit',
+   'author' = array( 'Peter Gehres', ),
+   'url'= 
'https://www.mediawiki.org/wiki/Extension:AccountAudit',
+   'descriptionmsg' = 'accountaudit-desc',
+   'version'= '1.0.0',
+);
+
+$dir = dirname( __FILE__ ) . '/';
+
+$wgAutoloadClasses[ 'AccountAudit' ] = $dir . 'AccountAudit.body.php';
+$wgAutoloadClasses[ 'AccountAuditHooks' ] = $dir . 'AccountAudit.hooks.php';
+
+$wgHooks['UserLoginComplete'][] = 'AccountAuditHooks::onUserLoginComplete';
+

[MediaWiki-commits] [Gerrit] Rewrite migratePass1.php to use chunks. - change (mediawiki...CentralAuth)

2013-03-11 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Rewrite migratePass1.php to use chunks.
..

Rewrite migratePass1.php to use chunks.

Since there isn't an id field in globalnames, make use of the index that does
exist to partition the table based on gn_name prefixes with a little recursion.

Change-Id: I3b8f39022d1abc481685b72d609a866e114026e7
---
M maintenance/migratePass1.php
1 file changed, 93 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/85/53285/1

diff --git a/maintenance/migratePass1.php b/maintenance/migratePass1.php
index 906279e..26fc047 100644
--- a/maintenance/migratePass1.php
+++ b/maintenance/migratePass1.php
@@ -10,30 +10,111 @@
 }
 require_once( $IP/maintenance/commandLine.inc );
 
+$stats = array(
+   migrated = 0,
+   total = 0,
+   chunksize = 1000,
+   start = microtime( true ),
+   startPrefix = ''
+);
+
 function migratePassOne() {
-   $migrated = 0;
-   $total = 0;
-   $chunkSize = 1000;
-   $start = microtime( true );
+   global $stats;
+
+   if ( $stats[chunksize]  1 ) {
+   echo You must select a positive chunk size or infinite 
recursion will ensue;
+   die( 1 );
+   }
+
+   doMigratePassOne();
+
+   migratePassOneReport( $stats['migrated'], $stats['total'], 
$stats['start'] );
+   echo DONE\n;
+}
+
+function doMigratePassOne( $prefix='' ) {
+   global $stats;
+
+   // enable us to continue where we left off
+   if ( $prefix  $stats['startPrefix'] ) {
+   // check to see if start is a proper subset of startPrefix
+   if ( strpos( $stats['startPrefix'], $prefix ) !== 0 ) {
+   return; // skip this prefix
+   }
+   }
+
+   $keys = splitPrefixIntoKeys( $prefix );
+
+   print_r( $keys );
+
+   foreach ( $keys as $key = $count) {
+
+   print $key . ' - '. $count . \n;
+
+   if ( $count  $stats['chunksize'] ) {
+   doMigratePassOne( $prefix . $key );
+   } else {
+   doMigratePassOneSubset( $prefix . $key );
+   }
+   }
+}
+
+/**
+ * Executes the migratePass1 for the specified subset of globalnames.
+ *
+ * This function assumes that all checks for chunk size have already been 
performed
+ * and any over-sized chunks split into smaller parts.
+ *
+ * @param string $prefix The prefix used as a limiting factor
+ */
+function doMigratePassOneSubset( $prefix='' ) {
+   global $stats;
+
+   echo -- Starting $prefix --\n;
 
$dbBackground = CentralAuthUser::getCentralSlaveDB();
+
$result = $dbBackground-select(
'globalnames',
-   array( 'gn_name' ),
-   '',
-   __METHOD__ );
+   array( 'gn_name', ),
+   $prefix == '' ? '' : gn_name like '$prefix%',
+   __METHOD__
+   );
+
foreach( $result as $row ) {
$name = $row-gn_name;
$central = new CentralAuthUser( $name );
if ( $central-storeAndMigrate() ) {
-   $migrated++;
+   $stats['migrated']++;
}
-   if ( ++$total % $chunkSize == 0 ) {
-   migratePassOneReport( $migrated, $total, $start );
+   if ( ++$stats['total'] % $stats['chunksize'] == 0 ) {
+   migratePassOneReport( $stats['migrated'], 
$stats['total'], $stats['start'] );
}
}
-   migratePassOneReport( $migrated, $total, $start );
-   echo DONE\n;
+   migratePassOneReport( $stats['migrated'], $stats['total'], 
$stats['start'] );
+   echo -- Done $prefix --\n;
+}
+
+function splitPrefixIntoKeys( $prefix='' ) {
+   $subStart = strlen( $prefix ) + 1; // MySQL is 1-indexed
+
+   $dbBackground = CentralAuthUser::getCentralSlaveDB();
+
+   $result = $dbBackground-select(
+   'globalnames',
+   array( substring(gn_name, $subStart, 1) as letter, 'count(*) 
as count' ),
+   $prefix == '' ? '' : gn_name like '$prefix%',
+   __METHOD__ ,
+   array( 'ORDER BY' = 'letter ASC', 'GROUP BY' = 'letter' )
+   );
+
+   $keys = array();
+
+   foreach ( $result as $row ) {
+   $keys[$row-letter] = $row-count;
+   }
+
+   return $keys;
 }
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b8f39022d1abc481685b72d609a866e114026e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

___

[MediaWiki-commits] [Gerrit] Adding comments for grep - change (mediawiki...CentralAuth)

2013-03-08 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Adding comments for grep
..


Adding comments for grep

Change-Id: I043753f095ef820bd054042f6936173fc7fd0c0b
---
M modules/ext.centralauth.js
M specials/SpecialCentralAuth.php
M specials/SpecialMergeAccount.php
M specials/SpecialWikiSets.php
4 files changed, 20 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/modules/ext.centralauth.js b/modules/ext.centralauth.js
index aecf82c..cec4936 100644
--- a/modules/ext.centralauth.js
+++ b/modules/ext.centralauth.js
@@ -14,6 +14,15 @@
mw.util.$content.append( $methodHint );
}
 
+   // Give grep a chance to find the usages:
+   // centralauth-merge-method-primary, 
centralauth-merge-method-empty,
+   // centralauth-merge-method-mail, 
centralauth-merge-method-password,
+   // centralauth-merge-method-admin, centralauth-merge-method-new,
+   // centralauth-merge-method-login,
+   // centralauth-merge-method-primary-desc, 
centralauth-merge-method-empty-desc,
+   // centralauth-merge-method-mail-desc, 
centralauth-merge-method-password-desc,
+   // centralauth-merge-method-admin-desc, 
centralauth-merge-method-new-desc,
+   // centralauth-merge-method-login-desc
hintHtml = mw.html.element(
'p', {
'class': 'merge-method-help-name'
diff --git a/specials/SpecialCentralAuth.php b/specials/SpecialCentralAuth.php
index 15e1a09..3211c7e 100644
--- a/specials/SpecialCentralAuth.php
+++ b/specials/SpecialCentralAuth.php
@@ -240,6 +240,10 @@
'hidden' = $this-formatHiddenLevel( 
$globalUser-getHiddenLevel() )
);
 
+   // Give grep a chance to find the usages:
+   // centralauth-admin-info-username, centralauth-admin-info-id, 
centralauth-admin-info-registered,
+   // centralauth-admin-info-home, 
centralauth-admin-info-editcount, centralauth-admin-info-locked,
+   // centralauth-admin-info-hidden
$content = Xml::openElement( ul );
foreach ( $attribs as $tag = $data ) {
$content .= Xml::openElement( li ) . 
Xml::openElement( strong );
diff --git a/specials/SpecialMergeAccount.php b/specials/SpecialMergeAccount.php
index add62f9..dd2592a 100644
--- a/specials/SpecialMergeAccount.php
+++ b/specials/SpecialMergeAccount.php
@@ -436,6 +436,11 @@
function listWikiItem( $wikiID, $method ) {
$return = $this-foreignUserLink( $wikiID );
if ( $method ) {
+   // Give grep a chance to find the usages:
+   // centralauth-merge-method-primary, 
centralauth-merge-method-empty,
+   // centralauth-merge-method-mail, 
centralauth-merge-method-password,
+   // centralauth-merge-method-admin, 
centralauth-merge-method-new,
+   // centralauth-merge-method-login,
$return .= $this-msg( 'word-separator' )-text();
$return .= $this-msg( 'parentheses', $this-msg( 
'centralauth-merge-method-'.$method )-text() )-escaped();
}
diff --git a/specials/SpecialWikiSets.php b/specials/SpecialWikiSets.php
index 240e6df..a3538fa 100644
--- a/specials/SpecialWikiSets.php
+++ b/specials/SpecialWikiSets.php
@@ -121,6 +121,8 @@
}
$url = SpecialPage::getTitleFor( 'WikiSets', $subpage 
)-getLocalUrl();
if ( $this-mCanEdit ) {
+   // Give grep a chance to find the usages:
+   // centralauth-editset-legend-edit, 
centralauth-editset-legend-new
$legend = $this-msg( 'centralauth-editset-legend-' . ( 
$set ? 'edit' : 'new' ), $name )-escaped();
} else {
$legend = $this-msg( 
'centralauth-editset-legend-view', $name )-escaped();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I043753f095ef820bd054042f6936173fc7fd0c0b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Shirayuki shirayuk...@gmail.com
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Fixing PHP fatal when saving banner - change (mediawiki...CentralNotice)

2013-03-07 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Fixing PHP fatal when saving banner
..


Fixing PHP fatal when saving banner

An object was not created by the time it was supposed to be
used. Obviously this causes problems. Created the object and
voila.

Bug: 45846
Change-Id: I9a2ef497dc230819e5ab58d01dadf1f01d57af4a
---
M special/SpecialNoticeTemplate.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/special/SpecialNoticeTemplate.php 
b/special/SpecialNoticeTemplate.php
index d409e16..069431c 100644
--- a/special/SpecialNoticeTemplate.php
+++ b/special/SpecialNoticeTemplate.php
@@ -915,7 +915,8 @@
}
 
Banner::updateTranslationMetadata( $pageResult, $name, 
$body, $priorityLangs );
-
+   
+   $bannerObj = new Banner( $name );
$bannerObj-logBannerChange( 'modified', 
$this-getUser(), $initialBannerSettings );
 
return;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9a2ef497dc230819e5ab58d01dadf1f01d57af4a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Mwalker mwal...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Updating CentralNotice resolving bug 45846 - change (mediawiki/core)

2013-03-07 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Updating CentralNotice resolving bug 45846
..


Updating CentralNotice resolving bug 45846

Change-Id: I22664bdb30727fa23d66be55811bf325a9344718
---
M extensions/CentralNotice
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/extensions/CentralNotice b/extensions/CentralNotice
index 50d5291..0b630e4 16
--- a/extensions/CentralNotice
+++ b/extensions/CentralNotice
-Subproject commit 50d5291f5590972978baa816aa0e8ea6e1152d0b
+Subproject commit 0b630e40c59dfbfd366242048e4f91e09abd6eb1

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I22664bdb30727fa23d66be55811bf325a9344718
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf11
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Allocation API Now works in XML - change (mediawiki...CentralNotice)

2013-03-07 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Allocation API Now works in XML
..


Allocation API Now works in XML

Needed to make an extra call to let the XML parser in the API
know how to deal with enumerated arrays.

Bug: 45884
Change-Id: Iafef5e8233bd3c46aafb440983dd90807fb26b72
---
M api/ApiCentralNoticeAllocations.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/api/ApiCentralNoticeAllocations.php 
b/api/ApiCentralNoticeAllocations.php
index 1d668bb..a1ec2a3 100644
--- a/api/ApiCentralNoticeAllocations.php
+++ b/api/ApiCentralNoticeAllocations.php
@@ -49,6 +49,7 @@
$params['minimal']
);
 
+   $result-setIndexedTagName( $bannerList, 'BannerAllocation' );
$result-addValue( $this-getModuleName(), 'banners', 
$bannerList );
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iafef5e8233bd3c46aafb440983dd90807fb26b72
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Mwalker mwal...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding specials folder to CheckUser and moving SpecialCheckU... - change (mediawiki...CheckUser)

2013-03-06 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding specials folder to CheckUser and moving 
SpecialCheckUserLog there.
..

Adding specials folder to CheckUser and moving SpecialCheckUserLog there.

Change-Id: I8e139dcb85a61e70486ba28cb5d24954ea5b88d7
---
M CheckUser.php
R specials/SpecialCheckUserLog.php
2 files changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser 
refs/changes/32/52532/1

diff --git a/CheckUser.php b/CheckUser.php
index b140696..54eb2f0 100644
--- a/CheckUser.php
+++ b/CheckUser.php
@@ -98,7 +98,7 @@
 $wgAutoloadClasses['CheckUser'] = $dir . '/CheckUser_body.php';
 $wgAutoloadClasses['CheckUserHooks'] = $dir . '/CheckUser.hooks.php';
 $wgAutoloadClasses['CheckUserLogPager'] = $dir . '/CheckUserLogPager.php';
-$wgAutoloadClasses['SpecialCheckUserLog'] = $dir . '/SpecialCheckUserLog.php';
+$wgAutoloadClasses['SpecialCheckUserLog'] = $dir . 
'/specials/SpecialCheckUserLog.php';
 $wgAutoloadClasses['CheckUserEncryptedData'] = $dir . 
'/CheckUserEncryptedData.php';
 
 // API modules
diff --git a/SpecialCheckUserLog.php b/specials/SpecialCheckUserLog.php
similarity index 100%
rename from SpecialCheckUserLog.php
rename to specials/SpecialCheckUserLog.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e139dcb85a61e70486ba28cb5d24954ea5b88d7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CheckUser
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Renaming CheckUser_body.php to SpecialCheckUser.php and movi... - change (mediawiki...CheckUser)

2013-03-06 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Renaming CheckUser_body.php to SpecialCheckUser.php and moving 
to specials folder
..

Renaming CheckUser_body.php to SpecialCheckUser.php and moving to specials 
folder

Change-Id: Ic3504f9f16c1eac8495b1091b96972131c2e0756
---
M CheckUser.php
R specials/SpecialCheckUser.php
2 files changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser 
refs/changes/35/52535/1

diff --git a/CheckUser.php b/CheckUser.php
index 54eb2f0..409fbe1 100644
--- a/CheckUser.php
+++ b/CheckUser.php
@@ -95,7 +95,7 @@
 $wgSpecialPages['CheckUserLog'] = 'SpecialCheckUserLog';
 $wgSpecialPageGroups['CheckUserLog'] = 'changes';
 
-$wgAutoloadClasses['CheckUser'] = $dir . '/CheckUser_body.php';
+$wgAutoloadClasses['CheckUser'] = $dir . '/specials/SpecialCheckUser.php';
 $wgAutoloadClasses['CheckUserHooks'] = $dir . '/CheckUser.hooks.php';
 $wgAutoloadClasses['CheckUserLogPager'] = $dir . '/CheckUserLogPager.php';
 $wgAutoloadClasses['SpecialCheckUserLog'] = $dir . 
'/specials/SpecialCheckUserLog.php';
diff --git a/CheckUser_body.php b/specials/SpecialCheckUser.php
similarity index 100%
rename from CheckUser_body.php
rename to specials/SpecialCheckUser.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3504f9f16c1eac8495b1091b96972131c2e0756
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CheckUser
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Refactoring CheckUser, moving cidr form JS and making it mor... - change (mediawiki...CheckUser)

2013-03-06 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Refactoring CheckUser, moving cidr form JS and making it more 
like everything else.
..

Refactoring CheckUser, moving cidr form JS and making it more like everything 
else.

Change-Id: I5d6007d2aa221e3496e242bd65650d4354d86949
---
M CheckUser.php
D checkuser.js
A modules/ext.checkuser.cidr.js
3 files changed, 260 insertions(+), 256 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser 
refs/changes/82/52582/1

diff --git a/CheckUser.php b/CheckUser.php
index b140696..4be4f19 100644
--- a/CheckUser.php
+++ b/CheckUser.php
@@ -83,7 +83,7 @@
 $wgHooks['PerformRetroactiveAutoblock'][] = 
'CheckUserHooks::doRetroactiveAutoblock';
 
 $wgResourceModules['ext.checkUser'] = array(
-   'scripts'   = 'checkuser.js',
+   'scripts'   = 'modules/ext.checkuser.cidr.js',
'dependencies'  = array( 'mediawiki.util' ), // IP stuff
'localBasePath' = dirname( __FILE__ ),
'remoteExtPath' = 'CheckUser',
diff --git a/checkuser.js b/checkuser.js
deleted file mode 100644
index cbb59c7..000
--- a/checkuser.js
+++ /dev/null
@@ -1,255 +0,0 @@
-/* -- (c) Aaron Schulz 2009 */
-
-var showResults = function(size, cidr) {
-   $( '#mw-checkuser-cidr-res' ).val( cidr );
-   $( '#mw-checkuser-ipnote' ).text( size );
-};
-
-/*
-* This function calculates the common range of a list of
-* IPs. It should be set to update on keyUp.
-*/
-var updateCIDRresult = function() {
-   var form = document.getElementById( 'mw-checkuser-cidrform' );
-   if( !form ) {
-   return; // no JS form
-   }
-   form.style.display = 'inline'; // unhide form (JS active)
-   var iplist = document.getElementById( 'mw-checkuser-iplist' );
-   if( !iplist ) {
-   return; // no JS form
-   }
-   var text = iplist.value, ips;
-   // Each line should have one IP or range
-   if( text.indexOf(\n) != -1 ) {
-   ips = text.split(\n);
-   // Try some other delimiters too...
-   } else if( text.indexOf(\t) != -1 ) {
-   ips = text.split(\t);
-   } else if( text.indexOf(,) != -1 ) {
-   ips = text.split(,);
-   } else if( text.indexOf(-) != -1 ) {
-   ips = text.split(-);
-   } else if( text.indexOf( ) != -1 ) {
-   ips = text.split( );
-   } else {
-   ips = text.split(;);
-   }
-   var bin_prefix = 0;
-   var prefix_cidr = 0;
-   var prefix = new String( '' );
-   var foundV4 = false;
-   var foundV6 = false;
-   var ip_count;
-   // Go through each IP in the list, get its binary form, and
-   // track the largest binary prefix among them...
-   for( var i = 0; i  ips.length; i++ ) {
-   // ...in the spirit of mediawiki.special.block.js, call this 
addy
-   var addy = ips[i].replace(/^\s*|\s*$/, '' ); // trim
-   // Match the first IP in each list (ignore other garbage)
-   var ipV4 = mw.util.isIPv4Address( addy, true );
-   var ipV6 = mw.util.isIPv6Address( addy, true );
-   var ip_cidr = addy.match(/^(.*)(?:\/(\d+))?$/);
-   // Binary form
-   var bin = new String( '' );
-   // Convert the IP to binary form: IPv4
-   if( ipV4 ) {
-   foundV4 = true;
-   if ( foundV6 ) { // disjoint address space
-   prefix = '';
-   break;
-   }
-   var ip = ip_cidr[1];
-   var cidr = ip_cidr[2] ? ip_cidr[2] : null; // CIDR, if 
it exists
-   // Get each quad integer
-   var blocs = ip.split('.');
-   for( var x = 0; x  blocs.length; x++ ) {
-   bloc = parseInt( blocs[x], 10 );
-   var bin_block = bloc.toString( 2 ); // concat 
bin with binary form of bloc
-   while( bin_block.length  8 ) {
-   bin_block = '0' + bin_block; // pad out 
as needed
-   }
-   bin += bin_block;
-   }
-   prefix = ''; // Rebuild formatted bin_prefix for each IP
-   // Apply any valid CIDRs
-   if( cidr ) {
-   bin = bin.substring( 0, cidr ); // truncate bin
-   }
-   // Init bin_prefix
-   if( bin_prefix === 0 ) {
-   bin_prefix = new String( bin );
-   // Get largest common bin_prefix
-   } else {
-   

[MediaWiki-commits] [Gerrit] Refactoring Special:CentralAuth to use XML and HTML forms. - change (mediawiki...CentralAuth)

2013-03-05 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Refactoring Special:CentralAuth to use XML and HTML forms.
..

Refactoring Special:CentralAuth to use XML and HTML forms.

Change-Id: If50c3e3e4d8d0396ca1d56c6e81cd2ff3c42d944
---
M specials/SpecialCentralAuth.php
1 file changed, 97 insertions(+), 61 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/97/52297/1

diff --git a/specials/SpecialCentralAuth.php b/specials/SpecialCentralAuth.php
index 15e1a09..eabec21 100644
--- a/specials/SpecialCentralAuth.php
+++ b/specials/SpecialCentralAuth.php
@@ -182,23 +182,21 @@
$lookup = $this-mCanEdit ?
$this-msg( 'centralauth-admin-lookup-rw' )-text() :
$this-msg( 'centralauth-admin-lookup-ro' )-text();
-   $this-getOutput()-addHTML(
-   Xml::openElement( 'form', array(
-   'method' = 'get',
-   'action' = $wgScript ) ) .
-   'fieldset' .
-   Xml::element( 'legend', array(), $this-msg( 
'centralauth-admin-manage' )-text() ) .
+
+   $html = Xml::openElement( 'form', array( 'method' = 'get', 
'action' = $wgScript ) );
+   $html .= Xml::fieldset(
+   $this-msg( 'centralauth-admin-manage' )-text(),
Html::hidden( 'title', 
$this-getTitle()-getPrefixedText() ) .
-   'p' .
-   Xml::inputLabel( $this-msg( 
'centralauth-admin-username' )-text(),
-   'target', 'target', 25, $this-mUserName ) .
-   '/p' .
-   'p' .
-   Xml::submitButton( $lookup ) .
-   '/p' .
-   '/fieldset' .
-   '/form'
+   Xml::openElement( 'p' ) .
+   Xml::inputLabel( $this-msg( 
'centralauth-admin-username' )-text(),
+   'target', 'target', 25, 
$this-mUserName ) .
+   Xml::closeElement( 'p' ) .
+   Xml::openElement( 'p' ) .
+   Xml::submitButton( $lookup ) .
+   Xml::closeElement( 'p' )
);
+   $html .= Xml::closeElement( 'form' );
+   $this-getOutput()-addHTML( $html );
}
 
/**
@@ -262,39 +260,50 @@
$this-msg( 'centralauth-admin-list-legend-rw' 
)-escaped() :
$this-msg( 'centralauth-admin-list-legend-ro' 
)-escaped();
 
-   $this-getOutput()-addHTML( 
fieldsetlegend{$legend}/legend );
+   $this-getOutput()-addHTML( Xml::fieldset( $legend ) );
$this-getOutput()-addHTML( $this-listHeader() );
$this-getOutput()-addHTML( $this-listMerged( $merged ) );
if ( $remainder ) {
$this-getOutput()-addHTML( $this-listRemainder( 
$remainder ) );
}
$this-getOutput()-addHTML( $this-listFooter() );
-   $this-getOutput()-addHTML( '/fieldset' );
+   $this-getOutput()-addHTML( Xml::closeElement( 'fieldset' ) );
}
 
/**
 * @return string
 */
function listHeader() {
-   return
-   Xml::openElement( 'form',
-   array(
-   'method' = 'post',
-   'action' =
-   $this-getTitle( 
$this-mUserName )-getLocalUrl( 'action=submit' ),
-   'id' = 'mw-centralauth-merged' ) ) .
-   Html::hidden( 'wpMethod', 'unmerge' ) .
+   $columns = array(
+   localwiki,   // centralauth-admin-list-localwiki
+   attached-on, // centralauth-admin-list-attached-on
+   method,  // centralauth-admin-list-method
+   blocked, // centralauth-admin-list-blocked
+   editcount,   // centralauth-admin-list-editcount
+   );
+   $header = Xml::openElement( 'form',
+   array(
+'method' = 'post',
+'action' =
+$this-getTitle( $this-mUserName 
)-getLocalUrl( 'action=submit' ),
+'id' = 'mw-centralauth-merged' ) );
+   $header .= Html::hidden( 'wpMethod', 'unmerge' ) .
Html::hidden( 'wpEditToken', 
$this-getUser()-getEditToken() ) .
-   

[MediaWiki-commits] [Gerrit] Refactoring specials/SpecialGlobalGroupPermissions.php to us... - change (mediawiki...CentralAuth)

2013-03-05 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Refactoring specials/SpecialGlobalGroupPermissions.php to use 
XML forms.
..

Refactoring specials/SpecialGlobalGroupPermissions.php to use XML forms.

Change-Id: Iaecdeef3d910624b185642166528ae4ac0f98a9e
---
M specials/SpecialGlobalGroupPermissions.php
1 file changed, 20 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/00/52300/1

diff --git a/specials/SpecialGlobalGroupPermissions.php 
b/specials/SpecialGlobalGroupPermissions.php
index 1b24193..cee4167 100644
--- a/specials/SpecialGlobalGroupPermissions.php
+++ b/specials/SpecialGlobalGroupPermissions.php
@@ -77,17 +77,19 @@
 
if ( count( $groups ) ) {
$this-getOutput()-addWikiMsg( 
'centralauth-globalgroupperms-grouplist' );
-   $this-getOutput()-addHTML( 'ul' );
+   $this-getOutput()-addHTML( Xml::openElement( 'ul' ) );
 
foreach ( $groups as $group ) {
$text = $this-msg(

'centralauth-globalgroupperms-grouplistitem',
User::getGroupName( $group ),
$group,
-   'span 
class=centralauth-globalgroupperms-groupname' . $group . '/span'
+   Xml::element( 'span',
+   array( class = 
centralauth-globalgroupperms-groupname),
+   $group
+   )
)-parse();
-
-   $this-getOutput()-addHTML( li $text /li 
);
+   $this-getOutput()-addHTML( Xml::element( 
'li', null, ' ' . $text . ' ' ) );
}
} else {
$this-getOutput()-addWikiMsg( 
'centralauth-globalgroupperms-nogroups' );
@@ -125,7 +127,13 @@
$html = Xml::fieldset( $this-msg( 
'centralauth-editgroup-fieldset', $group )-text(), false, array( 'class' = 
$fieldsetClass ) );
 
if ( $editable ) {
-   $html .= Xml::openElement( 'form', array( 'method' = 
'post', 'action' = SpecialPage::getTitleFor( 'GlobalGroupPermissions', $group 
)-getLocalUrl(), 'name' = 'centralauth-globalgroups-newgroup' ) );
+   $html .= Xml::openElement( 'form',
+   array(
+'method' = 'post',
+'action' = SpecialPage::getTitleFor( 
'GlobalGroupPermissions', $group )-getLocalUrl(),
+'name' = 
'centralauth-globalgroups-newgroup'
+   )
+   );
$html .= Html::hidden( 'wpGroup', $group );
$html .= Html::hidden( 'wpEditToken', 
$this-getUser()-getEditToken() );
}
@@ -224,19 +232,23 @@
$checkboxes1 = array_slice( $checkboxes, 0, $firstCol );
$checkboxes2 = array_slice( $checkboxes, $firstCol );
 
-   $html = 'tabletbodytrtdul';
+   $html = Xml::openElement( 'table' ) . Xml::openElement( 'tbody' 
) .
+   Xml::openElement( 'tr' ) . Xml::openElement( 'td' ) . 
Xml::openElement( 'ul' );
 
foreach ( $checkboxes1 as $cb ) {
$html .= $cb;
}
 
-   $html .= '/ul/tdtdul';
+   $html .= Xml::closeElement( 'ul' ) . Xml::closeElement( 'td' ) .
+   Xml::openElement( 'td' ) . Xml::openElement( 'ul' );
 
foreach ( $checkboxes2 as $cb ) {
$html .= $cb;
}
 
-   $html .= '/ul/td/tr/tbody/table';
+   $html .= Xml::closeElement( 'ul' ) . Xml::closeElement( 'td' ) .
+   Xml::closeElement( 'tr' ) . Xml::closeElement( 'tbody' 
) .
+   Xml::closeElement( 'table' );
 
return $html;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaecdeef3d910624b185642166528ae4ac0f98a9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Refactoring SpecialGlobalUsers.php and SpecialMergeAccount.p... - change (mediawiki...CentralAuth)

2013-03-05 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Refactoring SpecialGlobalUsers.php and SpecialMergeAccount.php 
to use XML and HTML forms.
..

Refactoring SpecialGlobalUsers.php and SpecialMergeAccount.php to use XML and 
HTML forms.

Change-Id: I36267e0df681f50e004ae08629aa5cfa204379b1
---
M specials/SpecialGlobalUsers.php
M specials/SpecialMergeAccount.php
2 files changed, 69 insertions(+), 64 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/37/52337/1

diff --git a/specials/SpecialGlobalUsers.php b/specials/SpecialGlobalUsers.php
index 63f7a9e..710002f 100644
--- a/specials/SpecialGlobalUsers.php
+++ b/specials/SpecialGlobalUsers.php
@@ -31,7 +31,7 @@
$this-getOutput()-addModuleStyles( 
'ext.centralauth.globalusers' );
$this-getOutput()-addHTML( $pg-getPageHeader() );
$this-getOutput()-addHTML( $pg-getNavigationBar() );
-   $this-getOutput()-addHTML( 'ul' . $pg-getBody() . '/ul' 
);
+   $this-getOutput()-addHTML( Html::rawElement( 'ul', null, 
$pg-getBody() ) );
$this-getOutput()-addHTML( $pg-getNavigationBar() );
}
 }
diff --git a/specials/SpecialMergeAccount.php b/specials/SpecialMergeAccount.php
index add62f9..54a7382 100644
--- a/specials/SpecialMergeAccount.php
+++ b/specials/SpecialMergeAccount.php
@@ -210,7 +210,7 @@
 
// Show wiki list if required
if ( $status-hasMessage( 
'centralauth-merge-home-password' ) ) {
-   $out = 'h2' . $this-msg( 
'centralauth-list-home-title' )-escaped() . '/h2';
+   $out = Html::rawElement( 'h2', null, 
$this-msg( 'centralauth-list-home-title' )-escaped() );
$out .= $this-msg( 
'centralauth-list-home-dryrun' )-parseAsBlock();
$out .= $this-listAttached( array( $home ), 
array( $home = 'primary' ) );
$this-getOutput()-addHTML( $out );
@@ -301,10 +301,9 @@
$this-showCleanupForm();
} else {
$this-getOutput()-addHTML(
-   'div class=errorbox' .
-   $this-msg( 'wrongpassword' 
)-escaped() .
-   '/div' .
-   $this-attachActionForm() );
+   Html::rawElement( 'div', array( class = 
errorbox ),
+   $this-msg( 'wrongpassword' )-escaped()
+   ) . $this-attachActionForm() );
}
}
 
@@ -359,14 +358,14 @@
$this-getOutput()-addWikiMsg( 'centralauth-readmore-text' );
 
if ( $merged ) {
-   $this-getOutput()-addHTML( 'hr /' );
+   $this-getOutput()-addHTML( Xml::element( 'hr' ) );
$this-getOutput()-addWikiMsg( 
'centralauth-list-attached',
$this-mUserName );
$this-getOutput()-addHTML( $this-listAttached( 
$merged ) );
}
 
if ( $remainder ) {
-   $this-getOutput()-addHTML( 'hr /' );
+   $this-getOutput()-addHTML( Xml::element( 'hr' ) );
$this-getOutput()-addWikiMsg( 
'centralauth-list-unattached',
$this-mUserName );
$this-getOutput()-addHTML( $this-listUnattached( 
$remainder ) );
@@ -416,16 +415,21 @@
function formatList( $items, $methods, $callback ) {
if ( !$items ) {
return '';
-   } else {
-   $itemMethods = array();
-   foreach ( $items as $item ) {
-   $itemMethods[] = isset( $methods[$item] ) ? 
$methods[$item] : '';
-   }
-   return ul\nli .
-   implode( /li\nli,
-   array_map( $callback, $items, 
$itemMethods ) ) .
-   /li\n/ul\n;
}
+
+   $itemMethods = array();
+   foreach ( $items as $item ) {
+   $itemMethods[] = isset( $methods[$item] ) ? 
$methods[$item] : '';
+   }
+
+   $html = Xml::openElement( 'ul' ) . \n;
+   $list = array_map( $callback, $items, $itemMethods );
+   foreach ( $list as $item ){
+   $html .= Html::rawElement( 'li', array(), $item ) . 
\n;
+   }
+   $html .= Xml::closeElement( 'ul' ) . \n;
+
+   return $html;
}
 
/**
@@ -454,7 +458,7 @@
}
 
   

[MediaWiki-commits] [Gerrit] Adding username to the account details section of Special:Ce... - change (mediawiki...CentralAuth)

2013-03-04 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Adding username to the account details section of 
Special:CentralAuth (Bug 36015)
..

Adding username to the account details section of Special:CentralAuth (Bug 
36015)

Change-Id: Ia7e0121848b42d48c5c16a190ddc741a7d0954bc
---
M specials/SpecialCentralAuth.php
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/51/52151/1

diff --git a/specials/SpecialCentralAuth.php b/specials/SpecialCentralAuth.php
index 279de73..c4ae2ea 100644
--- a/specials/SpecialCentralAuth.php
+++ b/specials/SpecialCentralAuth.php
@@ -289,6 +289,7 @@
$reg = $globalUser-getRegistration();
$age = $this-prettyTimespan( wfTimestamp( TS_UNIX ) - 
wfTimestamp( TS_UNIX, $reg ) );
$attribs = array(
+   'name' = $globalUser-getName(),
'id' = $globalUser-getId(),
'registered' = htmlspecialchars( 
$this-getLanguage()-timeanddate( $reg, true ) .  ($age) ),
'home' = $this-determineHomeWiki(),
@@ -299,8 +300,13 @@
$out = 'fieldset id=mw-centralauth-info';
$out .= 'legend' . $this-msg( 
'centralauth-admin-info-header' )-escaped() . '/legendul';
foreach ( $attribs as $tag = $data ) {
-   $out .= 'listrong' . $this-msg( 
centralauth-admin-info-$tag )-escaped() . '/strong ' .
-   $data . '/li';
+   $out .= 'listrong';
+   if ( $tag == 'name' ) {
+   $out .= $this-msg( 
centralauth-admin-username )-escaped();
+   } else {
+   $out .= $this-msg( 
centralauth-admin-info-$tag )-escaped();
+   }
+   $out .= '/strong ' . $data . '/li';
}
$out .= '/ul/fieldset';
$this-getOutput()-addHTML( $out );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7e0121848b42d48c5c16a190ddc741a7d0954bc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fixing my last name for icinga - change (operations/puppet)

2013-02-28 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Fixing my last name for icinga
..

Fixing my last name for icinga

Change-Id: Ib16c548092a1e4d3eb79f19c88cbf65f98e7fddf
---
M files/icinga/cgi.cfg
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/71/51571/1

diff --git a/files/icinga/cgi.cfg b/files/icinga/cgi.cfg
index 6a98911..f54d605 100644
--- a/files/icinga/cgi.cfg
+++ b/files/icinga/cgi.cfg
@@ -131,7 +131,7 @@
 # not use authorization.  You may use an asterisk (*) to
 # authorize any user who has authenticated to the web server.
 
-authorized_for_system_information=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgheres
+authorized_for_system_information=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgehres
 
 
 # CONFIGURATION INFORMATION ACCESS
@@ -142,7 +142,7 @@
 # an asterisk (*) to authorize any user who has authenticated
 # to the web server.
 
-authorized_for_configuration_information=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgheres
+authorized_for_configuration_information=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgehres
 
 
 
@@ -155,7 +155,7 @@
 # You may use an asterisk (*) to authorize any user who has
 # authenticated to the web server.
 
-authorized_for_system_commands=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgheres
+authorized_for_system_commands=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgehres
 
 
 # GLOBAL HOST/SERVICE VIEW ACCESS
@@ -181,8 +181,8 @@
 # authorization).  You may use an asterisk (*) to authorize any
 # user who has authenticated to the web server.
 
-authorized_for_all_service_commands=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgheres
-authorized_for_all_host_commands=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgheres
+authorized_for_all_service_commands=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgehres
+authorized_for_all_host_commands=tstarling,robh,mark,midom,laner,ariel,py,asher,dzahn,lcarr,jgreen,mwalker,khorn,pgehres
 
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib16c548092a1e4d3eb79f19c88cbf65f98e7fddf
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating credits - change (mediawiki...DonationInterface)

2013-02-28 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Updating credits
..

Updating credits

Change-Id: I2e2c3c9aa033cbf18891208245199d30232aea96
---
M donationinterface.php
M donationinterface_langonly.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/83/51583/1

diff --git a/donationinterface.php b/donationinterface.php
index 5aa90d4..c3aba61 100644
--- a/donationinterface.php
+++ b/donationinterface.php
@@ -21,7 +21,7 @@
 // Extension credits that will show up on Special:Version
 $wgExtensionCredits['specialpage'][] = array(
'name' = 'Donation Interface',
-   'author' = array( 'Katie Horn', 'Ryan Kaldari' , 'Arthur Richards', 
'Jeremy Postlethwaite' ),
+   'author' = array( 'Katie Horn', 'Ryan Kaldari' , 'Arthur Richards', 
'Matt Walker', 'Adam Wight', 'Peter Gehres', 'Jeremy Postlethwaite' ),
'version' = '2.0.0',
'descriptionmsg' = 'donationinterface-desc',
'url' = 'https://www.mediawiki.org/wiki/Extension:DonationInterface',
diff --git a/donationinterface_langonly.php b/donationinterface_langonly.php
index dfcf008..06814ce 100644
--- a/donationinterface_langonly.php
+++ b/donationinterface_langonly.php
@@ -22,7 +22,7 @@
 // Extension credits that will show up on Special:Version
 $wgExtensionCredits['specialpage'][] = array(
'name' = 'Donation Interface - Language Only',
-   'author' = array( 'Katie Horn', 'Ryan Kaldari' , 'Arthur Richards', 
'Jeremy Postlethwaite' ),
+   'author' = array( 'Katie Horn', 'Ryan Kaldari' , 'Arthur Richards', 
'Matt Walker', 'Adam Wight', 'Peter Gehres', 'Jeremy Postlethwaite' ),
'version' = '2.0.0',
'descriptionmsg' = 'donate_interface-langonly-desc',
'url' = 'https://www.mediawiki.org/wiki/Extension:DonationInterface',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e2c3c9aa033cbf18891208245199d30232aea96
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Update DonationInterface-langonly to master for i18n updates... - change (mediawiki/core)

2013-02-28 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Update DonationInterface-langonly to master for i18n updates 
and credits
..

Update DonationInterface-langonly to master for i18n updates and credits

Change-Id: I05cbdc970c4d711e3c23615754ec7d8be6928eb6
---
M extensions/DonationInterface
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/51585/1

diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 904ba91..19c8695 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
-Subproject commit 904ba91dddccee6a6402b0936036a90e09a089fc
+Subproject commit 19c869527a4bb7b3125c63badbeff74871f24a36

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05cbdc970c4d711e3c23615754ec7d8be6928eb6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf10
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Update DonationInterface-langonly to master for i18n updates... - change (mediawiki/core)

2013-02-28 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Update DonationInterface-langonly to master for i18n updates 
and credits
..


Update DonationInterface-langonly to master for i18n updates and credits

Change-Id: I05cbdc970c4d711e3c23615754ec7d8be6928eb6
---
M extensions/DonationInterface
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 904ba91..19c8695 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
-Subproject commit 904ba91dddccee6a6402b0936036a90e09a089fc
+Subproject commit 19c869527a4bb7b3125c63badbeff74871f24a36

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I05cbdc970c4d711e3c23615754ec7d8be6928eb6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf10
Gerrit-Owner: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Aliases email only credit card forms to standard forms - change (mediawiki/core)

2013-02-27 Thread Pgehres (Code Review)
Pgehres has uploaded a new change for review.

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


Change subject: Aliases email only credit card forms to standard forms
..

Aliases email only credit card forms to standard forms

Change-Id: Iba4f51c7201c36fa9aa57c9f70fcb20751c7c9a7
---
M DonationInterfaceFormSettings.php
1 file changed, 3 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/51168/1

diff --git a/DonationInterfaceFormSettings.php 
b/DonationInterfaceFormSettings.php
index 43dc1f5..484e90f 100644
--- a/DonationInterfaceFormSettings.php
+++ b/DonationInterfaceFormSettings.php
@@ -329,35 +329,9 @@
  * Name and Email-Only Test *
  /
 
-$forms_whitelist['email-cc-vmaj'] = array(
-   'file' = $form_dirs['gc'] . '/cc-emailonly/cc-vmaj.html',
-   'gateway' = 'globalcollect',
-   'countries' = array(
-   '+' = $forms_whitelist['cc-vmaj']['countries']['+'],
-   '-' = array( 'US', 'CA', 'GB'), # TODO: Does this actually 
exlcude them?
-   ),
-   'payment_methods' = array('cc' = array( 'visa', 'mc', 'amex', 'jcb' ))
-);
-
-$forms_whitelist['email-cc-vma'] = array(
-   'file' = $form_dirs['gc'] . '/cc-emailonly/cc-vma.html',
-   'gateway' = 'globalcollect',
-   'countries' = array(
-   '+' = $forms_whitelist['cc-vma']['countries']['+'],
-   '-' = array( 'US', 'CA', 'GB'), # TODO: Does this actually 
exlcude them?
-   ),
-   'payment_methods' = array('cc' = array( 'visa', 'mc', 'amex' ))
-);
-
-$forms_whitelist['email-cc-vm'] = array(
-   'file' = $form_dirs['gc'] . '/cc-emailonly/cc-vm.html',
-   'gateway' = 'globalcollect',
-   'countries' = array(
-   '+' = $forms_whitelist['cc-vm']['countries']['+'],
-   '-' = array( 'US', 'CA', 'GB'), # TODO: Does this actually 
exlcude them?
-   ),
-   'payment_methods' = array('cc' = array( 'visa', 'mc' ))
-);
+$forms_whitelist['email-cc-vmaj'] = $forms_whitelist['cc-vmaj'];
+$forms_whitelist['email-cc-vma'] = $forms_whitelist['cc-vma'];
+$forms_whitelist['email-cc-vm'] = $forms_whitelist['cc-vm'];
 
 /*
  * Recurring Credit Card *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba4f51c7201c36fa9aa57c9f70fcb20751c7c9a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/1.20
Gerrit-Owner: Pgehres pgeh...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Card 824 - Add Name and Email to EW/RTBT Payment Methods - change (mediawiki...DonationInterface)

2013-02-27 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Card 824 - Add Name and Email to EW/RTBT Payment Methods
..


Card 824 - Add Name and Email to EW/RTBT Payment Methods

Effectively removing the anonymity benefits because apparently that
doesn't matter.

Also -- We need a better way to present 'optional' fields.

Change-Id: Iefaa3cd5d61352a781d231e106c8535e0eff4865
---
M globalcollect_gateway/forms/html/ew/ew-webmoney.html
M globalcollect_gateway/forms/html/ew/ew-yandex.html
M globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
M globalcollect_gateway/forms/html/rtbt/rtbt-sofo-GB.html
M globalcollect_gateway/forms/html/rtbt/rtbt-sofo.html
5 files changed, 27 insertions(+), 30 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/globalcollect_gateway/forms/html/ew/ew-webmoney.html 
b/globalcollect_gateway/forms/html/ew/ew-webmoney.html
index 300bee6..1fb9db3 100644
--- a/globalcollect_gateway/forms/html/ew/ew-webmoney.html
+++ b/globalcollect_gateway/forms/html/ew/ew-webmoney.html
@@ -38,6 +38,12 @@
 /div
 /td
 /tr
+   tr
+   td colspan=2
+   input 
class=halfwidth optional id=fname name=fname 
title=%donate_interface-donor-fname% value=@fname 
placeholder=%donate_interface-donor-fname%/
+   input 
class=halfwidth leftmar optional id=lname name=lname 
title=%donate_interface-donor-lname% value=@lname 
placeholder=%donate_interface-donor-lname%/
+   /td
+   /tr
 {% block optional_email %}
 tr
 td colspan=2
@@ -111,13 +117,10 @@
 input type=hidden value=ew name=payment_method/
 input type=hidden value=ew_webmoney 
name=payment_submethod/
 !-- required fields omitted above --
-input class=optional type=hidden value= 
name=fname id=fname /
-input class=optional type=hidden value= 
name=lname id=lname /
 input class=optional type=hidden value= 
name=street id=street /
 input class=optional type=hidden value= name=city 
id=city /
 input class=optional type=hidden value= 
name=state id=state /
 input class=optional type=hidden value= name=zip 
id=zip /
-!--input class=optional type=hidden value= 
name=emailAdd id=emailAdd /--
 /form
 /div
 p 
id=informationsharing%donate_interface-informationsharing|url%/p
diff --git a/globalcollect_gateway/forms/html/ew/ew-yandex.html 
b/globalcollect_gateway/forms/html/ew/ew-yandex.html
index 2cf4fb1..16f5d7a 100644
--- a/globalcollect_gateway/forms/html/ew/ew-yandex.html
+++ b/globalcollect_gateway/forms/html/ew/ew-yandex.html
@@ -38,6 +38,12 @@
/div
/td
/tr
+   tr
+   td colspan=2
+   input 
class=halfwidth optional id=fname name=fname 
title=%donate_interface-donor-fname% value=@fname 
placeholder=%donate_interface-donor-fname%/
+   input 
class=halfwidth leftmar optional id=lname name=lname 
title=%donate_interface-donor-lname% value=@lname 
placeholder=%donate_interface-donor-lname%/
+   /td
+   /tr
{% block optional_email %}
 tr
 td
@@ -80,13 +86,10 @@
input type=hidden value=ew 
name=payment_method/
 input type=hidden value=ew_yandex 
name=payment_submethod/
 !-- required fields omitted above --
-input type=hidden class=optional value= name=fname 
id=fname /
-input type=hidden class=optional value= name=lname 
id=lname /
 input type=hidden class=optional value= name=street 
id=street /
 input type=hidden class=optional value= name=city 
id=city /
 input type=hidden class=optional value= name=state 
id=state /
 input type=hidden 

[MediaWiki-commits] [Gerrit] Adding UTM source to the missing form error log lines so we ... - change (mediawiki...DonationInterface)

2013-02-27 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Adding UTM source to the missing form error log lines so we can 
tell where they're all coming from
..


Adding UTM source to the missing form error log lines so we can tell where 
they're all coming from

Change-Id: I4d69547e7d67b71a397db5c7572ca74253817234
---
M gateway_forms/RapidHtml.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/gateway_forms/RapidHtml.php b/gateway_forms/RapidHtml.php
index e31412a..d95cc18 100644
--- a/gateway_forms/RapidHtml.php
+++ b/gateway_forms/RapidHtml.php
@@ -479,7 +479,7 @@

if ( $problems ){
$message = 'Requested an unavailable or non-existent 
form.';
-   $this-gateway-log( $message . ' ' . $debug_message, 
LOG_ERR );
+   $this-gateway-log( $message . ' ' . $debug_message . 
' ' . $this-gateway-getData_Unstaged_Escaped('utm_source') , LOG_ERR );
throw new MWException( $message ); # TODO: translate
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4d69547e7d67b71a397db5c7572ca74253817234
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Katie Horn kh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Removing false alarms resulting from calling set_html_file_p... - change (mediawiki...DonationInterface)

2013-02-27 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Removing false alarms resulting from calling set_html_file_path 
from what should be non-fatal places
..


Removing false alarms resulting from calling set_html_file_path from what 
should be non-fatal places

Change-Id: I9a8fd07d57155083cf25be441429ea3a1e3b2bde
---
M gateway_forms/RapidHtml.php
1 file changed, 10 insertions(+), 10 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/gateway_forms/RapidHtml.php b/gateway_forms/RapidHtml.php
index d95cc18..c9b9aea 100644
--- a/gateway_forms/RapidHtml.php
+++ b/gateway_forms/RapidHtml.php
@@ -119,12 +119,8 @@
 
// checking to see if there is a country-specific version of 
the form
if ( !empty( $country ) ) {
-   try{
-   $country_based = $wgRequest-getText( 'ffname', 
'default' ) . '-' . $country;
-   $this-set_html_file_path( htmlspecialchars( 
$country_based ) );
-   } catch ( MWException $mwe ) {
-   // no, there is not
-   }
+   $country_based = $wgRequest-getText( 'ffname', 
'default' ) . '-' . $country;
+   $this-set_html_file_path( htmlspecialchars( 
$country_based ), false );
}
// only keep looking if we still haven't found a form that works
if ( empty( $this-html_file_path ) ){
@@ -422,7 +418,7 @@
 * @param string $form_key The array key defining the whitelisted form 
path to fetch from $wgDonationInterfaceAllowedHtmlForms
 * @throws MWException
 */
-   public function set_html_file_path( $form_key ) {
+   public function set_html_file_path( $form_key, $fatal = true ) {
$g = $this-gateway;
$allowedForms = $g::getGlobal( 'AllowedHtmlForms' );
 
@@ -478,9 +474,13 @@
}

if ( $problems ){
-   $message = 'Requested an unavailable or non-existent 
form.';
-   $this-gateway-log( $message . ' ' . $debug_message . 
' ' . $this-gateway-getData_Unstaged_Escaped('utm_source') , LOG_ERR );
-   throw new MWException( $message ); # TODO: translate
+   if ( $fatal ){
+   $message = 'Requested an unavailable or 
non-existent form.';
+   $this-gateway-log( $message . ' ' . 
$debug_message . ' ' . $this-gateway-getData_Unstaged_Escaped('utm_source') , 
LOG_ERR );
+   throw new MWException( $message ); # TODO: 
translate
+   } else {
+   return;
+   }
}
 
$this-html_file_path = $allowedForms[$form_key]['file'];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9a8fd07d57155083cf25be441429ea3a1e3b2bde
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Katie Horn kh...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Card 793 - Adding a new i18n message for bank transfer - change (mediawiki...DonationInterface)

2013-02-25 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: Card 793 - Adding a new i18n message for bank transfer
..


Card 793 - Adding a new i18n message for bank transfer

We have been requested to remove the Sofort name from our forms due
to non recognition. This message allows us to use a generic title
for these methods.

Change-Id: Ic019eac1338a82327cc503836a6690f7a72a2a7b
---
M gateway_common/interface.i18n.php
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/gateway_common/interface.i18n.php 
b/gateway_common/interface.i18n.php
index ed97ea9..aeb4f0a 100644
--- a/gateway_common/interface.i18n.php
+++ b/gateway_common/interface.i18n.php
@@ -360,6 +360,7 @@
'donate_interface-bt-finished' = 'Finished',
 
// Online bank transfer (obt)
+   'donate_interface-obt-generic-name' = 'Online bank transfer',
'donate_interface-obt-biller_id' = 'Biller code',
'donate_interface-obt-customer_payment_reference' = 'Reference #',
'donate_interface-obt-information' = 'Online bank transfer 
information',
@@ -821,6 +822,7 @@
'donate_interface-bt-special_id' = 'Bank transfer: Label for country 
specific bank transfer information (for example ABA number for the USA)',
'donate_interface-bt-information' = 'Bank transfer: Bank transfer 
information',
'donate_interface-bt-finished' = 'Bank transfer: Finished - this is a 
link or a button to take the user to the Thank you page for their donation.',
+   'donate_interface-obt-generic-name' = 'Generic title for form or 
button that allows usage of the online bank transfer payment method.',
'donate_interface-obt-biller_id' = 'BPAY (Australian Online Bank 
Transfer) - The label for biller code',
'donate_interface-obt-customer_payment_reference' = 'BPAY (Australian 
Online Bank Transfer) - The customer reference number label',
'donate_interface-obt-information' = 'BPAY (Australian Online Bank 
Transfer) - The second level header on the web page',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic019eac1338a82327cc503836a6690f7a72a2a7b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Mwalker mwal...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org
Gerrit-Reviewer: Siebrand siebr...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] (fr #726) Parse refunds from paypal history files - change (wikimedia...tools)

2013-02-14 Thread Pgehres (Code Review)
Pgehres has submitted this change and it was merged.

Change subject: (fr #726) Parse refunds from paypal history files
..


(fr #726) Parse refunds from paypal history files

Change-Id: If89f31f32a21be5bd16a71839e7b45f26bb5cea9
---
A audit/paypal/history.py
A audit/paypal/paypal-audit.cfg
2 files changed, 144 insertions(+), 0 deletions(-)

Approvals:
  Pgehres: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: If89f31f32a21be5bd16a71839e7b45f26bb5cea9
Gerrit-PatchSet: 4
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Adamw awi...@wikimedia.org
Gerrit-Reviewer: Adamw awi...@wikimedia.org
Gerrit-Reviewer: Katie Horn kh...@wikimedia.org
Gerrit-Reviewer: Mwalker mwal...@wikimedia.org
Gerrit-Reviewer: Pgehres pgeh...@wikimedia.org

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


  1   2   3   >