Code

Updated conference acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 May 2008 06:15:38 +0000 (06:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 May 2008 06:15:38 +0000 (06:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11056 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/gofon/gofon/conference/class_divListConferences.inc
gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc

index 0c10b8257b8799ac8f16469edeb8a5699d8cb60e..7bd2d7205dedaabcb6a302069f8d329950411038 100644 (file)
@@ -152,10 +152,8 @@ class divListConference extends MultiSelectWindow
       $s.= "..|---|\n";
       $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      if(is_object($this->parent->CopyPasteHandler) && preg_match("/(r.*d|d.*r)/",$acl_all)){
-        $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-          "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-      }
+      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
     }
 
     /* Copy & paste icons */
index 02c2f642b6a146f03f81aa0ef246f8bc48e08c95..dacf2a8bf42f9415bac12f7b34b8907db58571f2 100644 (file)
@@ -167,30 +167,43 @@ class phoneConferenceManagment extends plugin
     if ($s_action=="del_multiple"){
       $ids = $this->list_get_selected_items();
 
+      $this->dns = array();
       if(count($ids)){
-
-        /* Collect dns */
+        $disallowed = array();
         foreach($ids as $id){
-          $this->dns[$id] = $this->conferences[$id]['dn'];
+          $dn = $this->conferences[$id]['dn'];
+          $acl = $this->ui->get_permissions($dn, "gofonconference/conference");
+          if(preg_match("/d/",$acl)){
+            $this->dns[$id] = $dn;
+          }else{
+            $disallowed[] = $dn;
+          }
         }
 
-        /* Check locks */
-        if ($user= get_multiple_locks($this->dns)){
-          return(gen_locked_message($user,$this->dns));
+        if(count($disallowed)){
+          msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG);
         }
 
-        /* Prepare entry list to be displayed */
-        $dns_names = array();
-        foreach($this->dns as $dn){
-          $dns_names[] = @LDAP::fix($dn);
-        }
+        if(count($this->dns)){
 
-        /* Lock the current entry, so nobody will edit it during deletion */
-        add_lock ($this->dns, $this->ui->dn);
+          /* Check locks */
+          if ($user= get_multiple_locks($this->dns)){
+            return(gen_locked_message($user,$this->dns));
+          }
+
+          /* Prepare entry list to be displayed */
+          $dns_names = array();
+          foreach($this->dns as $dn){
+            $dns_names[] = @LDAP::fix($dn);
+          }
 
-        $smarty->assign("info", msgPool::deleteInfo($dns_names,_("conference")));
-        $smarty->assign("multiple", true);
-        return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+          /* Lock the current entry, so nobody will edit it during deletion */
+          add_lock ($this->dns, $this->ui->dn);
+
+          $smarty->assign("info", msgPool::deleteInfo($dns_names,_("conference")));
+          $smarty->assign("multiple", true);
+          return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+        }
       }
     }
 
@@ -465,13 +478,21 @@ class phoneConferenceManagment extends plugin
       return("");
     }
 
+    $ui = get_userinfo();
+
     /* Add a single entry to queue */
     if($s_action == "cut" || $s_action == "copy"){
 
       /* Cleanup object queue */
       $this->CopyPasteHandler->cleanup_queue();
       $dn = $this->conferences[$s_entry]['dn'];
-      $this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference");
+
+      if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofonconference"))){
+        $this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference");
+      }
+      if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofonconference"))){
+        $this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference");
+      }
     }
 
     /* Add entries to queue */
@@ -484,10 +505,10 @@ class phoneConferenceManagment extends plugin
       foreach($this->list_get_selected_items() as $id){
         $dn = $this->conferences[$id]['dn'];
 
-        if($s_action == "copy_multiple"){
+        if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofonconference"))){
           $this->CopyPasteHandler->add_to_queue($dn,"copy","conferencetabs","CONFERENCETABS","gofonconference");
         }
-        if($s_action == "cut_multiple"){
+        if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofonconference"))){
           $this->CopyPasteHandler->add_to_queue($dn,"cut","conferencetabs","CONFERENCETABS","gofonconference");
         }
       }