From 2a61bf203e56b816e0569ec9278e892083bf47c2 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 26 Aug 2009 12:54:04 +0000 Subject: [PATCH] Updated locking - code order. -We can't lock 'Arrays' directly, walk through the array and lock each entry seperately. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14141 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index b1ea54525..b0d14045a 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -607,6 +607,13 @@ function add_lock($object, $user) if(!session::global_is_set("LOCK_CACHE")){ session::global_set("LOCK_CACHE",array("")); } + if(is_array($object)){ + foreach($object as $obj){ + add_lock($obj,$user); + } + return; + } + $cache = &session::global_get("LOCK_CACHE"); if(isset($_POST['open_readonly'])){ $cache['READ_ONLY'][$object] = TRUE; @@ -616,12 +623,6 @@ function add_lock($object, $user) unset($cache['READ_ONLY'][$object]); } - if(is_array($object)){ - foreach($object as $obj){ - add_lock($obj,$user); - } - return; - } /* Just a sanity check... */ if ($object == "" || $user == ""){ -- 2.30.2