summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b4e1e49)
raw | patch | inline | side by side (parent: b4e1e49)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 15 May 2008 08:51:23 +0000 (08:51 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 15 May 2008 08:51:23 +0000 (08:51 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10906 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/departments/class_departmentManagement.inc | patch | blob | history | |
gosa-core/plugins/admin/departments/main.inc | patch | blob | history |
diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc
index 43b92fd64cf0ab734c7cc9711cd5be60b032ebbf..91b54e2cfbbc4ac1356bb68f071f473636ec639c 100644 (file)
/* Vars to handle operations after saving the department
Recursive move && tagging */
var $ObjectInSaveMode = false; // Is true, if current object wasn't saved right now
+ var $dns = array();
function departmentManagement (&$config, &$ui)
{
Var init
***************/
- session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^dep_edit_.*/","/^dep_del_.*/","/^item_selected/","/^remove_multiple_departments/"));
+ session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^dep_edit_.*/","/^dep_del_.*/","/^item_selected/","/^remove_multiple_departments/","/^menu_action/"));
/* Reload departments */
$smarty = get_smarty();
if(count($ids)){
foreach($ids as $id){
$id = base64_decode($id);
- $dn = $this->config->departments[$id];
-
- if (($user= get_lock($dn)) != ""){
- return(gen_locked_message ($user, $dn));
- }
- $this->dns[$id] = $dn;
+ $this->dns[$id] = $dn = $this->config->departments[$id];
+ }
+
+ /* Check locks */
+ if ($user= get_multiple_locks($this->dns)){
+ return(gen_locked_message($user,$this->dns));
}
$dns_names = array();
foreach($this->dns as $dn){
- add_lock ($dn, $this->ui->dn);
$dns_names[] = @LDAP::fix($dn);
}
+ 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));
} else {
msg_dialog::display(_("Permission error"), msgPool::permDelete(), WARNING_DIALOG);
}
- /* Remove lock file after successfull deletion */
- del_lock ($dn);
- unset($this->dns[$key]);
}
+
+ /* Remove lock file after successfull deletion */
+ $this->remove_lock();
+ $this->dns = array();
}
/* Remove lock */
if(isset($_POST['delete_multiple_department_cancel'])){
- foreach($this->dns as $key => $dn){
- del_lock ($dn);
- unset($this->dns[$key]);
- }
+
+ /* Remove lock file after successfull deletion */
+ $this->remove_lock();
+ $this->dns = array();
}
$this->config->get_departments();
$this->ObjectInSaveMode = false;
if ($this->dn != "new"){
- del_lock ($this->dn);
+ $this->remove_lock();
}
unset ($this->deptabs);
$this->deptabs= NULL;
* Cancel dialog
*/
if (isset($_POST['edit_cancel']) || isset($_POST['delete_cancel']) || isset($_POST['delete_department_confirm'])){
- del_lock ($this->dn);
- unset($this->depdabs);
+ $this->remove_lock();
$this->deptabs= NULL;
session::un_set('objectinfo');
}
if (isset($this->dn)){
del_lock ($this->dn);
}
+ if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){
+ del_lock($this->dn);
+ }
+ if(isset($this->dns) && is_array($this->dns) && count($this->dns)){
+ del_lock($this->dns);
+ }
}
function save_object()
diff --git a/gosa-core/plugins/admin/departments/main.inc b/gosa-core/plugins/admin/departments/main.inc
index 8a6c69698b8dd9f1f54c47c7ee64800984dfd08f..e3a64da8a04878d62f65e65221cc79bdeae16379 100644 (file)
if(session::is_set('department')){
$department = session::get('department');
$department->remove_lock();
- del_lock ($ui->dn);
session::un_set ('department');
}
} else {