From: hickert Date: Wed, 7 Apr 2010 12:55:06 +0000 (+0000) Subject: Updated management X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=59a77a5a52ef00081af27f4b053c88c365ce1616;p=gosa.git Updated management -Update object removal - ACL check; git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17520 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_acl.inc b/gosa-core/include/class_acl.inc index 9302fbeb3..fc3f4224a 100644 --- a/gosa-core/include/class_acl.inc +++ b/gosa-core/include/class_acl.inc @@ -252,6 +252,16 @@ class acl extends plugin $this->sectionList->setHeader(array(_("Section"),_("Description"))); $this->sectionList->setDefaultSortColumn(1); $this->sectionList->setAcl('rwcdm'); // All ACLs, we filter on our own here. + + $this->roleList = new sortableListing(); + $this->roleList->setDeleteable(false); + $this->roleList->setEditable(false); + $this->roleList->setWidth("100%"); + $this->roleList->setHeight("120px"); + $this->roleList->setColspecs(array('20px','*','*')); + $this->roleList->setHeader(array(_("Used"),_("Name"),_("Description"))); + $this->roleList->setDefaultSortColumn(1); + $this->roleList->setAcl('rwcdm'); // All ACLs, we filter on our own here. } @@ -676,29 +686,25 @@ class acl extends plugin function buildRoleSelector($list) { - $D_List =new divSelectBox("Acl_Roles"); - $selected = $this->aclContents; if(!is_string($this->aclContents) || !isset($list[$this->aclContents])){ $selected = key($list); } - $str =""; + $data = $lData = array(); foreach($list as $dn => $values){ - if($dn == $selected){ $option = ""; }else{ $option = ""; } - - $field1 = array("string" => $option) ; - $field2 = array("string" => $values['cn'], "attach" => "style='width:200px;'") ; - $field3 = array("string" => $values['description'],"attach" => "style='border-right:0px;'") ; - - $D_List->AddEntry(array($field1,$field2,$field3)); + $data[] = postEncode($dn); + $lData[] = array('data'=>array($option, $values['cn'], $values['description'])); } - return($D_List->DrawList()); + print_a($list); + $this->roleList->setListData($data,$lData); + $this->roleList->update(); + return($this->roleList->render()); } diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index c03e860e5..0015aa90f 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -286,8 +286,12 @@ class management @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel requested!"); // Check permissons for each target + $h = $this->getHeadpage(); + $oTypes = $h->objectTypes; foreach($target as $dn){ - $acl = $this->ui->get_permissions($dn, $this->aclCategory."/".$this->aclPlugin); + $entry = $h->getEntry($dn); + $obj = $h->getObjectType($oTypes, $entry['objectClass']); + $acl = $this->ui->get_permissions($dn, $obj['category']."/".$obj['class']); if(preg_match("/d/",$acl)){ $this->dns[] = $dn; }else{ @@ -309,7 +313,6 @@ class management // Add locks $dns_names = array(); $types = array(); - $h = $this->getHeadpage(); // Build list of object -labels foreach($h->objectTypes as $type){ @@ -355,10 +358,15 @@ class management @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel confirmed!"); + // Check permissons for each target + $h = $this->getHeadpage(); + $oTypes = $h->objectTypes; foreach($this->dns as $key => $dn){ + $entry = $h->getEntry($dn); + $obj = $h->getObjectType($oTypes, $entry['objectClass']); + $acl = $this->ui->get_permissions($dn, $obj['category']."/".$obj['class']); // Check permissions, are we allowed to remove this object? - $acl = $this->ui->get_permissions($dn, $aclCategory."/".$aclPlugin); if(preg_match("/d/",$acl)){ // Delete the object