Paladox has uploaded a new change for review.

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

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

Revert "Revert "Convert to globals and add composer support""

This reverts commit 23f51615a49a5a05dc0d538303065ab06b1c62af.

Change-Id: I8f2fabb95a2be6efda1ebc9c8a2557281c2bbe78
---
M ConfirmAccount.config.php
M ConfirmAccount.php
A composer.json
3 files changed, 60 insertions(+), 35 deletions(-)


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

diff --git a/ConfirmAccount.config.php b/ConfirmAccount.config.php
index 350b766..eef2802 100644
--- a/ConfirmAccount.config.php
+++ b/ConfirmAccount.config.php
@@ -5,26 +5,26 @@
 # When configuring globals, set them at LocalSettings.php instead
 
 # Set the person's bio as their userpage?
-$wgMakeUserPageFromBio = true;
+$GLOBALS['wgMakeUserPageFromBio'] = true;
 # Text to add to bio pages if the above option is on
-$wgAutoUserBioText = '';
+$GLOBALS['wgAutoUserBioText'] = '';
 
 # Create a user talk page with a welcome message for accepted users.
 # The message can be customized by editing MediaWiki:confirmaccount-welc.
-$wgAutoWelcomeNewUsers = true;
+$GLOBALS['wgAutoWelcomeNewUsers'] = true;
 
 # How long to store rejected requests
-$wgRejectedAccountMaxAge = 7 * 24 * 3600; // 1 week
+$GLOBALS['wgRejectedAccountMaxAge'] = 7 * 24 * 3600; // 1 week
 # How long after accounts have been requested/held before they count as 
'rejected'
-$wgConfirmAccountRejectAge = 30 * 24 * 3600; // 1 month
+$GLOBALS['wgConfirmAccountRejectAge'] = 30 * 24 * 3600; // 1 month
 
 # How many requests can an IP make at once?
-$wgAccountRequestThrottle = 1;
+$GLOBALS['wgAccountRequestThrottle'] = 1;
 # Can blocked users with "prevent account creation" request accounts?
-$wgAccountRequestWhileBlocked = false;
+$GLOBALS['wgAccountRequestWhileBlocked'] = false;
 
 # Which form elements to show at Special:RequestAccount
