mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-07 20:19:20 -04:00
Patch for ticket #1769. Remove the rows in groups_users when the user or the group is deleted.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user