From 6955e992dbbc5a6e4a1844fa30475aacf6262701 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 8 Jan 2009 15:28:56 +0000 Subject: Refs #668, #640: Cleaner interface provided for banning. git-svn-id: https://code.elgg.org/elgg/trunk@2546 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/users.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'engine/lib') diff --git a/engine/lib/users.php b/engine/lib/users.php index c3ad2abfd..9b8594a93 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -155,6 +155,27 @@ return parent::delete(); + } + + /** + * Ban this user. + * + * @param string $reason Optional reason + */ + public function ban($reason = "") + { + if (disable_user_entities($this->guid)) + return $this->disable($reason); + + return false; + } + + /** + * Unban this user. + */ + public function unban() + { + return enable_entity($this->guid); } /** -- cgit v1.2.3