disable UI for forwarding, if it is not supported by smtp server plugin

This commit is contained in:
Ralf Becker 2014-11-12 11:18:01 +00:00
parent d3cc56767f
commit afe5d7f77f
2 changed files with 9 additions and 1 deletions

View File

@ -1221,6 +1221,14 @@ class emailadmin_wizard
$readonlys['tabs']['emailadmin.account.aliases'] = !$content['acc_smtp_type'] ||
$content['acc_smtp_type'] == 'emailadmin_smtp';
// allow smtp class to disable certain features in alias tab
if ($content['acc_smtp_type'] && class_exists($content['acc_smtp_type']) &&
is_a($content['acc_smtp_type'], 'emailadmin_smtp_ldap', true))
{
$content['no_forward_available'] = !constant($content['acc_smtp_type'].'::FORWARD_ATTR');
$readonlys['deliveryMode'] = !constant($content['acc_smtp_type'].'::FORWARD_ONLY_ATTR');
}
// allow imap classes to disable certain tabs or fields
if (($class = emailadmin_account::getIcClass($content['acc_imap_type'])) && class_exists($class) &&
($imap_ro = call_user_func(array($class, 'getUIreadonlys'))))

View File

@ -255,7 +255,7 @@
<taglist id="mailAlternateAddress" autocomplete_url=""/>
<description/>
</row>
<row>
<row disabled="@no_forward_available">
<description for="mailForwardingAddress" value="Forward email's to"/>
<taglist id="mailForwardingAddress" autocomplete_url=""/>
<checkbox label="Forward only" id="deliveryMode" selected_value="forwardOnly" onchange="if (widget.getValue()) et2_dialog.alert('Forward only disables IMAP mailbox / storing of mails and just forwards them to given address.','Forward only');"/>