Minor script fixes

This commit is contained in:
Mikael Nordfeldth 2014-05-19 14:46:35 +02:00
parent f37fc4247a
commit 37e57610fb
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ $shortoptions = 'i:n:g:G:';
$longoptions = array('id=', 'nickname=', 'group=', 'group-id=');
$helptext = <<<END_OF_HELP
addusertogroup.php [options]
joingroup.php [options]
Adds a local user to a local group.
@ -46,7 +46,7 @@ try {
$gnick = get_option_value('g', 'group');
$lgroup = Local_group::getKV('nickname', $gnick);
}
if (empty($lgroup)) {
if (!$lgroup instanceof Local_group) {
throw new Exception("No such local group: $gnick");
}
$group = User_group::getKV('id', $lgroup->group_id);

View File

@ -46,7 +46,7 @@ try {
$gnick = get_option_value('g', 'group');
$lgroup = Local_group::getKV('nickname', $gnick);
}
if (empty($lgroup)) {
if (!$lgroup instanceof Local_group) {
throw new Exception("No such local group: $gnick");
}
$group = User_group::getKV('id', $lgroup->group_id);