mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-08 23:19:04 +01:00
fix iOS calendar crashed if event-organizer had no email address
This commit is contained in:
parent
be27c65e98
commit
e600eede2a
@ -536,6 +536,7 @@ class Accounts
|
|||||||
$underscore = '_';
|
$underscore = '_';
|
||||||
}
|
}
|
||||||
if (!$domain) $domain = $GLOBALS['egw_info']['server']['mail_suffix'];
|
if (!$domain) $domain = $GLOBALS['egw_info']['server']['mail_suffix'];
|
||||||
|
if (!$domain) $domain = $_SERVER['SERVER_NAME'];
|
||||||
|
|
||||||
$email = str_replace(array('first','last','initial','account','dot','underscore','-'),
|
$email = str_replace(array('first','last','initial','account','dot','underscore','-'),
|
||||||
array($first,$last,substr($first,0,1),$account,$dot,$underscore,''),
|
array($first,$last,substr($first,0,1),$account,$dot,$underscore,''),
|
||||||
@ -736,9 +737,10 @@ class Accounts
|
|||||||
*
|
*
|
||||||
* @param int|string $account_id numeric account_id or account_lid
|
* @param int|string $account_id numeric account_id or account_lid
|
||||||
* @param string $which ='account_lid' type to convert to: account_lid (default), account_email, ...
|
* @param string $which ='account_lid' type to convert to: account_lid (default), account_email, ...
|
||||||
|
* @param boolean $generate_email =false true: generate an email address, if user has none
|
||||||
* @return string|boolean converted value or false on error ($account_id not found)
|
* @return string|boolean converted value or false on error ($account_id not found)
|
||||||
*/
|
*/
|
||||||
static function id2name($account_id, $which='account_lid')
|
static function id2name($account_id, $which='account_lid', $generate_email=false)
|
||||||
{
|
{
|
||||||
if (!is_numeric($account_id) && !($account_id = self::getInstance()->name2id($account_id)))
|
if (!is_numeric($account_id) && !($account_id = self::getInstance()->name2id($account_id)))
|
||||||
{
|
{
|
||||||
@ -751,6 +753,10 @@ class Accounts
|
|||||||
unset($e);
|
unset($e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ($generate_email && $which === 'account_email' && empty($data[$which]))
|
||||||
|
{
|
||||||
|
return self::email($data['account_firstname'], $data['account_lastname'], $data['account_lid']);
|
||||||
|
}
|
||||||
return $data[$which];
|
return $data[$which];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1081,7 +1081,8 @@ class calendar_zpush implements activesync_plugin_write, activesync_plugin_meeti
|
|||||||
$message->md5body = md5($event['description']);
|
$message->md5body = md5($event['description']);
|
||||||
|
|
||||||
$message->organizername = $GLOBALS['egw']->accounts->id2name($event['owner'],'account_fullname');
|
$message->organizername = $GLOBALS['egw']->accounts->id2name($event['owner'],'account_fullname');
|
||||||
$message->organizeremail = $GLOBALS['egw']->accounts->id2name($event['owner'],'account_email');
|
// at least iOS calendar crashes, if organizer has no email address (true = generate an email, if user has none)
|
||||||
|
$message->organizeremail = $GLOBALS['egw']->accounts->id2name($event['owner'], 'account_email', true);
|
||||||
|
|
||||||
$message->sensitivity = $event['public'] ? 0 : 2; // 0=normal, 1=personal, 2=private, 3=confidential
|
$message->sensitivity = $event['public'] ? 0 : 2; // 0=normal, 1=personal, 2=private, 3=confidential
|
||||||
|
|
||||||
@ -1102,7 +1103,7 @@ class calendar_zpush implements activesync_plugin_write, activesync_plugin_meeti
|
|||||||
if (is_numeric($uid))
|
if (is_numeric($uid))
|
||||||
{
|
{
|
||||||
$attendee->name = $GLOBALS['egw']->accounts->id2name($uid,'account_fullname');
|
$attendee->name = $GLOBALS['egw']->accounts->id2name($uid,'account_fullname');
|
||||||
$attendee->email = $GLOBALS['egw']->accounts->id2name($uid,'account_email');
|
$attendee->email = $GLOBALS['egw']->accounts->id2name($uid, 'account_email', true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1113,7 +1114,7 @@ class calendar_zpush implements activesync_plugin_write, activesync_plugin_meeti
|
|||||||
|
|
||||||
if (!$info['email'] && $info['responsible'])
|
if (!$info['email'] && $info['responsible'])
|
||||||
{
|
{
|
||||||
$info['email'] = $GLOBALS['egw']->accounts->id2name($info['responsible'],'account_email');
|
$info['email'] = $GLOBALS['egw']->accounts->id2name($info['responsible'], 'account_email', true);
|
||||||
}
|
}
|
||||||
$attendee->name = empty($info['cn']) ? $info['name'] : $info['cn'];
|
$attendee->name = empty($info['cn']) ? $info['name'] : $info['cn'];
|
||||||
$attendee->email = $info['email'];
|
$attendee->email = $info['email'];
|
||||||
|
Loading…
Reference in New Issue
Block a user