summaryrefslogtreecommitdiff
path: root/scripts/command.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@status.net>2010-08-10 15:01:29 -0700
committerBrion Vibber <brion@status.net>2010-08-10 15:01:29 -0700
commit819d33210d298de74b64dc7ead79e9d9b223b12e (patch)
tree902d42087e633b96e12bef699f6c80e7342c9312 /scripts/command.php
parent8f071b2818e8321ea910df612016175f65093402 (diff)
parent08fc6053ec55e911b842fd05dafc5e0c99c4e992 (diff)
Merge branch '0.9.x' into tinymce
Diffstat (limited to 'scripts/command.php')
-rwxr-xr-xscripts/command.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/command.php b/scripts/command.php
index 6041b02eb..7b1d651e4 100755
--- a/scripts/command.php
+++ b/scripts/command.php
@@ -20,8 +20,8 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-$shortoptions = 'i:n:';
-$longoptions = array('id=', 'nickname=');
+$shortoptions = 'i:n:o';
+$longoptions = array('id=', 'nickname=', 'owner');
$helptext = <<<END_OF_USERROLE_HELP
command.php [options] [command line]
@@ -29,13 +29,12 @@ Perform commands on behalf of a user, such as sub, unsub, join, drop
-i --id ID of the user
-n --nickname nickname of the user
+ -o --owner use the site owner
END_OF_USERROLE_HELP;
require_once INSTALLDIR.'/scripts/commandline.inc';
-
-
function interpretCommand($user, $body)
{
$inter = new CommandInterpreter();
@@ -50,8 +49,6 @@ function interpretCommand($user, $body)
}
}
-
-
if (have_option('i', 'id')) {
$id = get_option_value('i', 'id');
$user = User::staticGet('id', $id);
@@ -66,6 +63,12 @@ if (have_option('i', 'id')) {
print "Can't find user with nickname '$nickname'\n";
exit(1);
}
+} else if (have_option('o', 'owner')) {
+ $user = User::siteOwner();
+ if (empty($user)) {
+ print "Site has no owner.\n";
+ exit(1);
+ }
} else {
print "You must provide either an ID or a nickname.\n\n";
print $helptext;