gunnar: server/kolab-freebusy/freebusy generatefb.php,1.2,1.3
cvs at kolab.org
cvs at kolab.org
Wed Feb 6 10:28:54 CET 2008
Author: gunnar
Update of /kolabrepository/server/kolab-freebusy/freebusy
In directory doto:/tmp/cvs-serv23437/kolab-freebusy/freebusy
Modified Files:
generatefb.php
Log Message:
Add the manager acl hack to the generatefb script.
Index: generatefb.php
===================================================================
RCS file: /kolabrepository/server/kolab-freebusy/freebusy/generatefb.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- generatefb.php 6 Feb 2008 08:00:27 -0000 1.2
+++ generatefb.php 6 Feb 2008 09:28:52 -0000 1.3
@@ -95,6 +95,8 @@
foreach ($calendars as $calendar) {
+ $failed = false;
+
/* Validate folder access */
$result = $access->parseFolder($calendar);
if (is_a($result, 'PEAR_Error')) {
@@ -103,6 +105,16 @@
exit(-1);
}
+ /* Hack for allowing manager access */
+ if ($access->user == 'manager') {
+ $acl = $imap->_imap->getACL($calendar);
+ $oldacl = '';
+ if (isset($acl['manager'])) {
+ $oldacl = $acl['manager'];
+ }
+ $acl['manager'] = 'lrs';
+ }
+
echo "Regenerating calendar \"" . $calendar . "\"!\n";
/* Update the cache */
@@ -110,6 +122,20 @@
if (is_a($result, 'PEAR_Error')) {
echo "Failed regenerating cache for calendar \"" . $calendar . "\"!\n";
echo $result->getMessage();
+ $failed = true;
+ }
+
+ /* Revert the acl */
+ if ($access->user == 'manager') {
+ $acl = $imap->_imap->getACL($calendar);
+ $oldacl = '';
+ if (isset($acl['manager'])) {
+ $oldacl = $acl['manager'];
+ }
+ $acl['manager'] = 'lrs';
+ }
+
+ if ($failed) {
exit(-1);
}
}
More information about the commits
mailing list