From fbe821cd1be44565afdcc590e3565efb6663c310 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Fri, 6 Jul 2007 23:24:10 +0000 Subject: [PATCH] * Add option to maintenance/createAndPromote.php to give the user bureaucrat permissions (--bureaucrat) * Some --help on maintenance/createAndPromote.php * Tweak maintenance/README --- RELEASE-NOTES | 2 ++ maintenance/README | 7 +++++-- maintenance/createAndPromote.php | 25 +++++++++++++++++++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9e80ceae06..df25f06162 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/maintenance/README b/maintenance/README index c7899568e9..7ef358b8b9 100644 --- a/maintenance/README +++ b/maintenance/README @@ -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 diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php index a775cfdd09..af4a1dab99 100644 --- a/maintenance/createAndPromote.php +++ b/maintenance/createAndPromote.php @@ -6,10 +6,16 @@ * @addtogroup Maintenance * @author Rob Church */ - + +$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( << + + --bureaucrat + Grant the account bureaucrat rights + --help + Show this help information +EOT + ); +} \ No newline at end of file -- 2.20.1