Code

Fixed blocklistm remove acl check.
[gosa.git] / gosa-plugins / gofax / gofax / blocklists / class_blocklistManagement.inc
index 1092f1d19912b0e0995773d232ba8552b204569d..8d2d9b6fe4190761db61b0782a34c983d2f9e4cc 100644 (file)
@@ -2,7 +2,7 @@
 class blocklist extends plugin
 {
   /* Definitions */
-  var $plHeadline= "FAX Blocklists";
+  var $plHeadline= "FAX blocklists";
   var $plDescription= "This does something";
 
   var $blocklists       = array();
@@ -147,10 +147,16 @@ class blocklist extends plugin
           $this->dn= "";
           $this->dialog = NULL;
           session::un_set('objectinfo');
+        }else{
+
+          /* Reinitialize tab */
+          if($this->dialog instanceof tabs){
+            $this->dialog->re_init();
+          }
         }
       } else {
         /* Errors found, show message */
-        show_errors ($message);
+        msg_dialog::displayChecks($message);
       }
     }
 
@@ -214,15 +220,14 @@ class blocklist extends plugin
           $this->dns[$id] = $dn;
         }
 
-        $dns_names = "<br><pre>";
+        $dns_names = array();
         foreach($this->dns as $dn){
           add_lock ($dn, $this->ui->dn);
-          $dns_names .= $dn."\n";
+          $dns_names[]=@LDAP::fix( $dn);
         }
-        $dns_names .="</pre>";
 
         /* Lock the current entry, so nobody will edit it during deletion */
-        $smarty->assign("info",     sprintf(_("You're about to delete the following blocklists(s) %s"), @LDAP::fix($dns_names)));
+        $smarty->assign("info", msgPool::deleteInfo($dns_names,_("blocklist")));
         $smarty->assign("multiple", true);
         return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
       }
@@ -238,13 +243,13 @@ class blocklist extends plugin
 
       /* Remove user by user and check acls before removeing them */
       foreach($this->dns as $key => $dn){
+        $this->dn = $dn;
         if (preg_match("/d/",$this->ui->get_permissions($this->dn,"gofaxlist/blocklistGeneric"))){
-          $this->dn = $dn;
           $this->dialog = new faxblocktabs($this->config,$this->config->data['TABS']['FAXBLOCKTABS'],$this->dn);
           $this->dialog->delete();
           $this->dialog = NULL;
         } else {
-          msg_dialog::display(_("Permission error"), sprintf(_("You have not permission to delete '%s'!"), $dn), ERROR_DIALOG);
+          msg_dialog::display(_("Permission error"), msgPool::permDelete($dn), ERROR_DIALOG);
         }
         /* Remove lock file after successfull deletion */
         del_lock ($dn);
@@ -283,7 +288,7 @@ class blocklist extends plugin
 
         // Lock this dn for editing
         add_lock ($this->dn, $this->ui->dn);
-        $smarty->assign("info", sprintf(_("You're about to delete the blocklist '%s'."), $this->dn));
+        $smarty->assign("info", msgPool::deleteInfo(@LDAP::fix($this->dn),_("blocklist")));
         $smarty->assign("multiple", false);
         return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
       }
@@ -302,7 +307,7 @@ class blocklist extends plugin
         $this->dialog = NULL;
         del_lock ($this->dn);
       } else {
-        msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG);
+        msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG);
       }
     }
 
@@ -404,6 +409,9 @@ class blocklist extends plugin
   function save_object()
   {
     $this->DivListBlocklist->save_object();
+    if(is_object($this->CopyPasteHandler)){
+      $this->CopyPasteHandler->save_object();
+    }
   }