r23808 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23807‎ | r23808 | r23809 >
Date:23:24, 6 July 2007
Author:robchurch
Status:old
Tags:
Comment:
* Add option to maintenance/createAndPromote.php to give the user bureaucrat permissions (--bureaucrat)
* Some --help on maintenance/createAndPromote.php
* Tweak maintenance/README
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/README (modified) (history)
  • /trunk/phase3/maintenance/createAndPromote.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/README
@@ -39,6 +39,9 @@
4040 cleanupSpam.php
4141 Mass-revert insertion of linkspam
4242
 43+ createAndPromote.php
 44+ Create a user with administrator (and optionally, bureaucrat) permissions
 45+
4346 deleteOldRevisions.php
4447 Erase old revisions of pages from the database
4548
@@ -52,10 +55,10 @@
5356 XML dump importer
5457
5558 importImages.php
56 - Imports images into the wiki
 59+ Import images into the wiki
5760
5861 importTextFile.php
59 - Imports the contents of a text file into a wiki page
 62+ Import the contents of a text file into a wiki page
6063
6164 nukePage.php
6265 Wipe a page and all revisions from the database
Index: trunk/phase3/maintenance/createAndPromote.php
@@ -6,10 +6,16 @@
77 * @addtogroup Maintenance
88 * @author Rob Church <robchur@gmail.com>
99 */
10 -
 10+
 11+$options = array( 'help', 'bureaucrat' );
1112 require_once( 'commandLine.inc' );
1213
13 -if( !count( $args ) == 2 ) {
 14+if( isset( $options['help'] ) ) {
 15+ showHelp();
 16+ exit( 1 );
 17+}
 18+
 19+if( count( $args ) < 2 ) {
1420 echo( "Please provide a username and password for the new account.\n" );
1521 die( 1 );
1622 }
@@ -36,6 +42,8 @@
3743
3844 # Promote user
3945 $user->addGroup( 'sysop' );
 46+if( isset( $option['bureaucrat'] ) )
 47+ $user->addGroup( 'bureaucrat' );
4048
4149 # Increment site_stats.ss_users
4250 $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
@@ -43,4 +51,17 @@
4452
4553 echo( "done.\n" );
4654
 55+function showHelp() {
 56+ echo( <<<EOT
 57+Create a new user account with administrator rights
4758
 59+USAGE: php createAndPromote.php [--bureaucrat|--help] <username> <password>
 60+
 61+ --bureaucrat
 62+ Grant the account bureaucrat rights
 63+ --help
 64+ Show this help information
 65+
 66+EOT
 67+ );
 68+}
\ No newline at end of file
Index: trunk/phase3/RELEASE-NOTES
@@ -309,6 +309,8 @@
310310 * Fix maintenance/importImages.php so it doesn't barf PHP errors when no
311311 suitable files are found, and make the list of extensions an option (defaults
312312 to $wgFileExtensions)
 313+* Add option to maintenance/createAndPromote.php to give the user bureaucrat
 314+ permissions (--bureaucrat)
313315
314316 == Languages updated since 1.10 ==
315317

Follow-up revisions

RevisionCommit summaryAuthorDate
r23912Merged revisions 23662-23909 via svnmerge from...david18:11, 9 July 2007

Status & tagging log