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 application(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_application_confirm'])){
+
+ /* Remove user by user and check acls before removeing them */
+ foreach($this->dns as $key => $dn){
+
+ $ui = get_userinfo();
+ $acl = $ui->get_permissions($dn ,"application/application");
+ if (preg_match('/d/', $acl)){
+
+ /* Delete request is permitted, perform LDAP action */
+ $this->apptabs= new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn,"application");
+ $this->apptabs->set_acl_base($dn);
+ $this->apptabs->delete ();
+ gosa_log ("Application object'".$dn."' has been removed");
+ unset ($this->apptabs);
+ $this->apptabs= 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 application!"));
+ 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_application_cancel'])){
+ foreach($this->dns as $key => $dn){
+ del_lock ($dn);
+ unset($this->dns[$key]);
+ }
+ }
+
/****************
Delete app
****************/
@@ -369,7 +451,7 @@ class applicationManagement extends plugin
/* Display dialog with system list */
$this->DivListApplication->parent = $this;
$this->DivListApplication->execute();
- $this->DivListApplication->AddDepartments($this->DivListApplication->selectedBase);
+ $this->DivListApplication->AddDepartments($this->DivListApplication->selectedBase,3,1);
$this->reload();
$this->DivListApplication->setEntries($this->applications);
return($this->DivListApplication->Draw());
@@ -477,6 +559,19 @@ class applicationManagement 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);
+ }
+
+
/* Save to LDAP */
function save()
{
diff --git a/plugins/admin/applications/class_divListApplication.inc b/plugins/admin/applications/class_divListApplication.inc
index e81ca4e07..19aa04b87 100755
--- a/plugins/admin/applications/class_divListApplication.inc
+++ b/plugins/admin/applications/class_divListApplication.inc
@@ -47,6 +47,13 @@ class divListApplication extends MultiSelectWindow
$action_col_size += 38;
}
+
+ /* Toggle all selected / deselected */
+ $chk = "";
+
+ /* set Page header */
+ $this->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'"));
$this->AddHeader(array("string" => " ", "attach" => "style='text-align:center;width:20px;'"));
$this->AddHeader(array("string" => _("Application name")." / "._("Department"), "attach" => "style=''"));
$this->AddHeader(array("string" => _("Actions"), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'"));
@@ -143,8 +150,13 @@ class divListApplication extends MultiSelectWindow
/* And the rest, a base selection box */
$listhead .= _("Base")." ".
" ".
- "";
+ title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ";
+
+ /* Multiple options */
+ $listhead .= " ";
+
+ $listhead .="";
$this->SetListHeader($listhead);
}
@@ -225,10 +237,14 @@ class divListApplication extends MultiSelectWindow
}else{
$desc = " - [ ".$val['description'][0]." ]";
}
+
+ /* Create each field */
+ $field0 = array("string" => "" ,
+ "attach" => "style='width:20px;'");
$field1 = array("string" => sprintf($applimg,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
$field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)), "attach" => "style='' ".$title);
$field3 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
- $this->AddElement(array($field1,$field2,$field3));
+ $this->AddElement(array($field0,$field1,$field2,$field3));
}
}
diff --git a/plugins/admin/applications/remove.tpl b/plugins/admin/applications/remove.tpl
index 5b4c3e823..8598ed857 100644
--- a/plugins/admin/applications/remove.tpl
+++ b/plugins/admin/applications/remove.tpl
@@ -10,8 +10,14 @@
- - - + {if $multiple} + + + + {else} + + + + {/if}
diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 676e568b9..f8b32dc3c 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -60,7 +60,7 @@ class userManagement extends plugin plugin::execute(); /* LOCK MESSAGE Vars */ - $_SESSION['LOCK_VARS_TO_USE'] = array("/^act$/","/^id$/","/^user_edit_/","/^user_del_/","/^item_selected/","/^remove_multiple_user/"); + $_SESSION['LOCK_VARS_TO_USE'] = array("/^act$/","/^id$/","/^user_edit_/","/^user_del_/","/^item_selected/","/^remove_multiple_users/"); $smarty = get_smarty(); // Smarty instance $s_action = ""; // Contains the action to be taken