Code

Updated snapshot stuff, check acls here too.
[gosa.git] / gosa-plugins / sudo / admin / sudo / class_sudoManagement.inc
index 54d6dd5232a923501fd27a33c51a22b49ede24e6..624a6029c4fcac68f4bd126f79dda6da6bbe3473 100644 (file)
@@ -36,6 +36,8 @@ class sudoManagement extends plugin
   private $base           = "";
 
   private $start_pasting_copied_objects = FALSE;
+
+  public $acl_module = array("sudo");
  
   /*! \brief */ 
   public function __construct(&$config, &$ui)
@@ -255,7 +257,7 @@ class sudoManagement extends plugin
           add_lock($this->dns,$this->ui->dn);
 
           /* Lock the current entry, so nobody will edit it during deletion */
-          $smarty->assign("info", msgPool::deleteInfo($dns_names,_("Sudo role")));
+          $smarty->assign("info", msgPool::deleteInfo($this->dns,_("Sudo role")));
           return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
         }
       }
@@ -347,7 +349,7 @@ class sudoManagement extends plugin
     }
 
     /* Check if there is a snapshot dialog open */
-    if($str = $this->showSnapshotDialog(sudo::get_sudoers_ou($this->config),$this->get_used_snapshot_bases())){
+    if($str = $this->showSnapshotDialog(sudo::get_sudoers_ou($this->config),$this->get_used_snapshot_bases(),$this)){
       return($str);
     }
 
@@ -468,10 +470,10 @@ class sudoManagement extends plugin
       $this->CopyPasteHandler->cleanup_queue();
       $dn = $this->list[$s_entry]['dn'];
 
-      if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"sudo"))){
+      if($s_action == "copy" && $ui->is_copyable($dn,"sudo","sudo")){
         $this->CopyPasteHandler->add_to_queue($dn,$s_action,"sudotabs","SUDOTABS","sudo");
       }
-#      if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"sudo"))){
+#      if($s_action == "cut" && $ui->is_cutable($dn,"sudo","sudo")){ 
 #        $this->CopyPasteHandler->add_to_queue($dn,$s_action,"sudotabs","SUDOTABS","sudo");
 #      }
     }
@@ -486,10 +488,10 @@ class sudoManagement extends plugin
       foreach($this->list_get_selected_items() as $id){
         $dn = $this->list[$id]['dn'];
 
-        if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"sudo"))){
+        if($s_action == "copy_multiple" && $ui->is_copyable($dn,"sudo","sudo")){ 
           $this->CopyPasteHandler->add_to_queue($dn,"copy","sudotabs","SUDOTABS","sudo");
         }
-#        if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"sudo"))){
+#        if($s_action == "cut_multiple" && $ui->is_cutable($dn,"sudo","sudo")){
 #          $this->CopyPasteHandler->add_to_queue($dn,"cut","sudotabs","SUDOTABS","sudo");
 #        }
       }