From e62103b8d9463bf409881d17a4bda93f3ca3208d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 9 Dec 2008 08:47:30 +0000 Subject: Move code to delete users and add/remove users from groups into the model. --- core/helpers/access.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/helpers') diff --git a/core/helpers/access.php b/core/helpers/access.php index 8f2453df..f4e98082 100644 --- a/core/helpers/access.php +++ b/core/helpers/access.php @@ -200,7 +200,10 @@ class access_Core { self::_drop_columns($name, $group->id); } self::_drop_columns($name, 0); - ORM::factory("permission")->where("name", $name)->find()->delete(); + $permission = ORM::factory("permission")->where("name", $name)->find(); + if ($permission->loaded) { + $permission->delete(); + } } /** -- cgit v1.2.3