* calendar/esync: do not allow a minimum length of less then 1 for uid; esync: if no UID given, do not even try to fetch exceptions.

This commit is contained in:
Klaus Leithoff 2011-12-22 14:46:00 +00:00
parent fad91e04e0
commit 65df488f5d
2 changed files with 25 additions and 11 deletions

View File

@ -1102,12 +1102,21 @@ return array(); // temporary disabling meeting requests from calendar
if ($rrule->exceptions) if ($rrule->exceptions)
{ {
// search real / non-virtual exceptions // search real / non-virtual exceptions
if (!empty($event['uid']))
{
$ex_events =& $this->calendar->search(array( $ex_events =& $this->calendar->search(array(
'query' => array('cal_uid' => $event['uid']), 'query' => array('cal_uid' => $event['uid']),
'filter' => 'owner', // return all possible entries 'filter' => 'owner', // return all possible entries
'daywise' => false, 'daywise' => false,
'date_format' => 'server', 'date_format' => 'server',
)); ));
}
else
{
debugLog(__METHOD__.__LINE__." Exceptions found but no UID given for Event:".$event['id'].' Exceptions:'.array2string($event['recur_exception']));
}
if (count($ex_events)>=1) debugLog(__METHOD__.__LINE__." found ".count($ex_events)." exeptions for event with UID/ID:".$event['uid'].'/'.$event['id']);
$message->exceptions = array(); $message->exceptions = array();
foreach($ex_events as $ex_event) foreach($ex_events as $ex_event)
{ {
@ -1129,6 +1138,9 @@ return array(); // temporary disabling meeting requests from calendar
// add rest of exceptions as deleted // add rest of exceptions as deleted
foreach($event['recur_exception'] as $exception_time) foreach($event['recur_exception'] as $exception_time)
{ {
if (!empty($exception_time))
{
if (empty($event['uid'])) debugLog(__METHOD__.__LINE__." BEWARE no UID given for this event:".$event['id'].' but exception is set for '.$exception_time);
$exception = new SyncAppointment(); // exceptions seems to be full SyncAppointments, with only starttime required $exception = new SyncAppointment(); // exceptions seems to be full SyncAppointments, with only starttime required
$exception->deleted = 1; $exception->deleted = 1;
$exception->exceptionstarttime = $exception_time; $exception->exceptionstarttime = $exception_time;
@ -1136,6 +1148,7 @@ return array(); // temporary disabling meeting requests from calendar
$message->exceptions[] = $exception; $message->exceptions[] = $exception;
} }
} }
}
/* disabled virtual exceptions for now, as AS does NOT support changed participants or status /* disabled virtual exceptions for now, as AS does NOT support changed participants or status
// add virtual exceptions here too (get_recurrence_exceptions should be able to return real-exceptions too!) // add virtual exceptions here too (get_recurrence_exceptions should be able to return real-exceptions too!)
foreach($this->calendar->so->get_recurrence_exceptions($event, foreach($this->calendar->so->get_recurrence_exceptions($event,

View File

@ -954,6 +954,7 @@ ORDER BY cal_user_type, cal_usre_id
if (isset($GLOBALS['egw_info']['user']['preferences']['syncml']['minimum_uid_length'])) if (isset($GLOBALS['egw_info']['user']['preferences']['syncml']['minimum_uid_length']))
{ {
$minimum_uid_length = $GLOBALS['egw_info']['user']['preferences']['syncml']['minimum_uid_length']; $minimum_uid_length = $GLOBALS['egw_info']['user']['preferences']['syncml']['minimum_uid_length'];
if (empty($minimum_uid_length) || $minimum_uid_length<=1) $minimum_uid_length = 8; // we just do not accept no uid, or uid way to short!
} }
else else
{ {