Paladox has uploaded a new change for review.

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

Change subject: Convert to globals and add composer support
......................................................................

Convert to globals and add composer support

Change-Id: I262180f9d658b06d72a67325e3d152ae6f8ac956
---
M ConfirmAccount.php
M backend/schema/ConfirmAccountUpdater.hooks.php
M backend/schema/mysql/ConfirmAccount.sql
M backend/schema/mysql/patch-account_credentials.sql
A composer.json
5 files changed, 15 insertions(+), 11 deletions(-)


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

diff --git a/ConfirmAccount.php b/ConfirmAccount.php
index 608ef35..085bed1 100644
--- a/ConfirmAccount.php
+++ b/ConfirmAccount.php
@@ -23,7 +23,7 @@
        exit( 1 ) ;
 }
 
-$wgExtensionCredits['specialpage'][] = array(
+$GLOBALS['wgExtensionCredits']['specialpage'][] = array(
        'path'           => __FILE__,
        'name'           => 'Confirm User Accounts',
        'descriptionmsg' => 'confirmedit-desc',
@@ -42,9 +42,9 @@
 ConfirmAccountUISetup::defineResourceModules( $wgResourceModules );
 
 # Let some users confirm account requests and view credentials for created 
accounts
-$wgAvailableRights[] = 'confirmaccount'; // user can confirm account requests
-$wgAvailableRights[] = 'requestips'; // user can see IPs in request queue
-$wgAvailableRights[] = 'lookupcredentials'; // user can lookup info on 
confirmed users
+$GLOBALS['wgAvailableRights'][] = 'confirmaccount'; // user can confirm 
account requests
+$GLOBALS['wgAvailableRights'][] = 'requestips'; // user can see IPs in request 
queue
+$GLOBALS['wgAvailableRights'][] = 'lookupcredentials'; // user can lookup info 
on confirmed users
 
 # Actually register special pages
 ConfirmAccountUISetup::defineSpecialPages( $wgSpecialPages, 
$wgSpecialPageGroups );
@@ -55,15 +55,15 @@
 ConfirmAccountUISetup::defineHookHandlers( $wgHooks );
 
 # Check for account name collisions
-$wgHooks['AbortNewAccount'][] = 
'ConfirmAccountUIHooks::checkIfAccountNameIsPending';
+$GLOBALS['wgHooks']['AbortNewAccount'][] = 
'ConfirmAccountUIHooks::checkIfAccountNameIsPending';
 
 # Schema changes
-$wgHooks['LoadExtensionSchemaUpdates'][] = 
'ConfirmAccountUpdaterHooks::addSchemaUpdates';
+$GLOBALS['wgHooks']['LoadExtensionSchemaUpdates'][] = 
'ConfirmAccountUpdaterHooks::addSchemaUpdates';
 
 # ####### END HOOK CALLBACK FUNCTIONS #########
 
 # Load the extension after setup is finished
-$wgExtensionFunctions[] = 'efLoadConfirmAccount';
+$GLOBALS['wgExtensionFunctions'][] = 'efLoadConfirmAccount';
 
 /**
  * This function is for setup that has to happen in Setup.php
diff --git a/backend/schema/ConfirmAccountUpdater.hooks.php 
b/backend/schema/ConfirmAccountUpdater.hooks.php
index f747029..e22dde7 100644
--- a/backend/schema/ConfirmAccountUpdater.hooks.php
+++ b/backend/schema/ConfirmAccountUpdater.hooks.php
@@ -10,7 +10,7 @@
         */
        public static function addSchemaUpdates( DatabaseUpdater $updater ) {
                $base = dirname( __FILE__ );
-               if ( $updater->getDB()->getType() == 'mysql' ) {
+               if ( $updater->getDB()->getType() == 'mysql' || 
$updater->getDB()->getType() == 'sqlite' ) {
                        $base = "$base/mysql";
 
                        $updater->addExtensionTable( 'account_requests', 
"$base/ConfirmAccount.sql" );
diff --git a/backend/schema/mysql/ConfirmAccount.sql 
b/backend/schema/mysql/ConfirmAccount.sql
index f393339..792e740 100644
--- a/backend/schema/mysql/ConfirmAccount.sql
+++ b/backend/schema/mysql/ConfirmAccount.sql
@@ -6,7 +6,7 @@
 -- This stores all of our reviews,
 -- the corresponding tags are stored in the tag table
 CREATE TABLE IF NOT EXISTS /*_*/account_requests (
-  acr_id int unsigned NOT NULL auto_increment PRIMARY KEY,
+  acr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
   -- Usernames must be unique, must not be in the form of
   -- an IP address. _Shouldn't_ allow slashes or case
   -- conflicts. Spaces are allowed, and are _not_ converted
@@ -70,7 +70,7 @@
 -- When accounts are confirmed, the identity info goes here
 CREATE TABLE IF NOT EXISTS /*_*/account_credentials (
   -- Revision ID #
-  acd_id int unsigned NOT NULL auto_increment PRIMARY KEY,
+  acd_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
   -- Foreign key to user.user_id
   acd_user_id int unsigned NOT NULL,
   -- Optional 'real name' to be displayed in credit listings
diff --git a/backend/schema/mysql/patch-account_credentials.sql 
b/backend/schema/mysql/patch-account_credentials.sql
index 896484f..efcf286 100644
--- a/backend/schema/mysql/patch-account_credentials.sql
+++ b/backend/schema/mysql/patch-account_credentials.sql
@@ -8,7 +8,7 @@
 -- When accounts are confirmed, the identity info goes here
 CREATE TABLE IF NOT EXISTS /*_*/account_credentials (
   -- Revision ID #
-  acd_id int unsigned NOT NULL auto_increment PRIMARY KEY,
+  acd_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
   -- Foreign key to user.user_id
   acd_user_id int unsigned NOT NULL,
   -- Optional 'real name' to be displayed in credit listings
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..b04332e
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,4 @@
+{
+       "name": "mediawiki/confirmaccount",
+       "description": "Gives bureaucrats the ability to confirm account 
requests",
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I262180f9d658b06d72a67325e3d152ae6f8ac956
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmAccount
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>

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

Reply via email to