* Add option to maintenance/createAndPromote.php to give the user bureaucrat permissi...
authorRob Church <robchurch@users.mediawiki.org>
Fri, 6 Jul 2007 23:24:10 +0000 (23:24 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Fri, 6 Jul 2007 23:24:10 +0000 (23:24 +0000)
* Some --help on maintenance/createAndPromote.php
* Tweak maintenance/README

RELEASE-NOTES
maintenance/README
maintenance/createAndPromote.php

index 9e80cea..df25f06 100644 (file)
@@ -309,6 +309,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Fix maintenance/importImages.php so it doesn't barf PHP errors when no
   suitable files are found, and make the list of extensions an option (defaults
   to $wgFileExtensions)
+* Add option to maintenance/createAndPromote.php to give the user bureaucrat
+  permissions (--bureaucrat)
 
 == Languages updated since 1.10 ==
 
index c789956..7ef358b 100644 (file)
@@ -39,6 +39,9 @@ installations.
        cleanupSpam.php
        Mass-revert insertion of linkspam
 
+       createAndPromote.php
+       Create a user with administrator (and optionally, bureaucrat) permissions
+
        deleteOldRevisions.php
        Erase old revisions of pages from the database
 
@@ -52,10 +55,10 @@ installations.
        XML dump importer
        
        importImages.php
-       Imports images into the wiki
+       Import images into the wiki
        
        importTextFile.php
-       Imports the contents of a text file into a wiki page
+       Import the contents of a text file into a wiki page
 
        nukePage.php
        Wipe a page and all revisions from the database
index a775cfd..af4a1da 100644 (file)
@@ -6,10 +6,16 @@
  * @addtogroup Maintenance
  * @author Rob Church <robchur@gmail.com>
  */
+
+$options = array( 'help', 'bureaucrat' );
 require_once( 'commandLine.inc' );
 
-if( !count( $args ) == 2 ) {
+if( isset( $options['help'] ) ) {
+       showHelp();
+       exit( 1 );
+}
+
+if( count( $args ) < 2 ) {
        echo( "Please provide a username and password for the new account.\n" );
        die( 1 );
 }
@@ -36,6 +42,8 @@ $user->setToken();
 
 # Promote user
 $user->addGroup( 'sysop' );
+if( isset( $option['bureaucrat'] ) )
+       $user->addGroup( 'bureaucrat' );
 
 # Increment site_stats.ss_users
 $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
@@ -43,4 +51,17 @@ $ssu->doUpdate();
 
 echo( "done.\n" );
 
+function showHelp() {
+       echo( <<<EOT
+Create a new user account with administrator rights
+
+USAGE: php createAndPromote.php [--bureaucrat|--help] <username> <password>
+
+       --bureaucrat
+               Grant the account bureaucrat rights
+       --help
+               Show this help information
 
+EOT
+       );
+}
\ No newline at end of file