From 6ce9fddd20335d0fcbcba60596cdd64156e7745f Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 1 Dec 2008 10:27:39 +0000 Subject: [PATCH] Updated locking for users self editing. -Do not remove locks if we havn't created any git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13093 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/plugins/personal/password/main.inc | 1 - gosa-core/plugins/personal/posix/main.inc | 7 ++++++- gosa-plugins/connectivity/personal/connectivity/main.inc | 6 +++++- gosa-plugins/goto/personal/environment/main.inc | 7 ++++++- gosa-plugins/mail/personal/mail/main.inc | 7 ++++++- gosa-plugins/nagios/personal/nagios/main.inc | 7 ++++++- gosa-plugins/netatalk/personal/netatalk/main.inc | 7 ++++++- gosa-plugins/samba/personal/samba/main.inc | 6 +++++- gosa-plugins/scalix/personal/scalix/main.inc | 7 ++++++- 9 files changed, 46 insertions(+), 9 deletions(-) diff --git a/gosa-core/plugins/personal/password/main.inc b/gosa-core/plugins/personal/password/main.inc index ba7e7b993..568aafa40 100644 --- a/gosa-core/plugins/personal/password/main.inc +++ b/gosa-core/plugins/personal/password/main.inc @@ -29,7 +29,6 @@ if (!$remove_lock){ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - del_lock ($ui->dn); 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 d04c3db17..ffbd769fb 100644 --- a/gosa-core/plugins/personal/posix/main.inc +++ b/gosa-core/plugins/personal/posix/main.inc @@ -27,7 +27,12 @@ if (!$remove_lock){ /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - del_lock ($ui->dn); + + /* Only remove lock if object was opened + */ + if(session::is_set('posix') && session::is_set('edit')){ + del_lock ($ui->dn); + } session::un_set ('edit'); session::un_set ('posixAccount'); } diff --git a/gosa-plugins/connectivity/personal/connectivity/main.inc b/gosa-plugins/connectivity/personal/connectivity/main.inc index d8cac5ab4..da38f9d2d 100644 --- a/gosa-plugins/connectivity/personal/connectivity/main.inc +++ b/gosa-plugins/connectivity/personal/connectivity/main.inc @@ -23,7 +23,11 @@ if (!$remove_lock){ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - del_lock ($ui->dn); + /* Only remove lock if object was opened + */ + if(session::is_set('connectivity-') && session::is_set('edit')){ + del_lock ($ui->dn); + } session::un_set ('edit'); session::un_set ('connectivity'); } diff --git a/gosa-plugins/goto/personal/environment/main.inc b/gosa-plugins/goto/personal/environment/main.inc index a7ebfc1ad..3b55b3285 100644 --- a/gosa-plugins/goto/personal/environment/main.inc +++ b/gosa-plugins/goto/personal/environment/main.inc @@ -23,7 +23,12 @@ if (!$remove_lock){ /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - del_lock ($ui->dn); + + /* Only remove lock if object was opened + */ + if(session::is_set('environment') && session::is_set('edit')){ + del_lock ($ui->dn); + } session::un_set ('edit'); session::un_set ('environment'); } diff --git a/gosa-plugins/mail/personal/mail/main.inc b/gosa-plugins/mail/personal/mail/main.inc index 4f4573242..df0e7495e 100644 --- a/gosa-plugins/mail/personal/mail/main.inc +++ b/gosa-plugins/mail/personal/mail/main.inc @@ -24,7 +24,12 @@ if (!$remove_lock){ /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - del_lock ($ui->dn); + + /* Only remove lock if object was opened + */ + if(session::is_set('mailAccount') && session::is_set('edit')){ + del_lock ($ui->dn); + } 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 5130941c0..de4dcfd45 100644 --- a/gosa-plugins/nagios/personal/nagios/main.inc +++ b/gosa-plugins/nagios/personal/nagios/main.inc @@ -25,7 +25,12 @@ if (!$remove_lock){ /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - del_lock ($ui->dn); + + /* Only remove lock if object was opened + */ + if(session::is_set('nagiosAccount') && session::is_set('edit')){ + del_lock ($ui->dn); + } 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 36820497e..65e02834d 100644 --- a/gosa-plugins/netatalk/personal/netatalk/main.inc +++ b/gosa-plugins/netatalk/personal/netatalk/main.inc @@ -23,7 +23,12 @@ $lock_msg = ""; if (!$remove_lock) { /* Reset requested? */ if (isset ($_POST['edit_cancel']) || (isset ($_GET['reset']) && $_GET['reset'] == 1)) { - del_lock($ui->dn); + + /* Only remove lock if object was opened + */ + if(session::is_set('netatalk') && session::is_set('edit')){ + del_lock ($ui->dn); + } 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 890e7a0a1..856478df4 100644 --- a/gosa-plugins/samba/personal/samba/main.inc +++ b/gosa-plugins/samba/personal/samba/main.inc @@ -25,7 +25,11 @@ if (!$remove_lock){ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - del_lock ($ui->dn); + /* Only remove lock if object was opened + */ + if(session::is_set('sambaAccount') && session::is_set('edit')){ + del_lock ($ui->dn); + } 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 a1930f3b0..4a6463fa4 100644 --- a/gosa-plugins/scalix/personal/scalix/main.inc +++ b/gosa-plugins/scalix/personal/scalix/main.inc @@ -23,7 +23,12 @@ if (!$remove_lock){ /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - del_lock ($ui->dn); + + /* Only remove lock if object was opened + */ + if(session::is_set('scalixAccount') && session::is_set('edit')){ + del_lock ($ui->dn); + } session::un_set ('edit'); session::un_set ('scalixAccount'); } -- 2.30.2