forked from extern/egroupware
* Calendar/CalDAV: config to replace email-domain eg. for a migration
This commit is contained in:
parent
c279290b01
commit
01335f787d
@ -1033,6 +1033,13 @@ class Principals extends Handler
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'mailto':
|
case 'mailto':
|
||||||
|
// check if we need to replace email domain with something else in participants (mail address migration)
|
||||||
|
if (!empty($rest) && !empty($GLOBALS['egw_info']['server']['calendar_domain_replace']) &&
|
||||||
|
!empty($GLOBALS['egw_info']['server']['calendar_domain_replace_with']))
|
||||||
|
{
|
||||||
|
$rest = preg_replace('/@' . preg_quote($GLOBALS['egw_info']['server']['calendar_domain_replace'], '/') . '(>|$)/i',
|
||||||
|
'@' . $GLOBALS['egw_info']['server']['calendar_domain_replace_with'] . '$1', $e = $rest);
|
||||||
|
}
|
||||||
if (($uid = $GLOBALS['egw']->accounts->name2id($rest, 'account_email')))
|
if (($uid = $GLOBALS['egw']->accounts->name2id($rest, 'account_email')))
|
||||||
{
|
{
|
||||||
$type = $uid > 0 ? 'users' : 'groups';
|
$type = $uid > 0 ? 'users' : 'groups';
|
||||||
|
@ -2797,6 +2797,13 @@ class calendar_ical extends calendar_boupdate
|
|||||||
{
|
{
|
||||||
$email = $attributes['value'];
|
$email = $attributes['value'];
|
||||||
}
|
}
|
||||||
|
// check if we need to replace email domain with something else in participants (mail address migration)
|
||||||
|
if (!empty($email) && !empty($GLOBALS['egw_info']['server']['calendar_domain_replace']) &&
|
||||||
|
!empty($GLOBALS['egw_info']['server']['calendar_domain_replace_with']))
|
||||||
|
{
|
||||||
|
$email = preg_replace('/@'.preg_quote($GLOBALS['egw_info']['server']['calendar_domain_replace'], '/').'(>|$)/i',
|
||||||
|
'@'.$GLOBALS['egw_info']['server']['calendar_domain_replace_with'].'$1', $e=$email);
|
||||||
|
}
|
||||||
// try X-EGROUPWARE-UID, but only if it resolves to same email (otherwise we are in trouble if different EGw installs talk to each other)
|
// try X-EGROUPWARE-UID, but only if it resolves to same email (otherwise we are in trouble if different EGw installs talk to each other)
|
||||||
if (!$uid && !empty($attributes['params']['X-EGROUPWARE-UID']) &&
|
if (!$uid && !empty($attributes['params']['X-EGROUPWARE-UID']) &&
|
||||||
($res_info = $this->resource_info($attributes['params']['X-EGROUPWARE-UID'])) &&
|
($res_info = $this->resource_info($attributes['params']['X-EGROUPWARE-UID'])) &&
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<template id="calendar.config" template="" lang="" group="0" version="16.1">
|
<template id="calendar.config" template="" lang="" group="0" version="16.1">
|
||||||
<grid width="100%" class="admin-config egwGridView_grid">
|
<grid width="100%" class="admin-config egwGridView_grid">
|
||||||
<columns>
|
<columns>
|
||||||
<column width="60%"/>
|
<column width="50%"/>
|
||||||
<column/>
|
<column/>
|
||||||
</columns>
|
</columns>
|
||||||
<rows>
|
<rows>
|
||||||
@ -120,6 +120,16 @@
|
|||||||
<description value="Limit search for conflicts in recurrences to given number of recurrences"/>
|
<description value="Limit search for conflicts in recurrences to given number of recurrences"/>
|
||||||
<float id="newsettings[conflict_max_checked]"/>
|
<float id="newsettings[conflict_max_checked]"/>
|
||||||
</row>
|
</row>
|
||||||
|
<row>
|
||||||
|
<description value="Email address migration" span="all" class="subHeader"/>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<description value="Change domain of participants in CalDAV requests"/>
|
||||||
|
<hbox>
|
||||||
|
<textbox id="newsettings[calendar_domain_replace]" blur="replace" size="48"/>
|
||||||
|
<textbox id="newsettings[calendar_domain_replace_with]" blur="with" size="48"/>
|
||||||
|
</hbox>
|
||||||
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user