From 8b5f266116b798ea0fbd03225bff08b3fb2c91f5 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 30 Dec 2009 17:14:01 +0000 Subject: [PATCH] Fixed department removal git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14990 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_departmentManagement.inc | 48 +++++++++++++++++++ .../admin/departments/tabs_department.inc | 4 +- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc index ac40ce062..136c23935 100644 --- a/gosa-core/plugins/admin/departments/class_departmentManagement.inc +++ b/gosa-core/plugins/admin/departments/class_departmentManagement.inc @@ -107,6 +107,54 @@ class departmentManagement extends management } + + function removeEntryConfirmed($action="",$target=array(),$all=array(), + $altTabClass="",$altTabType="",$altAclCategory="") + { + $types= $this->get_support_departments(); + $headpage = $this->getHeadpage(); + + $tabType = $this->tabType; + $tabClass = $this->tabClass; + $aclCategory = $this->aclCategory; + if(!empty($altTabClass)) $tabClass = $altTabClass; + if(!empty($altTabType)) $tabType = $altTabType; + if(!empty($altAclCategory)) $aclCategory = $altAclCategory; + + @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel confirmed!"); + + foreach($this->dns as $key => $dn){ + + // Check permissions, are we allowed to remove this object? + $type = $headpage->getType($dn); + $tabType = $types[$type]['TAB']; + + $acl = $this->ui->get_permissions($dn, $this->aclCategory."/".$this->aclPlugin); + if(preg_match("/d/",$acl)){ + + // Delete the object + $this->dn = $dn; + $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory, true, true); + $this->tabObject->set_acl_base($this->dn); + $this->tabObject->delete (); + $this->tabObject->parent = &$this; + + // Remove the lock for the current object. + del_lock($this->dn); + } else { + msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG); + new log("security","groups/".get_class($this),$dn,array(),"Tried to trick deletion."); + } + } + + // Cleanup + $this->remove_lock(); + $this->closeDialogs(); + } + + + + // Overriden save handler - We've to take care about the department tagging here. protected function saveChanges() { diff --git a/gosa-core/plugins/admin/departments/tabs_department.inc b/gosa-core/plugins/admin/departments/tabs_department.inc index bac1988cc..1c37179d2 100644 --- a/gosa-core/plugins/admin/departments/tabs_department.inc +++ b/gosa-core/plugins/admin/departments/tabs_department.inc @@ -42,7 +42,9 @@ class deptabs extends tabs /* Add references/acls/snapshots */ $this->addSpecialTabs(); - $this->by_object['acl']->skipTagging= TRUE; + if(isset($this->by_object['acl'])){ + $this->by_object['acl']->skipTagging= TRUE; + } } function check($ignore_account= FALSE) -- 2.30.2