Page MenuHomePhabricator

createAndPromote.php: Change to allow promotion only
Closed, ResolvedPublic

Description

Author: pablo

Description:
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.


Version: 1.18.x
Severity: normal

Attached:

Details

Reference
bz35623

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:15 AM
bzimport set Reference to bz35623.
bzimport added a subscriber: Unknown Object (MLST).

Could probably bundle C&P with this into one script and just have a switch to activate the creation part.

pablo wrote:

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!

pablo wrote:

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?

Attached:

userPromote.php has problems with --help: it uses inconsistent terminology (sysop vs. administrator) and mDescription doesn't mention promotion to bureaucrats.

sumanah wrote:

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

pablo wrote:

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.