mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
DbUserGroupBackend: Really clear memberships and parent relations...
...when removing a group. refs #8826
This commit is contained in:
parent
1385295e4e
commit
e936c76ca9
@ -122,6 +122,27 @@ class DbUserGroupBackend extends DbRepository implements UserGroupBackendInterfa
|
|||||||
parent::update($table, $bind, $filter);
|
parent::update($table, $bind, $filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete table rows, optionally limited by using a filter
|
||||||
|
*
|
||||||
|
* @param string $table
|
||||||
|
* @param Filter $filter
|
||||||
|
*/
|
||||||
|
public function delete($table, Filter $filter = null)
|
||||||
|
{
|
||||||
|
if ($table === 'group') {
|
||||||
|
parent::delete('group_membership', $filter);
|
||||||
|
$idQuery = $this->select(array('group_id'));
|
||||||
|
if ($filter !== null) {
|
||||||
|
$idQuery->applyFilter($filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->update('group', array('parent' => null), Filter::where('parent', $idQuery->fetchColumn()));
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::delete($table, $filter);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the groups the given user is a member of
|
* Return the groups the given user is a member of
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user