mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
* Calendar/CalDAV: config to replace email-domain eg. for a migration
This commit is contained in:
parent
8bbb05a596
commit
4f2ad476a6
@ -1033,6 +1033,13 @@ class Principals extends Handler
|
||||
break;
|
||||
|
||||
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')))
|
||||
{
|
||||
$type = $uid > 0 ? 'users' : 'groups';
|
||||
|
@ -2797,6 +2797,13 @@ class calendar_ical extends calendar_boupdate
|
||||
{
|
||||
$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)
|
||||
if (!$uid && !empty($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">
|
||||
<grid width="100%" class="admin-config egwGridView_grid">
|
||||
<columns>
|
||||
<column width="60%"/>
|
||||
<column width="50%"/>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows>
|
||||
@ -120,6 +120,16 @@
|
||||
<description value="Limit search for conflicts in recurrences to given number of recurrences"/>
|
||||
<float id="newsettings[conflict_max_checked]"/>
|
||||
</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>
|
||||
</grid>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user