From 6b8f6a3d871fe950ff3ec24191f74eec1e565adb Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 7 Aug 2004 12:46:58 +0000 Subject: [PATCH] removing all it's acl-rights if an account gets deleted, admin only removed the run-rights, but not the grants or other rights --- phpgwapi/inc/class.accounts.inc.php | 3 +++ phpgwapi/inc/class.acl.inc.php | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/phpgwapi/inc/class.accounts.inc.php b/phpgwapi/inc/class.accounts.inc.php index 01fabe42a6..0b62a8dedf 100644 --- a/phpgwapi/inc/class.accounts.inc.php +++ b/phpgwapi/inc/class.accounts.inc.php @@ -368,6 +368,9 @@ { $this->cache_invalidate($accountid); accounts_::delete($accountid); + + // delete all acl_entries belonging to that user or group + $GLOBALS['phpgw']->acl->delete($accountid); } function create($account_info,$default_prefs=True) diff --git a/phpgwapi/inc/class.acl.inc.php b/phpgwapi/inc/class.acl.inc.php index 7d3a058761..fe28e7ae6e 100644 --- a/phpgwapi/inc/class.acl.inc.php +++ b/phpgwapi/inc/class.acl.inc.php @@ -769,5 +769,18 @@ return $grants; } + + /** + * Deletes all ACL entries for an account (user or group) + * + * @param int $account_id acount-id + */ + function delete_account($account_id) + { + if ((int) $account_id) + { + $this->db->query('DELETE FROM phpgw_acl WHERE acl_account='.(int)$account_id,__LINE__,__FILE__); + } + } } //end of acl class ?>