From 14908293a8e81f42e97cf72832fb29ef499efea2 Mon Sep 17 00:00:00 2001
From: hickert ";
+ foreach($this->dns as $dn){
+ add_lock ($dn, $this->ui->dn);
+ $dns_names .= $dn."\n";
+ }
+ $dns_names .="
";
+
+ /* Lock the current entry, so nobody will edit it during deletion */
+ $smarty->assign("intro", sprintf(_("You're about to delete the following user(s) %s"), @LDAP::fix($dns_names)));
+ $smarty->assign("multiple", true);
+ return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+ }
+ }
+
+
+
+
+ /********************
+ Delete MULTIPLE entries confirmed
+ ********************/
+
+ /* Confirmation for deletion has been passed. Users should be deleted. */
+ if (isset($_POST['delete_multiple_mimetype_confirm'])){
+
+ $ui = get_userinfo();
+
+ /* Remove user by user and check acls before removeing them */
+ foreach($this->dns as $key => $dn){
+
+ $acl = $ui->get_permissions($dn,"mimetypes/mimetype");
+ if(preg_match("/d/",$acl)){
+
+ /* Delete request is permitted, perform LDAP action */
+ $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn,"mimetypes");
+ $this->mimetabs->set_acl_base($dn);
+ $this->mimetabs->delete ();
+ gosa_log ("Mime type object'".$dn."' has been removed");
+ unset ($this->mimetabs);
+ $this->mimetabs= NULL;
+
+ } else {
+ /* Normally this shouldn't be reached, send some extra
+ logs to notify the administrator */
+ print_red (_("You are not allowed to delete this mime type!"));
+ gosa_log ("Warning: '".$this->ui->uid."' tried to trick group deletion.");
+ }
+ /* Remove lock file after successfull deletion */
+ del_lock ($dn);
+ unset($this->dns[$key]);
+ }
+ }
+
+
+ /********************
+ Delete MULTIPLE entries Canceled
+ ********************/
+
+ /* Remove lock */
+ if(isset($_POST['delete_multiple_mimetype_cancel'])){
+ foreach($this->dns as $key => $dn){
+ del_lock ($dn);
+ unset($this->dns[$key]);
+ }
+ }
+
+
/****************
Delete mime type
****************/
@@ -276,6 +361,7 @@ class mimetypeManagement extends plugin
add_lock ($this->dn, $this->ui->dn);
$smarty= get_smarty();
$smarty->assign("intro", sprintf(_("You're about to delete the mime type '%s'."), @LDAP::fix($this->dn)));
+ $smarty->assign("multiple", false);
return($smarty->fetch (get_template_path('remove.tpl', TRUE)));
} else {
@@ -298,6 +384,7 @@ class mimetypeManagement extends plugin
$ui = get_userinfo();
$acl = $ui->get_permissions($this->dn,"mimetypes/mimetype");
if(preg_match("/d/",$acl)){
+
/* Delete request is permitted, perform LDAP action */
$this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes");
$this->mimetabs->set_acl_base($this->dn);
@@ -362,7 +449,7 @@ class mimetypeManagement extends plugin
/* Display dialog with system list */
$this->DivListMimeTypes->parent = $this;
$this->DivListMimeTypes->execute();
- $this->DivListMimeTypes->AddDepartments($this->DivListMimeTypes->selectedBase);
+ $this->DivListMimeTypes->AddDepartments($this->DivListMimeTypes->selectedBase,3,1);
$this->reload();
$this->DivListMimeTypes->setEntries($this->mimetypes);
return($this->DivListMimeTypes->Draw());
@@ -486,6 +573,20 @@ class mimetypeManagement extends plugin
return(false);
}
+
+ function list_get_selected_items()
+ {
+ $ids = array();
+ foreach($_POST as $name => $value){
+ if(preg_match("/^item_selected_[0-9]*$/",$name)){
+ $id = preg_replace("/^item_selected_/","",$name);
+ $ids[$id] = $id;
+ }
+ }
+ return($ids);
+ }
+
+
/* Save to LDAP */
function save()
{
diff --git a/plugins/admin/mimetypes/remove.tpl b/plugins/admin/mimetypes/remove.tpl
index 593c8175d..30c423318 100755
--- a/plugins/admin/mimetypes/remove.tpl
+++ b/plugins/admin/mimetypes/remove.tpl
@@ -10,8 +10,14 @@
- - - + {if $multiple} + + + + {else} + + + + {/if}
-- 2.30.2