From 75a4eeca94a2188fc0fba0e350040708f0b0c66e Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 12 Dec 2008 07:23:46 +0000 Subject: [PATCH] Removed unnecessary del_lock git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13268 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 3 +++ gosa-core/plugins/admin/acl/class_aclManagement.inc | 5 +++-- gosa-core/plugins/admin/acl/main.inc | 2 -- gosa-core/plugins/admin/departments/main.inc | 1 - gosa-core/plugins/admin/groups/main.inc | 1 - gosa-core/plugins/admin/users/main.inc | 1 - gosa-plugins/fai/admin/fai/class_faiManagement.inc | 2 +- gosa-plugins/fai/admin/fai/main.inc | 2 -- gosa-plugins/gofax/gofax/blocklists/main.inc | 1 - gosa-plugins/gofon/gofon/conference/main.inc | 1 - gosa-plugins/gofon/gofon/macro/main.inc | 1 - gosa-plugins/goto/admin/applications/main.inc | 1 - gosa-plugins/goto/admin/devices/main.inc | 1 - gosa-plugins/goto/admin/mimetypes/main.inc | 1 - gosa-plugins/sudo/admin/sudo/main.inc | 2 -- gosa-plugins/systems/admin/systems/main.inc | 1 - 16 files changed, 7 insertions(+), 19 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 5d500d4b3..70121687e 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -660,6 +660,9 @@ function del_lock ($object) { global $config; + echo "$object
"; + print_a(debug_backtrace()); + if(is_array($object)){ foreach($object as $obj){ del_lock($obj); diff --git a/gosa-core/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc index 650389ca7..b76a86214 100644 --- a/gosa-core/plugins/admin/acl/class_aclManagement.inc +++ b/gosa-core/plugins/admin/acl/class_aclManagement.inc @@ -641,10 +641,11 @@ class aclManagement extends plugin /* Remove acl lock if a DN is marked as "currently edited" */ if (isset($this->acltabs->dn)){ del_lock ($this->acltabs->dn); - }else{ + }elseif(!empty($this->dn)){ del_lock ($this->dn); + }elseif(count($this->dns)){ + del_lock ($this->dns); } - del_lock ($this->dns); } diff --git a/gosa-core/plugins/admin/acl/main.inc b/gosa-core/plugins/admin/acl/main.inc index 7e4bce0e4..ed3a0582c 100644 --- a/gosa-core/plugins/admin/acl/main.inc +++ b/gosa-core/plugins/admin/acl/main.inc @@ -24,7 +24,6 @@ if ($remove_lock){ if(session::is_set('macl')){ $macl = session::get('macl'); $macl->remove_lock(); - del_lock ($ui->dn); session::un_set ('macl'); } } else { @@ -49,7 +48,6 @@ if (!session::is_set('macl') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('macl'); } diff --git a/gosa-core/plugins/admin/departments/main.inc b/gosa-core/plugins/admin/departments/main.inc index 290c67df1..921be55f6 100644 --- a/gosa-core/plugins/admin/departments/main.inc +++ b/gosa-core/plugins/admin/departments/main.inc @@ -46,7 +46,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('department'); } diff --git a/gosa-core/plugins/admin/groups/main.inc b/gosa-core/plugins/admin/groups/main.inc index 6f6630ea1..e402b2a7e 100644 --- a/gosa-core/plugins/admin/groups/main.inc +++ b/gosa-core/plugins/admin/groups/main.inc @@ -49,7 +49,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('groupManagement'); } diff --git a/gosa-core/plugins/admin/users/main.inc b/gosa-core/plugins/admin/users/main.inc index 5e75fe18d..eade63a44 100644 --- a/gosa-core/plugins/admin/users/main.inc +++ b/gosa-core/plugins/admin/users/main.inc @@ -55,7 +55,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('userManagement'); } diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index 95a66d38b..1668c1250 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -1225,7 +1225,7 @@ class faiManagement extends plugin function remove_lock() { - if (isset($this->dn)){ + if (isset($this->dn) && !empty($this->dn)){ del_lock ($this->dn); } if(isset($this->dns) && is_array($this->dns) && count($this->dns)){ diff --git a/gosa-plugins/fai/admin/fai/main.inc b/gosa-plugins/fai/admin/fai/main.inc index d2543758c..88dfff1cc 100644 --- a/gosa-plugins/fai/admin/fai/main.inc +++ b/gosa-plugins/fai/admin/fai/main.inc @@ -22,7 +22,6 @@ if ($remove_lock){ if(session::is_set('FAI')){ $FAI = session::get('FAI'); $FAI->remove_lock(); - del_lock ($ui->dn); session::un_set ('FAI'); } } else { @@ -38,7 +37,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('FAI'); } /* Page header*/ diff --git a/gosa-plugins/gofax/gofax/blocklists/main.inc b/gosa-plugins/gofax/gofax/blocklists/main.inc index 7cbadac08..36d9edb1a 100644 --- a/gosa-plugins/gofax/gofax/blocklists/main.inc +++ b/gosa-plugins/gofax/gofax/blocklists/main.inc @@ -18,7 +18,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('blocklist'); } diff --git a/gosa-plugins/gofon/gofon/conference/main.inc b/gosa-plugins/gofon/gofon/conference/main.inc index 13c7d0ca4..1896d125b 100644 --- a/gosa-plugins/gofon/gofon/conference/main.inc +++ b/gosa-plugins/gofon/gofon/conference/main.inc @@ -42,7 +42,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('conference'); } diff --git a/gosa-plugins/gofon/gofon/macro/main.inc b/gosa-plugins/gofon/gofon/macro/main.inc index 9c0bc1bd3..9231bc01c 100644 --- a/gosa-plugins/gofon/gofon/macro/main.inc +++ b/gosa-plugins/gofon/gofon/macro/main.inc @@ -48,7 +48,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('macroManagement'); } diff --git a/gosa-plugins/goto/admin/applications/main.inc b/gosa-plugins/goto/admin/applications/main.inc index eaff4c322..f8233b272 100644 --- a/gosa-plugins/goto/admin/applications/main.inc +++ b/gosa-plugins/goto/admin/applications/main.inc @@ -42,7 +42,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('applicationManagement'); } diff --git a/gosa-plugins/goto/admin/devices/main.inc b/gosa-plugins/goto/admin/devices/main.inc index 45aaf4a43..00c39ba42 100644 --- a/gosa-plugins/goto/admin/devices/main.inc +++ b/gosa-plugins/goto/admin/devices/main.inc @@ -45,7 +45,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('DeviceManagement'); } diff --git a/gosa-plugins/goto/admin/mimetypes/main.inc b/gosa-plugins/goto/admin/mimetypes/main.inc index 0f398dee5..fcfd5167b 100644 --- a/gosa-plugins/goto/admin/mimetypes/main.inc +++ b/gosa-plugins/goto/admin/mimetypes/main.inc @@ -45,7 +45,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('MimeTypeManagement'); } diff --git a/gosa-plugins/sudo/admin/sudo/main.inc b/gosa-plugins/sudo/admin/sudo/main.inc index 396feff87..67738f861 100644 --- a/gosa-plugins/sudo/admin/sudo/main.inc +++ b/gosa-plugins/sudo/admin/sudo/main.inc @@ -24,7 +24,6 @@ if ($remove_lock){ if(session::is_set('sudoManagement')){ $sudoManagement = session::get('sudoManagement'); $sudoManagement->remove_lock(); - del_lock ($ui->dn); session::un_set ('sudoManagement'); } } else { @@ -50,7 +49,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('sudoManagement'); } diff --git a/gosa-plugins/systems/admin/systems/main.inc b/gosa-plugins/systems/admin/systems/main.inc index 99dc629f3..d5fa21e39 100644 --- a/gosa-plugins/systems/admin/systems/main.inc +++ b/gosa-plugins/systems/admin/systems/main.inc @@ -37,7 +37,6 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); session::un_set ('systems'); } -- 2.30.2