-$wgConfirmAccountRequestFormItems = array(
+$GLOBALS['wgConfirmAccountRequestFormItems'] = array(
        # Let users make names other than their "real name"
        'UserName'        => array( 'enabled' => true ),
        # Real name of user
@@ -44,7 +44,7 @@
 );
 
 # If files can be attached, what types can be used? (MIME data is checked)
-$wgAccountRequestExts = array( 'txt', 'pdf', 'doc', 'latex', 'rtf', 'text', 
'wp', 'wpd', 'sxw' );
+$GLOBALS['wgAccountRequestExts'] = array( 'txt', 'pdf', 'doc', 'latex', 'rtf', 
'text', 'wp', 'wpd', 'sxw' );
 
 # Prospective account request types.
 # Format is an array of (integer => (subpage param,user group,autotext)) pairs.
@@ -53,32 +53,32 @@
 # When a request of a certain type is approved, the new user:
 # (a) is placed in the <user group> group (if not User or *)
 # (b) has <autotext> appended to his or her user page
-$wgAccountRequestTypes = array(
+$GLOBALS['wgAccountRequestTypes'] = array(
        0 => array( 'authors', 'user', null )
 );
 
 # If set, will add {{DEFAULTSORT:sortkey}} to userpages for auto-categories.
 # The sortkey will be made by doing a regex search and replace on the title.
 # Set this variable to false to avoid sortkey use.
-$wgConfirmAccountSortkey = false;
+$GLOBALS['wgConfirmAccountSortkey'] = false;
 // For example, the below will do {{DEFAULTSORT:firstname, lastname}}
 # $wgConfirmAccountSortkey = array( '/^(.+) ([^ ]+)$/', '$2, $1' );
 
 # IMPORTANT: do we store the user's notes and credentials
 # for sucessful account request? This will be stored indefinetely
 # and will be accessible to users with crediential lookup permissions
-$wgConfirmAccountSaveInfo = true;
+$GLOBALS['wgConfirmAccountSaveInfo'] = true;
 
 # Send an email to this address when account requestors confirm their email.
 # Set to false to skip this. It might be useful to point this to a mailing 
list.
-$wgConfirmAccountContact = false;
+$GLOBALS['wgConfirmAccountContact'] = false;
 
 # If ConfirmEdit is installed and set to trigger for createaccount,
 # inject catpchas for requests too?
-$wgConfirmAccountCaptchas = true;
+$GLOBALS['wgConfirmAccountCaptchas'] = true;
 
 # Storage repos. Has B/C for when this used FileStore.
-$wgConfirmAccountFSRepos = array(
+$GLOBALS['wgConfirmAccountFSRepos'] = array(
        'accountreqs' => array( # Location of attached files for pending 
requests
                'name'       => 'accountreqs',
                'directory'  => isset( $wgFileStore['accountreqs'] ) ?
@@ -100,21 +100,21 @@
 );
 
 # Restrict account creation
-$wgGroupPermissions['*']['createaccount'] = false;
-$wgGroupPermissions['user']['createaccount'] = false;
+$GLOBALS['wgGroupPermissions']['*']['createaccount'] = false;
+$GLOBALS['wgGroupPermissions']['user']['createaccount'] = false;
 # Grant account queue rights
-$wgGroupPermissions['bureaucrat']['confirmaccount'] = true;
+$GLOBALS['wgGroupPermissions']['bureaucrat']['confirmaccount'] = true;
 # Receive emails when an account confirms its email address
 # $wgGroupPermissions['bureaucrat']['confirmaccount-notify'] = true;
 # This right has the request IP show when confirming accounts
-$wgGroupPermissions['bureaucrat']['requestips'] = true;
+$GLOBALS['wgGroupPermissions']['bureaucrat']['requestips'] = true;
 
 # If credentials are stored, this right lets users look them up
-$wgGroupPermissions['bureaucrat']['lookupcredentials'] = true;
+$GLOBALS['wgGroupPermissions']['bureaucrat']['lookupcredentials'] = true;
 
 # Show notice for open requests to admins?
 # This is cached, but still can be expensive on sites with thousands of 
requests.
-$wgConfirmAccountNotice = true;
+$GLOBALS['wgConfirmAccountNotice'] = true;
 
 # End of configuration variables.
 # ########
diff --git a/ConfirmAccount.php b/ConfirmAccount.php
index 803570b..c814564 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' => 'confirmaccount-desc',
@@ -36,34 +36,34 @@
 
 # Define were PHP files and i18n files are located
 require( dirname( __FILE__ ) . '/ConfirmAccount.setup.php' );
-ConfirmAccountSetup::defineSourcePaths( $wgAutoloadClasses, $wgMessagesDirs, 
$wgExtensionMessagesFiles  );
+ConfirmAccountSetup::defineSourcePaths( $GLOBALS['wgAutoloadClasses'], 
$GLOBALS['wgMessagesDirs'], $GLOBALS['wgExtensionMessagesFiles']  );
 
 # Define JS/CSS modules and file locations
-ConfirmAccountUISetup::defineResourceModules( $wgResourceModules );
+ConfirmAccountUISetup::defineResourceModules( $GLOBALS['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 );
+ConfirmAccountUISetup::defineSpecialPages( $GLOBALS['wgSpecialPages'] );
 
 # ####### HOOK CALLBACK FUNCTIONS #########
 
 # UI-related hook handlers
-ConfirmAccountUISetup::defineHookHandlers( $wgHooks );
+ConfirmAccountUISetup::defineHookHandlers( $GLOBALS['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
@@ -71,11 +71,10 @@
  * @return void
  */
 function efLoadConfirmAccount() {
-       global $wgEnableEmail;
        # This extension needs email enabled!
        # Otherwise users can't get their passwords...
-       if ( !$wgEnableEmail ) {
-               echo "ConfirmAccount extension requires \$wgEnableEmail set to 
true.\n";
+       if ( !$GLOBALS['wgEnableEmail'] ) {
+               echo "ConfirmAccount extension requires 
\$GLOBALS['wgEnableEmail'] set to true.\n";
                exit( 1 ) ;
        }
 }
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..6e8ed90
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,26 @@
+{
+       "name"       : "mediawiki/confirmaccount",
+       "type"       : "mediawiki-extension",
+       "description": "Gives bureaucrats the ability to confirm account 
requests",
+       "keywords"   : [
+               "wiki",
+               "MediaWiki",
+               "extension"
+       ],
+       "homepage"   : 
"https://www.mediawiki.org/wiki/Extension:ConfirmAccount";,
+       "authors"    : [
+               {
+                       "name" : "Aaron Schulz"
+               }
+       ],
+       "support"    : {
+               "wiki"  : 
"https://www.mediawiki.org/wiki/Extension:ConfirmAccount";,
+               "forum" : 
"https://www.mediawiki.org/wiki/Extension_talk:ConfirmAccount";,
+               "source": 
"https://git.wikimedia.org/summary/mediawiki%2Fextensions%2FConfirmAccount";,
+               "issues": 
"https://www.mediawiki.org/wiki/Extension_talk:ConfirmAccount";,
+               "irc"   : "irc://irc.freenode.org/mediawiki"
+       },
+       "require"    : {
+               "php"                : ">=5.3.0"
+       }
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f2fabb95a2be6efda1ebc9c8a2557281c2bbe78
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