X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fcommand.php;h=5ffa5bda0de9e0611cc402d0c69da82869782828;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=7b1d651e48956844fee0680a6ac2adca01d6df12;hpb=8884a5255fb90fda67b63fa0d4252d77176337e5;p=quix0rs-gnu-social.git diff --git a/scripts/command.php b/scripts/command.php index 7b1d651e48..5ffa5bda0d 100755 --- a/scripts/command.php +++ b/scripts/command.php @@ -33,7 +33,7 @@ Perform commands on behalf of a user, such as sub, unsub, join, drop END_OF_USERROLE_HELP; -require_once INSTALLDIR.'/scripts/commandline.inc'; +require_once INSTALLDIR.'/scripts/commandline.inc.php'; function interpretCommand($user, $body) { @@ -51,21 +51,22 @@ function interpretCommand($user, $body) if (have_option('i', 'id')) { $id = get_option_value('i', 'id'); - $user = User::staticGet('id', $id); + $user = User::getKV('id', $id); if (empty($user)) { print "Can't find user with ID $id\n"; exit(1); } } else if (have_option('n', 'nickname')) { $nickname = get_option_value('n', 'nickname'); - $user = User::staticGet('nickname', $nickname); + $user = User::getKV('nickname', $nickname); if (empty($user)) { print "Can't find user with nickname '$nickname'\n"; exit(1); } } else if (have_option('o', 'owner')) { - $user = User::siteOwner(); - if (empty($user)) { + try { + $user = User::siteOwner(); + } catch (ServerException $e) { print "Site has no owner.\n"; exit(1); }