[Kolab-devel] Re: martin: server/kolab-resource-handlers freebusy-folder-deleted.patch, NONE, 1.1
Steffen Hansen
steffen at klaralvdalens-datakonsult.se
Mon Jun 20 13:20:19 CEST 2005
On Sunday 19 June 2005 17:09, cvs at intevation.de wrote:
> Author: martin
>
> Update of /kolabrepository/server/kolab-resource-handlers
> In directory doto:/tmp/cvs-serv14302
>
> Added Files:
> freebusy-folder-deleted.patch
> Log Message:
> Martin K. patch for deleting pfb information and potentially
> available pfb cache information if folder is already deleted in the
> meantime. (No need for any cron based cleanup script!)
>
>
> --- NEW FILE: freebusy-folder-deleted.patch ---
> diff -u -r freebusy/pfb.php freebusy.delete/pfb.php
> --- freebusy/pfb.php Mon Jun 13 17:19:12 2005
> +++ freebusy.delete/pfb.php Mon Jun 13 18:21:41 2005
> @@ -133,6 +133,18 @@
> $rc = $fb->imapOpenMailbox(FreeBusy::imapFolderName( $imapuser,
> $owner, $folder, $params['email_domain']));
> if( $rc === false ) {
> + // folder doesn't exist (anymore)
> + $cache->store( $owner.'/'.$folder, false, array(), "delete
> folder"); + $xcache->store( $owner.'/'.$folder, false, array(),
> "delete folder"); +
> + // clear IMAP cache
> + $imapcache = new FreeBusyIMAPCache($full_cache_dir."/", $owner,
> $fb->foldername); + $imapcache->cache_delete();
> +
> + // try to unlink (parent) directory, works only if empty
> + $parent_folder = $full_cache_dir."/".str_replace(".", "^",
> $owner."/".$folder); + @rmdir($parent_folder);
> +
Thanks for the patch. There are a few issues:
1) Which version is this patch against?
2) What happens when I authenticate as a valid user who has no access to
the requested mailbox. Does it protect against me being able to delete
the cache for any folder I can't see?
regards
--
Steffen Hansen | Klarälvdalens Datakonsult AB
Senior Software Engineer| http://www.klaralvdalens-datakonsult.se
|
| Platform-independent
| software solutions
More information about the devel
mailing list