cast accounts->members(hips) to array, to cope without PHP warnings for not (longer) existing accounts

This commit is contained in:
Ralf Becker 2012-08-09 09:09:07 +00:00
parent e87f4c1514
commit eeb292ecbd

View File

@ -465,8 +465,8 @@ class calendar_ical extends calendar_boupdate
case 'g': case 'g':
$cutype = 'GROUP'; $cutype = 'GROUP';
$participantURL = 'urn:uuid:'.common::generate_uid('accounts', $uid); $participantURL = 'urn:uuid:'.common::generate_uid('accounts', $uid);
$members = $GLOBALS['egw']->accounts->members($uid, true); if (!isset($event['participants'][$this->user]) &&
if (!isset($event['participants'][$this->user]) && in_array($this->user, $members)) ($members = $GLOBALS['egw']->accounts->members($uid, true)) && in_array($this->user, $members))
{ {
$user = $this->resource_info($this->user); $user = $this->resource_info($this->user);
$attributes['ATTENDEE'][] = 'MAILTO:' . $user['email']; $attributes['ATTENDEE'][] = 'MAILTO:' . $user['email'];
@ -2822,8 +2822,8 @@ class calendar_ical extends calendar_boupdate
$status != 'X' && $status != 'U') $status != 'X' && $status != 'U')
{ {
// User tries to reply to the group invitiation // User tries to reply to the group invitiation
$members = $GLOBALS['egw']->accounts->members($uid, true); if (($members = $GLOBALS['egw']->accounts->members($uid, true)) &&
if (in_array($this->user, $members)) in_array($this->user, $members))
{ {
//Horde::logMessage("vevent2egw: set status to " . $status, //Horde::logMessage("vevent2egw: set status to " . $status,
// __FILE__, __LINE__, PEAR_LOG_DEBUG); // __FILE__, __LINE__, PEAR_LOG_DEBUG);