Changeset View
Changeset View
Standalone View
Standalone View
plugins/kolab_delegation/kolab_delegation_engine.php
Show First 20 Lines • Show All 858 Lines • ▼ Show 20 Lines | public function delegator_delivery_filter(&$args) | ||||
$sender = format_email_recipient($identity['email'], $identity['name']); | $sender = format_email_recipient($identity['email'], $identity['name']); | ||||
$message->headers(array('Sender' => $sender), false, true); | $message->headers(array('Sender' => $sender), false, true); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Finds an event in delegators' folders. Calendar looks only in | |||||
* personal namespace, we "extend" this to delegators' folders. | |||||
* | |||||
* @param array $args Reference to plugin hook arguments | |||||
*/ | |||||
public function delegator_find_event(&$args) | |||||
{ | |||||
// The event wasn't found and current user has delegators | |||||
if (!empty($_SESSION['delegators']) && empty($args['result'])) { | |||||
$event = $args['search']; | |||||
$ns_root = kolab_storage::namespace_root('other'); | |||||
$storage = $this->rc->get_storage(); | |||||
$delimiter = $storage->get_hierarchy_delimiter(); | |||||
$folders = $storage->list_folders_subscribed($ns_root, '*', 'event', 'w'); | |||||
// search in all delegators' calendars | |||||
foreach ($folders as $folder) { | |||||
list($uid, $path) = explode($delimiter, substr($folder, strlen($ns_root)), 2); | |||||
if (!empty($_SESSION['delegators'][$uid])) { | |||||
$event['calendar'] = kolab_storage::folder_id($folder, true); | |||||
$result = $args['calendar']->driver->get_event($event, calendar_driver::FILTER_WRITEABLE); | |||||
if ($result) { | |||||
$args['result'] = $result; | |||||
return; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
/** | |||||
* Compares two ACLs (according to supported rights) | * Compares two ACLs (according to supported rights) | ||||
* | * | ||||
* @param array $acl1 ACL rights array (or string) | * @param array $acl1 ACL rights array (or string) | ||||
* @param array $acl2 ACL rights array (or string) | * @param array $acl2 ACL rights array (or string) | ||||
* | * | ||||
* @param bool True if $acl1 contains all rights from $acl2 | * @param bool True if $acl1 contains all rights from $acl2 | ||||
*/ | */ | ||||
function acl_compare($acl1, $acl2) | function acl_compare($acl1, $acl2) | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |