END_OF_USERROLE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$dry = have_option('dry-run');
if (preg_match('!/group/(\d+)/id!', $oprofile->getUri(), $matches)) {
$id = intval($matches[1]);
$group = Local_group::getKV('group_id', $id);
- if ($group) {
+ if ($group instanceof Local_group) {
$nick = $group->nickname;
} else {
$nick = '<deleted>';
} else if (preg_match('!/user/(\d+)!', $uri, $matches)) {
$id = intval($matches[1]);
$user = User::getKV('id', $id);
- if ($user) {
+
+ if ($user instanceof User) {
$nick = $user->nickname;
} else {
$nick = '<deleted>';
}
+
echo "user $id ($nick) hidden by $uri";
} else {
echo "$uri matched query, but we don't recognize it.\n";