summaryrefslogtreecommitdiff
path: root/maintenance/createAndPromote.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /maintenance/createAndPromote.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'maintenance/createAndPromote.php')
-rw-r--r--maintenance/createAndPromote.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php
index 79f72542..861b364b 100644
--- a/maintenance/createAndPromote.php
+++ b/maintenance/createAndPromote.php
@@ -43,6 +43,14 @@ class CreateAndPromote extends Maintenance {
foreach ( self::$permitRoles as $role ) {
$this->addOption( $role, "Add the account to the {$role} group" );
}
+
+ $this->addOption(
+ 'custom-groups',
+ 'Comma-separated list of groups to add the user to',
+ false,
+ true
+ );
+
$this->addArg( "username", "Username of new user" );
$this->addArg( "password", "Password to set (not required if --force is used)", false );
}
@@ -69,8 +77,19 @@ class CreateAndPromote extends Maintenance {
$inGroups = $user->getGroups();
}
+ $groups = array_filter( self::$permitRoles, array( $this, 'hasOption' ) );
+ if ( $this->hasOption( 'custom-groups' ) ) {
+ $customGroupsText = $this->getOption( 'custom-groups' );
+ if ( $customGroupsText !== '' ) {
+ $customGroups = explode( ',', $customGroupsText );
+ foreach ( $customGroups as $customGroup ) {
+ $groups[] = trim( $customGroup );
+ }
+ }
+ }
+
$promotions = array_diff(
- array_filter( self::$permitRoles, array( $this, 'hasOption' ) ),
+ $groups,
$inGroups
);