Patch for ticket #1769. Remove the rows in groups_users when the user or the group is deleted.

This commit is contained in:
Tim Almdal
2011-08-04 20:29:06 -07:00
parent 3b8bd84629
commit 66a6986d37
2 changed files with 12 additions and 0 deletions

View File

@@ -43,6 +43,12 @@ class User_Model_Core extends ORM implements User_Definition {
$old = clone $this;
module::event("user_before_delete", $this);
parent::delete($id);
db::build()
->delete("groups_users")
->where("user_id", "=", empty($id) ? $old->id : $id)
->execute();
module::event("user_deleted", $old);
$this->groups_cache = null;
}