Code

Updated management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Apr 2010 12:55:06 +0000 (12:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Apr 2010 12:55:06 +0000 (12:55 +0000)
-Update object removal - ACL check;

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17520 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_acl.inc
gosa-core/include/class_management.inc

index 9302fbeb316651713be2a29278356909163f5a86..fc3f4224aba5b9a4f64ca09ff11edfa2bada9b95 100644 (file)
@@ -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 = "<input type='radio' name='selected_role' value='".base64_encode($dn)."' checked>";
       }else{
         $option = "<input type='radio' name='selected_role' value='".base64_encode($dn)."'>";
       }
-      $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());
   } 
 
 
index c03e860e55c7dd92337ca4897299733ab65ffc06..0015aa90f46989d6e0ebdde0c91ac198a193c3c1 100644 (file)
@@ -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