Last modified: 2013-10-23 18:17:15 UTC
Created attachment 10354 [details] userPromote.php: Grants an account administrator rights Hello. I wrote a new maintenance script based on createAndPromote.php. It's called userPromote.php and it just grants an account administrador rights. It has been useful for me so I think it would be a good idea to include it in master, sure it will be useful for more people too. Regards, Pablo.
Could probably bundle C&P with this into one script and just have a switch to activate the creation part.
Another idea is modifying C&P so that it doesn't end when account exists. I can adapt the patch if you prefer.
I think that'd be the better route to go.
(In reply to comment #2) > Another idea is modifying C&P so that it doesn't end when account exists. > > I can adapt the patch if you prefer. Sounds great!
Created attachment 10378 [details] createAndPromote.php now supports --grant-only I have added an option called --grant-only to do that. I'm not happy with the ugly hack of declaring [password] optional and then checking if it's set but AFAIK mediawiki doesn't provide any way to make parameters dependant of other parameters. Notice that adding this option we keep compatibility with the previous version of C&P. What do you think?
userPromote.php has problems with --help: it uses inconsistent terminology (sysop vs. administrator) and mDescription doesn't mention promotion to bureaucrats.
Pablo, I might be wrong, but it looks like in his comment # 6 Max left a critique that you should respond to. I am thus marking this patch reviewed. Thanks again for the patch. Are you interested in revising it, and then using developer access to directly suggest it into our Git source control system? https://www.mediawiki.org/wiki/Developer_access https://www.mediawiki.org/wiki/Git/Workflow#How_to_submit_a_patch
Yes I still want to do it, but I'm very busy at the moment. After that I would ask for a developer account as you had already suggested me :)
I needed this recently. See Gerrit change Id0cd0e49
(In reply to comment #9) > I needed this recently. See Gerrit change Id0cd0e49 I think you should hint at the --force option in this line: $this->error( "account exists.", true ); Wouldn't it be better to have "account exists. Perhaps you want the --force option?"?
(In reply to comment #10) > Wouldn't it be better to have "account exists. Perhaps you want the --force > option?"? Which createAndPromote.php already has. I'm confused for the need of a separate script reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/core/maintenance$ php createAndPromote.php --sysop CATestSignup Account exists. Perhaps you want the --force option? reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/core/maintenance$ php createAndPromote.php --sysop CATestSignup --force wikidb-mw_: Promoting User:CATestSignup into sysop... done.
(In reply to comment #11) > (In reply to comment #10) > > Wouldn't it be better to have "account exists. Perhaps you want the --force > > option?"? > > Which createAndPromote.php already has. I'm confused for the need of a > separate > script > > > reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/core/maintenance$ php > createAndPromote.php --sysop CATestSignup > Account exists. Perhaps you want the --force option? > reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/core/maintenance$ php > createAndPromote.php --sysop CATestSignup --force > wikidb-mw_: Promoting User:CATestSignup into sysop... > done. I should note that, at the time this bug was filed, that option didn't exist. I think this bug can just be closed as RESOLVED FIXED, but somebody just forgot to do it.