From 274f20047f7e5943118043fba3faca467a240c44 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 26 Aug 2009 12:45:45 +0000 Subject: [PATCH] Updated lock handling -seperate GET & POST variables while locking. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14140 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/main.php | 8 ++++++-- gosa-core/include/class_plugin.inc | 3 ++- gosa-core/include/functions.inc | 10 ++++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index 3c799e8c0..b7a8271d8 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -311,9 +311,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){ if (isset($_POST['delete_lock']) || isset($_POST['open_readonly'])){ /* Set old Post data */ - if(session::global_is_set('LOCK_VARS_USED')){ - foreach(session::global_get('LOCK_VARS_USED') as $name => $value){ + if(session::global_is_set('LOCK_VARS_USED_GET')){ + foreach(session::global_get('LOCK_VARS_USED_GET') as $name => $value){ $_GET[$name] = $value; + } + } + if(session::global_is_set('LOCK_VARS_USED_POST')){ + foreach(session::global_get('LOCK_VARS_USED_POST') as $name => $value){ $_POST[$name] = $value; } } diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 765a7dbd3..52b3235c5 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -263,7 +263,8 @@ class plugin /* Reset Lock message POST/GET check array, to prevent perg_match errors*/ session::set('LOCK_VARS_TO_USE',array()); - session::set('LOCK_VARS_USED',array()); + session::set('LOCK_VARS_USED_GET',array()); + session::set('LOCK_VARS_USED_POST',array()); } /*! \brief execute plugin diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index d5338a003..b1ea54525 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -1295,7 +1295,8 @@ function gen_locked_message($user, $dn, $allow_readonly = FALSE) /* Save variables from LOCK_VARS_TO_USE in session - for further editing */ if( session::is_set('LOCK_VARS_TO_USE') && count(session::get('LOCK_VARS_TO_USE'))){ - $LOCK_VARS_USED = array(); + $LOCK_VARS_USED_GET = array(); + $LOCK_VARS_USED_POST = array(); $LOCK_VARS_TO_USE = session::get('LOCK_VARS_TO_USE'); foreach($LOCK_VARS_TO_USE as $name){ @@ -1306,18 +1307,19 @@ function gen_locked_message($user, $dn, $allow_readonly = FALSE) foreach($_POST as $Pname => $Pvalue){ if(preg_match($name,$Pname)){ - $LOCK_VARS_USED[$Pname] = $_POST[$Pname]; + $LOCK_VARS_USED_POST[$Pname] = $_POST[$Pname]; } } foreach($_GET as $Pname => $Pvalue){ if(preg_match($name,$Pname)){ - $LOCK_VARS_USED[$Pname] = $_GET[$Pname]; + $LOCK_VARS_USED_GET[$Pname] = $_GET[$Pname]; } } } session::set('LOCK_VARS_TO_USE',array()); - session::set('LOCK_VARS_USED' , $LOCK_VARS_USED); + session::set('LOCK_VARS_USED_GET' , $LOCK_VARS_USED_GET); + session::set('LOCK_VARS_USED_POST' , $LOCK_VARS_USED_POST); } /* Prepare and show template */ -- 2.30.2