Last modified: 2011-05-15 10:06:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T25495, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23495 - Command-line tool for adding users
Command-line tool for adding users
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
1.16.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Chad H.
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-13 03:07 UTC by Jani Patokallio
Modified: 2011-05-15 10:06 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch for creating maintenance/createUser.php script (1.30 KB, patch)
2010-05-13 03:07 UTC, Jani Patokallio
Details
Newer version of the above patch, with group checking (1.90 KB, patch)
2010-05-13 23:25 UTC, Jani Patokallio
Details

Description Jani Patokallio 2010-05-13 03:07:33 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?
Comment 1 Sam Reed (reedy) 2010-05-13 22:30:25 UTC
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
Comment 2 Jani Patokallio 2010-05-13 23:25:54 UTC
Created attachment 7371 [details]
Newer version of the above patch, with group checking
Comment 3 Sam Reed (reedy) 2010-05-13 23:28:38 UTC
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
Comment 4 OverlordQ 2010-05-13 23:30:02 UTC
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
Comment 5 p858snake 2010-05-14 04:55:01 UTC
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.
Comment 6 Chad H. 2011-05-05 05:12:16 UTC
Made changes in r87480 to createAndPromote.php to allow it to create a non-sysop user.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links