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 ?>