Last modified: 2011-05-15 10:06:57 UTC
Created attachment 7363 [details] Patch for creating maintenance/createUser.php script MediaWiki currently has no command-line tool for adding non-admin users, so I wrote one. This should prove quite handy for automated deployment, testing etc, in fact I was rather surprised this didn't exist already. Usage: php createUser.php username password [groups ...] [--help] options: --help show this message Sample: "php maintenance/createUser.php SampleBot botsekret Bot" creates a user called 'SampleBot' with password 'botsekret' and adds him to group 'Bot'. Note: This overlaps partly with the existing createAndPromote.php for creating admins, but this is more flexible and should probably replace that?
Thanks for the patch. Though, for inclusion, it would be better if you were subclassing the Maintenance class (see CreateAndPremote.php as an example), and following the pattern of the current maintenance script Also, some validation of the group names? Thanks
Created attachment 7371 [details] Newer version of the above patch, with group checking
Thanks I'm guessing you've based it on the 1.15 format? It's changed quite a lot for 1.16 See http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/createAndPromote.php?view=markup
Why not just rename createAndPromote and change the promotion part to a parameter instead of creating yet another file that does the exact same thing
Perhaps just replace createandpromote with this, since it does the same and wouldn't need much changing (just tell the users that they need to give the admin group name) compared to changing how the promoting works in the existing file.
Made changes in r87480 to createAndPromote.php to allow it to create a non-sysop user.