aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/api.php')
-rw-r--r--engine/lib/api.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/engine/lib/api.php b/engine/lib/api.php
index 198f3efb0..4b7820c7d 100644
--- a/engine/lib/api.php
+++ b/engine/lib/api.php
@@ -847,7 +847,9 @@
if ($validated_userid) {
$u = get_entity($validated_userid);
if (!$u) return false; // Could we get the user?
- if (!login($u)) return false; // Fail if we couldn't log the user in (likely means they were banned).
+ if ( (!$u instanceof ElggUser)) return false; // Not an elgg user
+ if ($u->isBanned()) return false; // User is banned
+ if (!login($u)) return false; // Fail if we couldn't log the user in
}