From e90692bc720cf4c520ee36c603395cf1e1b80b45 Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 9 Jan 2009 14:21:48 +0000 Subject: Closes #668: Banning now works through a flag in the users_entity table. Database upgrade required. * Added ElggUser::isBanned(); * Added 'banned' column to users_entity * Modified ban() and unban() * Modified pam functions to check $user->isBanned() * Modified login() to check $user->isBanned() * Modified sessions_init() to check isBanned() and destroy session accordingly * Modified profile views to highlight banned users and prevent menus for non-admin users. git-svn-id: https://code.elgg.org/elgg/trunk@2554 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engine/lib/api.php') 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 } -- cgit v1.2.3