From 7d91fb5e49a03ff86feb758a77cad724964ecf0b Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 12 Dec 2008 14:54:13 +0000 Subject: [PATCH] Updated plugin creation && locking for all main.incs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13288 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 3 +++ gosa-core/plugins/admin/acl/main.inc | 2 +- gosa-core/plugins/admin/departments/main.inc | 2 +- gosa-core/plugins/admin/groups/main.inc | 2 +- gosa-core/plugins/admin/ogroups/main.inc | 2 +- gosa-core/plugins/admin/users/main.inc | 3 +-- gosa-core/plugins/personal/generic/main.inc | 11 ++--------- gosa-core/plugins/personal/password/main.inc | 3 +-- gosa-core/plugins/personal/posix/main.inc | 10 ++-------- gosa-plugins/addressbook/addons/addressbook/main.inc | 2 +- .../connectivity/personal/connectivity/main.inc | 11 ++--------- gosa-plugins/dak/addons/dak/main.inc | 2 +- gosa-plugins/dfs/addons/godfs/main.inc | 3 +-- gosa-plugins/fai/admin/fai/main.inc | 2 +- gosa-plugins/gofax/gofax/blocklists/main.inc | 2 +- gosa-plugins/gofax/gofax/faxaccount/main.inc | 7 ++----- gosa-plugins/gofax/gofax/faxreports/main.inc | 2 +- gosa-plugins/gofon/gofon/conference/main.inc | 2 +- gosa-plugins/gofon/gofon/fonreports/main.inc | 2 +- gosa-plugins/gofon/gofon/macro/main.inc | 2 +- gosa-plugins/gofon/gofon/phoneaccount/main.inc | 7 ++----- gosa-plugins/goto/addons/goto/main.inc | 4 +--- gosa-plugins/goto/admin/applications/main.inc | 2 +- gosa-plugins/goto/admin/devices/main.inc | 2 +- gosa-plugins/goto/admin/mimetypes/main.inc | 2 +- gosa-plugins/goto/personal/environment/main.inc | 11 ++--------- gosa-plugins/ldapmanager/addons/ldapmanager/main.inc | 3 +-- gosa-plugins/log/addons/logview/main.inc | 2 +- gosa-plugins/mail/addons/mailqueue/main.inc | 2 +- gosa-plugins/mail/personal/mail/main.inc | 12 ++---------- gosa-plugins/nagios/personal/nagios/main.inc | 11 ++--------- gosa-plugins/netatalk/personal/netatalk/main.inc | 10 ++-------- gosa-plugins/samba/personal/samba/main.inc | 11 ++--------- gosa-plugins/scalix/personal/scalix/main.inc | 11 ++--------- gosa-plugins/sudo/admin/sudo/main.inc | 2 +- gosa-plugins/systems/admin/systems/main.inc | 2 +- 36 files changed, 49 insertions(+), 120 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index b604e7c1b..7302cfdc7 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -599,6 +599,7 @@ function ldap_expired_account($config, $userdn, $username) function add_lock($object, $user) { global $config; + echo "$object
"; /* Remember which entries were opened as read only, because we don't need to remove any locks for them later. @@ -660,6 +661,8 @@ function del_lock ($object) { global $config; + echo "$object
"; + if(is_array($object)){ foreach($object as $obj){ del_lock($obj); diff --git a/gosa-core/plugins/admin/acl/main.inc b/gosa-core/plugins/admin/acl/main.inc index 8f55ab840..82fb5b003 100644 --- a/gosa-core/plugins/admin/acl/main.inc +++ b/gosa-core/plugins/admin/acl/main.inc @@ -38,7 +38,7 @@ if ( $cleanup ){ $display= "No headpage yet for this module"; /* Create usermanagement object on demand */ - if (!session::is_set('macl') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('macl')){ session::set('macl',new aclManagement($config, $ui)); } $macl = session::get('macl'); diff --git a/gosa-core/plugins/admin/departments/main.inc b/gosa-core/plugins/admin/departments/main.inc index bd114694a..2cf55f745 100644 --- a/gosa-core/plugins/admin/departments/main.inc +++ b/gosa-core/plugins/admin/departments/main.inc @@ -36,7 +36,7 @@ if ( $cleanup ){ }else{ /* Create usermanagement object on demand */ - if (!session::is_set('department') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('department')){ session::set('department',new departmentManagement($config, $ui)); } $department = session::get('department'); diff --git a/gosa-core/plugins/admin/groups/main.inc b/gosa-core/plugins/admin/groups/main.inc index 58af63689..30fd058be 100644 --- a/gosa-core/plugins/admin/groups/main.inc +++ b/gosa-core/plugins/admin/groups/main.inc @@ -36,7 +36,7 @@ if ( $cleanup ){ }else{ /* Create groupManagement object on demand */ - if (!session::is_set('groupManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('groupManagement')){ session::set('groupManagement',new groupManagement ($config, $ui)); } $groupManagement = session::get('groupManagement'); diff --git a/gosa-core/plugins/admin/ogroups/main.inc b/gosa-core/plugins/admin/ogroups/main.inc index ee523719c..6de420cc0 100644 --- a/gosa-core/plugins/admin/ogroups/main.inc +++ b/gosa-core/plugins/admin/ogroups/main.inc @@ -37,7 +37,7 @@ if ( $cleanup ){ }else{ /* Create object object on demand */ - if (!session::is_set('ogroup') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('ogroup')){ session::set('ogroup',new ogroupManagement ($config)); } diff --git a/gosa-core/plugins/admin/users/main.inc b/gosa-core/plugins/admin/users/main.inc index 94a5747c6..1b37c9d46 100644 --- a/gosa-core/plugins/admin/users/main.inc +++ b/gosa-core/plugins/admin/users/main.inc @@ -36,8 +36,7 @@ if ( $cleanup ){ }else{ /* Create usermanagement object on demand */ - if (!session::is_set('userManagement') || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('userManagement')){ $userManagement= new userManagement ($config, $ui); $userManagement->set_acl_category("users"); session::set('userManagement',$userManagement); diff --git a/gosa-core/plugins/personal/generic/main.inc b/gosa-core/plugins/personal/generic/main.inc index c24dfa96c..9037a452c 100644 --- a/gosa-core/plugins/personal/generic/main.inc +++ b/gosa-core/plugins/personal/generic/main.inc @@ -23,7 +23,7 @@ /* Remove locks created by this plugin */ $lock_msg=""; -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){ if(session::is_set('user') && session::is_set('edit')){ del_lock($ui->dn); } @@ -38,14 +38,7 @@ if ( $cleanup ){ }else{ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - /* Only remove lock if object was opened - */ - if(session::is_set('user') && session::is_set('edit')){ - del_lock ($ui->dn); - } + if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){ session::un_set ('edit'); session::un_set ('user'); } diff --git a/gosa-core/plugins/personal/password/main.inc b/gosa-core/plugins/personal/password/main.inc index b039a10f8..b9a877456 100644 --- a/gosa-core/plugins/personal/password/main.inc +++ b/gosa-core/plugins/personal/password/main.inc @@ -38,8 +38,7 @@ if ( $cleanup ){ }else{ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('password'); } diff --git a/gosa-core/plugins/personal/posix/main.inc b/gosa-core/plugins/personal/posix/main.inc index 7728f7317..cce612acf 100644 --- a/gosa-core/plugins/personal/posix/main.inc +++ b/gosa-core/plugins/personal/posix/main.inc @@ -24,7 +24,7 @@ /* Remove locks created by this plugin */ $lock_msg=""; -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel'])){ if(session::is_set('posixAccount') && session::is_set('edit')){ del_lock($ui->dn); } @@ -39,13 +39,7 @@ if ( $cleanup ){ }else{ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - /* Only remove lock if object was opened - */ - if(session::is_set('posix') && session::is_set('edit')){ - del_lock ($ui->dn); - } + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('posixAccount'); } diff --git a/gosa-plugins/addressbook/addons/addressbook/main.inc b/gosa-plugins/addressbook/addons/addressbook/main.inc index bf55ff3b9..8807c0018 100644 --- a/gosa-plugins/addressbook/addons/addressbook/main.inc +++ b/gosa-plugins/addressbook/addons/addressbook/main.inc @@ -26,7 +26,7 @@ if ( $cleanup ){ }else{ /* Create phonelist object on demand */ - if (!session::is_set('addressbook') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('addressbook')){ $addressbook = new addressbook ($config); $addressbook -> set_acl_base($ui->dn); $addressbook -> set_acl_category("addressbook"); diff --git a/gosa-plugins/connectivity/personal/connectivity/main.inc b/gosa-plugins/connectivity/personal/connectivity/main.inc index f24d14a96..48610b3b7 100644 --- a/gosa-plugins/connectivity/personal/connectivity/main.inc +++ b/gosa-plugins/connectivity/personal/connectivity/main.inc @@ -21,7 +21,7 @@ /* Remove locks created by this plugin */ $lock_msg=""; -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel'])){ if(session::is_set('connectivity') && session::is_set('edit')){ del_lock($ui->dn); } @@ -37,14 +37,7 @@ if ( $cleanup ){ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - /* Only remove lock if object was opened - */ - if(session::is_set('connectivity') && session::is_set('edit')){ - del_lock ($ui->dn); - } + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('connectivity'); } diff --git a/gosa-plugins/dak/addons/dak/main.inc b/gosa-plugins/dak/addons/dak/main.inc index 6be41ecc0..c2fcbb005 100644 --- a/gosa-plugins/dak/addons/dak/main.inc +++ b/gosa-plugins/dak/addons/dak/main.inc @@ -32,7 +32,7 @@ if ( $cleanup ){ session::un_set('dak_plug'); }else{ - if (!session::is_set('dak_plug') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('dak_plug')){ session::set('dak_plug',new dakplug($config)); } $dak_plug = session::get('dak_plug'); diff --git a/gosa-plugins/dfs/addons/godfs/main.inc b/gosa-plugins/dfs/addons/godfs/main.inc index 5a38bc8da..424b3c54d 100644 --- a/gosa-plugins/dfs/addons/godfs/main.inc +++ b/gosa-plugins/dfs/addons/godfs/main.inc @@ -17,8 +17,7 @@ if ( $cleanup ){ }else{ # create dfsManagment object - if (!session::is_set('dfsManagment') || - (isset($_GET['reset']) && $_GET['reset'] == 1)) { + if (!session::is_set('dfsManagment')){ session::set('dfsManagment',new dfsManagment($config, $ui)); } $dfsManagment = session::get('dfsManagment'); diff --git a/gosa-plugins/fai/admin/fai/main.inc b/gosa-plugins/fai/admin/fai/main.inc index 2b5128f94..e1013fd80 100644 --- a/gosa-plugins/fai/admin/fai/main.inc +++ b/gosa-plugins/fai/admin/fai/main.inc @@ -35,7 +35,7 @@ if ( $cleanup ){ }else{ /* Create usermanagement object on demand */ - if (!session::is_set('FAI') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('FAI')){ $FAI= new faiManagement($config, $ui); $FAI->set_acl_category("fai"); session::set('FAI',$FAI); diff --git a/gosa-plugins/gofax/gofax/blocklists/main.inc b/gosa-plugins/gofax/gofax/blocklists/main.inc index ebd93825f..602d617a8 100644 --- a/gosa-plugins/gofax/gofax/blocklists/main.inc +++ b/gosa-plugins/gofax/gofax/blocklists/main.inc @@ -16,7 +16,7 @@ if ( $cleanup ){ }else{ /* Create blocklist object on demand */ - if (!session::is_set('blocklist') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('blocklist')){ $blocklist= new blocklist($config, $ui); $blocklist->set_acl_category("gofaxlist"); session::set('blocklist',$blocklist); diff --git a/gosa-plugins/gofax/gofax/faxaccount/main.inc b/gosa-plugins/gofax/gofax/faxaccount/main.inc index 2768a8b68..b740ca725 100644 --- a/gosa-plugins/gofax/gofax/faxaccount/main.inc +++ b/gosa-plugins/gofax/gofax/faxaccount/main.inc @@ -2,7 +2,7 @@ /* Remove locks created by this plugin */ -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel'])){ if(session::is_set('gofaxAccount') && session::is_set('edit')){ del_lock($ui->dn); } @@ -16,10 +16,7 @@ if ( $cleanup ){ }else{ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - del_lock ($ui->dn); + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('gofaxAccount'); } diff --git a/gosa-plugins/gofax/gofax/faxreports/main.inc b/gosa-plugins/gofax/gofax/faxreports/main.inc index 326ca61ee..ac1ffc359 100644 --- a/gosa-plugins/gofax/gofax/faxreports/main.inc +++ b/gosa-plugins/gofax/gofax/faxreports/main.inc @@ -7,7 +7,7 @@ if ( $cleanup ){ }else{ /* Create faxreport object on demand */ - if (!session::is_set('faxreport') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('faxreport')){ session::set('faxreport',new faxreport ($config, $ui)); } $faxreport = session::get('faxreport'); diff --git a/gosa-plugins/gofon/gofon/conference/main.inc b/gosa-plugins/gofon/gofon/conference/main.inc index 1c313646c..43ad9547c 100644 --- a/gosa-plugins/gofon/gofon/conference/main.inc +++ b/gosa-plugins/gofon/gofon/conference/main.inc @@ -36,7 +36,7 @@ if ( $cleanup ){ /* Create usermanagement object on demand */ - if (!session::is_set('conference') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('conference')){ session::set("conference",new phoneConferenceManagment($config, $ui)); } $conference = session::get('conference'); diff --git a/gosa-plugins/gofon/gofon/fonreports/main.inc b/gosa-plugins/gofon/gofon/fonreports/main.inc index 150e7b592..cbd957edd 100644 --- a/gosa-plugins/gofon/gofon/fonreports/main.inc +++ b/gosa-plugins/gofon/gofon/fonreports/main.inc @@ -8,7 +8,7 @@ if ( $cleanup ){ }else{ /* Create fonreport object on demand */ - if (!session::is_set('fonreport') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('fonreport')){ session::set('fonreport',new fonreport ($config, $ui)); } $fonreport = session::get('fonreport'); diff --git a/gosa-plugins/gofon/gofon/macro/main.inc b/gosa-plugins/gofon/gofon/macro/main.inc index 75ef984cd..502ab6403 100644 --- a/gosa-plugins/gofon/gofon/macro/main.inc +++ b/gosa-plugins/gofon/gofon/macro/main.inc @@ -36,7 +36,7 @@ if ( $cleanup ){ /* Create macroManagement object on demand */ - if (!session::is_set('macroManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('macroManagement')){ session::set('macroManagement',new goFonMacro ($config, $ui)); } diff --git a/gosa-plugins/gofon/gofon/phoneaccount/main.inc b/gosa-plugins/gofon/gofon/phoneaccount/main.inc index c7d750814..ebc64d3fe 100644 --- a/gosa-plugins/gofon/gofon/phoneaccount/main.inc +++ b/gosa-plugins/gofon/gofon/phoneaccount/main.inc @@ -21,7 +21,7 @@ /* Remove locks created by this plugin */ $lock_msg =""; -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel'])){ if(session::is_set('phoneAccount') && session::is_set('edit')){ del_lock($ui->dn); } @@ -36,10 +36,7 @@ if ( $cleanup ){ }else{ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - del_lock ($ui->dn); + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('phoneAccount'); } diff --git a/gosa-plugins/goto/addons/goto/main.inc b/gosa-plugins/goto/addons/goto/main.inc index 106a8abe8..af6b0ab7e 100644 --- a/gosa-plugins/goto/addons/goto/main.inc +++ b/gosa-plugins/goto/addons/goto/main.inc @@ -37,9 +37,7 @@ if ( $cleanup ){ /* Create gotomasses object on demand */ - if (!session::is_set('gotomasses') - || (isset($_GET['reset']) && $_GET['reset'] == 1) - || isset($_POST['reload_gotomass_data'])){ + if (!session::is_set('gotomasses') || isset($_POST['reload_gotomass_data'])){ $gotomasses= new gotomasses ($config); $gotomasses->set_acl_category("gotomasses"); diff --git a/gosa-plugins/goto/admin/applications/main.inc b/gosa-plugins/goto/admin/applications/main.inc index d61f42c63..99a7a72c8 100644 --- a/gosa-plugins/goto/admin/applications/main.inc +++ b/gosa-plugins/goto/admin/applications/main.inc @@ -36,7 +36,7 @@ if ( $cleanup ){ /* Create applicationManagement object on demand */ - if (!session::is_set('applicationManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('applicationManagement')){ session::set('applicationManagement',new applicationManagement ($config, $ui)); } $applicationManagement = session::get('applicationManagement'); diff --git a/gosa-plugins/goto/admin/devices/main.inc b/gosa-plugins/goto/admin/devices/main.inc index 88f0c2138..dd9d451fd 100644 --- a/gosa-plugins/goto/admin/devices/main.inc +++ b/gosa-plugins/goto/admin/devices/main.inc @@ -35,7 +35,7 @@ if ( $cleanup ){ }else{ /* Create DeviceManagement object on demand */ - if (!session::is_set('DeviceManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('DeviceManagement')){ session::set('DeviceManagement',new deviceManagement ($config)); } diff --git a/gosa-plugins/goto/admin/mimetypes/main.inc b/gosa-plugins/goto/admin/mimetypes/main.inc index 81e04da3b..cbd12a1cc 100644 --- a/gosa-plugins/goto/admin/mimetypes/main.inc +++ b/gosa-plugins/goto/admin/mimetypes/main.inc @@ -34,7 +34,7 @@ if ( $cleanup ){ }else{ /* Create MimeTypeManagement object on demand */ - if (!session::is_set('MimeTypeManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('MimeTypeManagement')){ session::set('MimeTypeManagement',new mimetypeManagement ($config, $ui)); } diff --git a/gosa-plugins/goto/personal/environment/main.inc b/gosa-plugins/goto/personal/environment/main.inc index 0b0e24f3f..141322066 100644 --- a/gosa-plugins/goto/personal/environment/main.inc +++ b/gosa-plugins/goto/personal/environment/main.inc @@ -21,7 +21,7 @@ /* Remove locks created by this plugin */ $lock_msg=""; -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel'])){ if(session::is_set('environment') && session::is_set('edit')){ del_lock($ui->dn); } @@ -36,14 +36,7 @@ if ( $cleanup ){ }else{ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - /* Only remove lock if object was opened - */ - if(session::is_set('environment') && session::is_set('edit')){ - del_lock ($ui->dn); - } + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('environment'); } diff --git a/gosa-plugins/ldapmanager/addons/ldapmanager/main.inc b/gosa-plugins/ldapmanager/addons/ldapmanager/main.inc index 3a8f4a26e..0edc38068 100644 --- a/gosa-plugins/ldapmanager/addons/ldapmanager/main.inc +++ b/gosa-plugins/ldapmanager/addons/ldapmanager/main.inc @@ -33,9 +33,8 @@ if ( $cleanup ){ session::un_set('ldif'); }else{ - /* Create phonelist object on demand */ - if (!session::is_set('ldif') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('ldif')){ $ldif= new ldif ($config); $ldif->set_acl_category("logview"); session::set('ldif',$ldif); diff --git a/gosa-plugins/log/addons/logview/main.inc b/gosa-plugins/log/addons/logview/main.inc index 47bd09632..13a811a7b 100644 --- a/gosa-plugins/log/addons/logview/main.inc +++ b/gosa-plugins/log/addons/logview/main.inc @@ -35,7 +35,7 @@ if ( $cleanup ){ /* Create logview object on demand */ - if (!session::is_set('log_tabs') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('log_tabs')){ session::set('log_tabs',new log_tabs($config, $config->data['TABS']['LOGTABS'],"")); } $log_tabs = session::get('log_tabs'); diff --git a/gosa-plugins/mail/addons/mailqueue/main.inc b/gosa-plugins/mail/addons/mailqueue/main.inc index df6784d38..3d9373875 100644 --- a/gosa-plugins/mail/addons/mailqueue/main.inc +++ b/gosa-plugins/mail/addons/mailqueue/main.inc @@ -33,7 +33,7 @@ if ( $cleanup ){ }else{ /* Create mailqueue object on demand */ - if (!session::is_set('mailqueue') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('mailqueue')){ $ui = get_userinfo(); $mailqueue= new mailqueue ($config); $mailqueue->set_acl_category("mailqueue"); diff --git a/gosa-plugins/mail/personal/mail/main.inc b/gosa-plugins/mail/personal/mail/main.inc index b8fe96a5d..db39f469b 100644 --- a/gosa-plugins/mail/personal/mail/main.inc +++ b/gosa-plugins/mail/personal/mail/main.inc @@ -22,7 +22,7 @@ /* Remove locks created by this plugin */ $lock_msg=""; -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel'])){ if(session::is_set('mailAccount') && session::is_set('edit')){ del_lock($ui->dn); } @@ -36,16 +36,8 @@ if ( $cleanup ){ }else{ - /* Reset requested? */ - if (isset($_POST['edit_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - /* Only remove lock if object was opened - */ - if(session::is_set('mailAccount') && session::is_set('edit')){ - del_lock ($ui->dn); - } + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('mailAccount'); } diff --git a/gosa-plugins/nagios/personal/nagios/main.inc b/gosa-plugins/nagios/personal/nagios/main.inc index 49cc58396..319bd0aec 100644 --- a/gosa-plugins/nagios/personal/nagios/main.inc +++ b/gosa-plugins/nagios/personal/nagios/main.inc @@ -22,7 +22,7 @@ /* Remove locks created by this plugin */ $lock_msg=""; -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel'])){ if(session::is_set('nagiosAccount') && session::is_set('edit')){ del_lock($ui->dn); } @@ -37,14 +37,7 @@ if ( $cleanup ){ }else{ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - /* Only remove lock if object was opened - */ - if(session::is_set('nagiosAccount') && session::is_set('edit')){ - del_lock ($ui->dn); - } + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('nagiosAccount'); } diff --git a/gosa-plugins/netatalk/personal/netatalk/main.inc b/gosa-plugins/netatalk/personal/netatalk/main.inc index c1f06c88d..8fd464a4c 100644 --- a/gosa-plugins/netatalk/personal/netatalk/main.inc +++ b/gosa-plugins/netatalk/personal/netatalk/main.inc @@ -22,7 +22,7 @@ /* Remove locks created by this plugin */ $lock_msg=""; -if ($remove_lock){ +if ($remove_lock || isset ($_POST['edit_cancel'])){ if(session::is_set('netatalk') && session::is_set('edit')){ del_lock($ui->dn); } @@ -37,13 +37,7 @@ if ( $cleanup ){ }else{ /* Reset requested? */ - if (isset ($_POST['edit_cancel']) || (isset ($_GET['reset']) && $_GET['reset'] == 1)) { - - /* Only remove lock if object was opened - */ - if(session::is_set('netatalk') && session::is_set('edit')){ - del_lock ($ui->dn); - } + if (isset ($_POST['edit_cancel'])) { session::un_set('edit'); session::un_set('netatalk'); } diff --git a/gosa-plugins/samba/personal/samba/main.inc b/gosa-plugins/samba/personal/samba/main.inc index e4e211304..e4e3ea174 100644 --- a/gosa-plugins/samba/personal/samba/main.inc +++ b/gosa-plugins/samba/personal/samba/main.inc @@ -22,7 +22,7 @@ /* Remove locks created by this plugin */ $lock_msg=""; -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel'])){ if(session::is_set('sambaAccount') && session::is_set('edit')){ del_lock($ui->dn); } @@ -37,14 +37,7 @@ if ( $cleanup ){ }else{ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - /* Only remove lock if object was opened - */ - if(session::is_set('sambaAccount') && session::is_set('edit')){ - del_lock ($ui->dn); - } + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('sambaAccount'); } diff --git a/gosa-plugins/scalix/personal/scalix/main.inc b/gosa-plugins/scalix/personal/scalix/main.inc index 03a92ec20..275ae4ce5 100644 --- a/gosa-plugins/scalix/personal/scalix/main.inc +++ b/gosa-plugins/scalix/personal/scalix/main.inc @@ -22,7 +22,7 @@ /* Remove locks created by this plugin */ $lock_msg=""; -if ($remove_lock){ +if ($remove_lock || isset($_POST['edit_cancel'])){ if(session::is_set('scalixAccount') && session::is_set('edit')){ del_lock($ui->dn); } @@ -38,14 +38,7 @@ if ( $cleanup ){ /* Reset requested? */ - if (isset($_POST['edit_cancel']) || - (isset($_GET['reset']) && $_GET['reset'] == 1)){ - - /* Only remove lock if object was opened - */ - if(session::is_set('scalixAccount') && session::is_set('edit')){ - del_lock ($ui->dn); - } + if (isset($_POST['edit_cancel'])){ session::un_set ('edit'); session::un_set ('scalixAccount'); } diff --git a/gosa-plugins/sudo/admin/sudo/main.inc b/gosa-plugins/sudo/admin/sudo/main.inc index d5177179f..e30efdd7b 100644 --- a/gosa-plugins/sudo/admin/sudo/main.inc +++ b/gosa-plugins/sudo/admin/sudo/main.inc @@ -37,7 +37,7 @@ if ( $cleanup ){ }else{ /* Create sudoManagement object on demand */ - if (!session::is_set('sudoManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('sudoManagement')){ session::set('sudoManagement',new sudoManagement ($config, $ui)); } $sudoManagement = session::get('sudoManagement'); diff --git a/gosa-plugins/systems/admin/systems/main.inc b/gosa-plugins/systems/admin/systems/main.inc index 2e771f5a0..81c52565a 100644 --- a/gosa-plugins/systems/admin/systems/main.inc +++ b/gosa-plugins/systems/admin/systems/main.inc @@ -37,7 +37,7 @@ if ( $cleanup ){ /* Create usermanagement object on demand */ - if (!session::is_set('systems') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('systems')){ session::set('systems',new systems($config, $ui)); } $systems = session::get('systems'); -- 2.30.2