mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
MINOR when you delete a user from a group, they are also removed from any sub groups. (from r87119) (from r98158)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102754 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c1aa73b7cc
commit
ca7d87078f
@ -622,6 +622,15 @@ class LeftAndMain extends Controller {
|
|||||||
$statusUpdates['modified'][$node->ID] = array(
|
$statusUpdates['modified'][$node->ID] = array(
|
||||||
'TreeTitle'=>$node->TreeTitle
|
'TreeTitle'=>$node->TreeTitle
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Update all dependent pages
|
||||||
|
if($virtualPages = DataObject::get("VirtualPage", "CopyContentFromID = $node->ID")) {
|
||||||
|
foreach($virtualPages as $virtualPage) {
|
||||||
|
$statusUpdates['modified'][$virtualPage->ID] = array(
|
||||||
|
'TreeTitle' => $virtualPage->TreeTitle()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->response->addHeader(
|
$this->response->addHeader(
|
||||||
'X-Status',
|
'X-Status',
|
||||||
|
@ -483,12 +483,22 @@ class MemberTableField_ItemRequest extends ComplexTableField_ItemRequest {
|
|||||||
if($this->ctf->Can('delete') !== true) {
|
if($this->ctf->Can('delete') !== true) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$groupID = $this->ctf->sourceID();
|
||||||
|
$group = DataObject::get_by_id('Group', $groupID);
|
||||||
|
|
||||||
// if a group limitation is set on the table, remove relation.
|
// if a group limitation is set on the table, remove relation.
|
||||||
// otherwise remove the record from the database
|
// otherwise remove the record from the database
|
||||||
if($this->ctf->getGroup()) {
|
if($this->ctf->getGroup()) {
|
||||||
$groupID = $this->ctf->sourceID();
|
$groupID = $this->ctf->sourceID();
|
||||||
|
|
||||||
|
// Remove from direct group relationship
|
||||||
$this->dataObj()->Groups()->remove($groupID);
|
$this->dataObj()->Groups()->remove($groupID);
|
||||||
|
|
||||||
|
// Remove from all child groups as well
|
||||||
|
foreach($group->getAllChildren() as $subGroup) {
|
||||||
|
$this->dataObj()->Groups()->remove($subGroup);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->dataObj()->delete();
|
$this->dataObj()->delete();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user