From 4eac1bc9ddfb6888089d51e6144b0b691dc6d548 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 24 Oct 2009 14:02:26 -0400 Subject: [PATCH] Only obtain a lock on the resource if it's a RESPONSETYPE_AUTO resource. --- kronolith/lib/Event.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index b67d90837..eebf2fb2c 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -333,9 +333,14 @@ abstract class Kronolith_Event } /* Lock the resource and get the response */ - $principle = 'calendar/' . $rcal; - $lock[$resource->getId()] = $locks->setLock(Horde_Auth::getAuth(), 'kronolith', $principle, 5, Horde_Lock::TYPE_EXCLUSIVE); - if (!$lock[$resource->getId()]) { + if ($resource->get('response_type') == Kronolith_Resource::RESPONSETYPE_AUTO) { + $principle = 'calendar/' . $rcal; + $lock[$resource->getId()] = $locks->setLock(Horde_Auth::getAuth(), 'kronolith', $principle, 5, Horde_Lock::TYPE_EXCLUSIVE); + $haveLock = true; + } else { + $haveLock = false; + } + if ($haveLock && !$lock[$resource->getId()]) { // Already locked // For now, just fail. Not sure how else to capture the locked // resources and notify the user. -- 2.11.0