Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] CO-229 and deleting COUs

Subject: COmanage Developers List

List archive

[comanage-dev] CO-229 and deleting COUs


Chronological Thread 
  • From: Scott Koranda <>
  • To: comanage-dev <>
  • Subject: [comanage-dev] CO-229 and deleting COUs
  • Date: Tue, 13 Mar 2012 16:23:55 -0500

Hi,

CouController.php contains this code in the checkDeleteDependencies()
method when it is trying to determine if the Cou has any
children:

foreach($this->cur_co['Cou'] as $k => $v)
{
if($v['parent_id'] == $curdata['Cou']['id'])
{
if($this->restful)
$this->restResultHeader(403, "Child COU Exists");
else
$this->Session->setFlash(_txt('er.cou.child',
array(Sanitize::html($curdata['Cou']['name']))), '', array(), 'error');

return(false);
}
}


Is there any reason that cannot be replaced by

$childCOUs = $curdata['Cou']['ChildCou'];
if (!empty($childCOUs)){
if($this->restful)
$this->restResultHeader(403, "Child COU Exists");
else
$this->Session->setFlash(_txt('er.cou.child',
array(Sanitize::html($curdata['Cou']['name']))), '', array(), 'error');

}

Put another way, since the Cou model has a field where it
keeps track of its children, why not just check for children?

Thanks,

Scott



Archive powered by MHonArc 2.6.16.

Top of Page