Last modified: 2013-10-23 18:17:15 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 T37623, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35623 - createAndPromote.php: Change to allow promotion only
createAndPromote.php: Change to allow promotion only
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
1.18.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-31 01:24 UTC by Pablo Castellano (IRC: pablog)
Modified: 2013-10-23 18:17 UTC (History)
7 users (show)

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


Attachments
userPromote.php: Grants an account administrator rights (1.93 KB, application/x-httpd-php)
2012-03-31 01:24 UTC, Pablo Castellano (IRC: pablog)
Details
createAndPromote.php now supports --grant-only (3.80 KB, patch)
2012-04-05 01:27 UTC, Pablo Castellano (IRC: pablog)
Details

Description Pablo Castellano (IRC: pablog) 2012-03-31 01:24:00 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.
Comment 1 p858snake 2012-03-31 01:28:05 UTC
Could probably bundle C&P with this into one script and just have a switch to activate the creation part.
Comment 2 Pablo Castellano (IRC: pablog) 2012-03-31 01:40:43 UTC
Another idea is modifying C&P so that it doesn't end when account exists.

I can adapt the patch if you prefer.
Comment 3 Chad H. 2012-03-31 16:56:36 UTC
I think that'd be the better route to go.
Comment 4 Mark A. Hershberger 2012-04-02 17:14:18 UTC
(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!
Comment 5 Pablo Castellano (IRC: pablog) 2012-04-05 01:27:53 UTC
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?
Comment 6 Max Semenik 2012-04-05 19:06:12 UTC
userPromote.php has problems with --help: it uses inconsistent terminology (sysop vs. administrator) and mDescription doesn't mention promotion to bureaucrats.
Comment 7 Sumana Harihareswara 2012-05-25 02:41:40 UTC
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
Comment 8 Pablo Castellano (IRC: pablog) 2012-05-25 06:37:11 UTC
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 :)
Comment 9 Mark A. Hershberger 2012-08-30 23:57:10 UTC
I needed this recently.  See Gerrit change Id0cd0e49
Comment 10 MZMcBride 2012-08-31 00:09:37 UTC
(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?"?
Comment 11 Sam Reed (reedy) 2013-05-26 10:22:11 UTC
(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.
Comment 12 Tyler Romeo 2013-05-26 11:46:25 UTC
(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.

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


Navigation
Links