From ef66e2cb67f5656eb0cfbe872d397d3abb819fa5 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("info", sprintf(_("You're about to delete the following object group(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_ogroup_confirm'])){
+
+ /* Remove user by user and check acls before removeing them */
+ foreach($this->dns as $key => $dn){
+
+ $acl = $this->ui->get_permissions($dn, "ogroups");
+ if (preg_match('/d/', $acl)){
+
+ /* Delete request is permitted, perform LDAP action */
+ $this->ogroup= new ogrouptabs($this->config,$this->config->data['TABS']['OGROUPTABS'], $dn);
+ $this->ogroup->delete ();
+ gosa_log ("Object group'".$this->dn."' has been removed");
+ unset ($this->ogroup);
+ $this->ogroup= 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 object group!"));
+ 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_ogroup_cancel'])){
+ foreach($this->dns as $key => $dn){
+ del_lock ($dn);
+ unset($this->dns[$key]);
+ }
+ }
+
+
/****************
Delete object group
****************/
@@ -152,6 +232,7 @@ class ogroupManagement extends plugin
/* Lock the current entry, so nobody will edit it during deletion */
add_lock ($this->dn, $this->ui->dn);
$smarty->assign("info", sprintf(_("You're about to delete the object group '%s'."), @LDAP::fix($this->dn)));
+ $smarty->assign("multiple", false);
return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
} else {
@@ -321,7 +402,7 @@ class ogroupManagement extends plugin
/* Add departments if subsearch is disabled */
if(!$this->DivListOGroup->SubSearch){
- $this->DivListOGroup->AddDepartments($this->DivListOGroup->selectedBase,4);
+ $this->DivListOGroup->AddDepartments($this->DivListOGroup->selectedBase,4,1);
}
$this->reload ();
$this->DivListOGroup->setEntries($this->ogrouplist);
@@ -439,6 +520,19 @@ class ogroupManagement extends plugin
}
+ 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);
+ }
+
+
function copyPasteHandling($s_action,$s_entry)
{
if($this->CopyPasteHandler){
diff --git a/plugins/admin/ogroups/remove.tpl b/plugins/admin/ogroups/remove.tpl
index fd14a5a67..720156b97 100644
--- a/plugins/admin/ogroups/remove.tpl
+++ b/plugins/admin/ogroups/remove.tpl
@@ -11,8 +11,14 @@
- - - + {if $multiple} + + + + {else} + + + + {/if}
diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index 177be0a36..e5cec852e 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -138,7 +138,7 @@ class divListUsers extends MultiSelectWindow /* Multiple options */ $listhead .= " "; + title='"._("Remove selected user")."' alt='"._("Remove user")."' name='remove_multiple_users'> "; $listhead .="";; $this->SetListHeader($listhead); diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 9d24b558f..676e568b9 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -79,7 +79,7 @@ class userManagement extends plugin foreach(array("del" => "user_del", "edit" => "user_edit", "new" => "user_new", "new_tpl" => "user_tplnew", - "del_multiple" => "^remove_multiple_user", + "del_multiple" => "^remove_multiple_users", "create_user_from_tpl" => "userfrom_tpl", "change_pw" => "user_chgpw", "editPaste" => "editPaste", "copy" => "copy", @@ -305,8 +305,6 @@ class userManagement extends plugin $this->dns[$id] = $dn; } - - $dns_names = ""; foreach($this->dns as $dn){ add_lock ($dn, $this->ui->dn); -- 2.30.2