summaryrefslogtreecommitdiff
path: root/maintenance/createAndPromote.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-09-14 13:18:58 +0200
committerPierre Schmitz <pierre@archlinux.de>2007-09-14 13:18:58 +0200
commit8f416baead93a48e5799e44b8bd2e2c4859f4e04 (patch)
treecd47ac55eb80a39e3225e8b4f3161b88ea16c2cf /maintenance/createAndPromote.php
parentd7d08bd1a17618c7d77a6b9b2989e9f7293d6ed6 (diff)
auf Version 1.11 aktualisiert; Login-Bug behoben
Diffstat (limited to 'maintenance/createAndPromote.php')
-rw-r--r--maintenance/createAndPromote.php27
1 files changed, 24 insertions, 3 deletions
diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php
index 7ef48e08..af4a1dab 100644
--- a/maintenance/createAndPromote.php
+++ b/maintenance/createAndPromote.php
@@ -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