Mattflaschen has uploaded a new change for review.

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

Change subject: Allow using createAndPromote.php with a custom group name
......................................................................

Allow using createAndPromote.php with a custom group name

Change-Id: I1274b065e3dad917e545f9278b996da014d87ae9
---
M maintenance/createAndPromote.php
1 file changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/222068/1

diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php
index 79f7254..c1a09a9 100644
--- a/maintenance/createAndPromote.php
+++ b/maintenance/createAndPromote.php
@@ -43,6 +43,14 @@
                foreach ( self::$permitRoles as $role ) {
                        $this->addOption( $role, "Add the account to the 
{$role} group" );
                }
+
+               $this->addOption(
+                       'custom-group',
+                       'Any group name 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,13 @@
                        $inGroups = $user->getGroups();
                }
 
+               $groups = array_filter( self::$permitRoles, array( $this, 
'hasOption' ) );
+               if ( $this->hasOption( 'custom-group' ) ) {
+                       $groups[] = $this->getOption( 'custom-group' );
+               }
+
                $promotions = array_diff(
-                       array_filter( self::$permitRoles, array( $this, 
'hasOption' ) ),
+                       $groups,
                        $inGroups
                );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1274b065e3dad917e545f9278b996da014d87ae9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

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

Reply via email to