From 6e70c942c51be1cb159a291c11b63faf3e05d8f4 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 8 Mar 2012 21:32:22 +0100 Subject: [PATCH] Correctly implement the expunge argument for object deletion --- plugins/libkolab/README | 16 ++++++++++++++++ plugins/libkolab/lib/kolab_storage_folder.php | 9 +++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 plugins/libkolab/README diff --git a/plugins/libkolab/README b/plugins/libkolab/README new file mode 100644 index 00000000..a16250f1 --- /dev/null +++ b/plugins/libkolab/README @@ -0,0 +1,16 @@ +libkolab plugin to access to Kolab groupware data +================================================= + +The contained library classes establish a connection to the Kolab server +and manage the access to the Kolab groupware objects stored in various +IMAP folders. For reading and writing these objects, the PHP bindings of +the libkolabxml library are used. + + +REQUIREMENTS +------------ +* libkolabxml PHP bindings + - kolabformat.so loaded into PHP + - kolabformat.php placed somewhere in the include_path +* Horde Kolab_Format package and all of its dependencies + diff --git a/plugins/libkolab/lib/kolab_storage_folder.php b/plugins/libkolab/lib/kolab_storage_folder.php index d82c5c69..a9f8d9b8 100644 --- a/plugins/libkolab/lib/kolab_storage_folder.php +++ b/plugins/libkolab/lib/kolab_storage_folder.php @@ -314,16 +314,21 @@ class kolab_storage_folder * Delete the specified object from this folder. * * @param mixed $object The Kolab object to delete or object UID - * @param boolean $trigger Should the folder be triggered? * @param boolean $expunge Should the folder be expunged? + * @param boolean $trigger Should the folder update be triggered? * * @return boolean True if successful, false on error */ public function delete($object, $expunge = true, $trigger = true) { - if ($msguid = is_array($object) ? $object['_msguid'] : $this->uid2msguid($object)) { + $msguid = is_array($object) ? $object['_msguid'] : $this->uid2msguid($object); + + if ($msguid && $expunge) { return $this->imap->delete_message($msguid, $this->name); } + else if ($msguid) { + return $this->imap->set_flag($msguid, 'DELETED', $this->name); + } return false; }