wildcards and profile options for mail routing

This commit is contained in:
Roland Gruber 2018-04-14 16:07:13 +02:00
parent 7541a15193
commit ff4a77a738
2 changed files with 27 additions and 5 deletions

View File

@ -1933,7 +1933,7 @@
</mediaobject> </mediaobject>
</screenshot> </screenshot>
<para>Usage:</para> <para><emphasis role="bold">Usage</emphasis></para>
<para>You can specify a routing address, the mail server and a number of <para>You can specify a routing address, the mail server and a number of
local addresses to route.</para> local addresses to route.</para>
@ -1948,6 +1948,24 @@
</imageobject> </imageobject>
</mediaobject> </mediaobject>
</screenshot> </screenshot>
<para><emphasis role="bold">Wildcards</emphasis></para>
<para>The module supports wildcards in the following input
fields:</para>
<itemizedlist>
<listitem>
<para>Routing address</para>
</listitem>
<listitem>
<para>Local address</para>
</listitem>
</itemizedlist>
<para>See the other modules that you activated what wildcards they
provide (e.g. $user).</para>
</section> </section>
<section> <section>

View File

@ -1,9 +1,8 @@
<?php <?php
/* /*
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2004 - 2015 Roland Gruber Copyright (C) 2004 - 2018 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -94,7 +93,9 @@ class inetLocalMailRecipient extends baseModule {
// profile options // profile options
$profileContainer = new htmlTable(); $profileContainer = new htmlTable();
$profileContainer->addElement(new htmlTableExtendedInputCheckbox('inetLocalMailRecipient_addExt', false, _('Automatically add this extension'), 'autoAdd'), true); $profileContainer->addElement(new htmlTableExtendedInputCheckbox('inetLocalMailRecipient_addExt', false, _('Automatically add this extension'), 'autoAdd'), true);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Mail server'), 'inetLocalMailRecipient_host', null, 'mailHost')); $profileContainer->addElement(new htmlTableExtendedInputField(_('Routing address'), 'inetLocalMailRecipient_mailRoutingAddress', null, 'mailRoutingAddress'), true);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Local address'), 'inetLocalMailRecipient_mailLocalAddress', null, 'localAdr'), true);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Mail server'), 'inetLocalMailRecipient_host', null, 'mailHost'), true);
$return['profile_options'] = $profileContainer; $return['profile_options'] = $profileContainer;
// profile checks // profile checks
$return['profile_checks']['inetLocalMailRecipient_host'] = array( $return['profile_checks']['inetLocalMailRecipient_host'] = array(
@ -103,7 +104,9 @@ class inetLocalMailRecipient extends baseModule {
'error_message' => $this->messages['mailHost'][0]); 'error_message' => $this->messages['mailHost'][0]);
// profile mappings // profile mappings
$return['profile_mappings'] = array( $return['profile_mappings'] = array(
'inetLocalMailRecipient_host' => 'mailHost' 'inetLocalMailRecipient_host' => 'mailHost',
'inetLocalMailRecipient_mailRoutingAddress' => 'mailRoutingAddress',
'inetLocalMailRecipient_mailLocalAddress' => 'mailLocalAddress',
); );
// upload fields // upload fields
$return['upload_columns'] = array( $return['upload_columns'] = array(
@ -234,6 +237,7 @@ class inetLocalMailRecipient extends baseModule {
return array(); return array();
} }
$errors = array(); $errors = array();
$this->getAccountContainer()->replaceWildcardsInPOST(array('localAdr', 'mailRoutingAddress'));
$this->attributes['mailRoutingAddress'] = array(); $this->attributes['mailRoutingAddress'] = array();
$this->attributes['mailLocalAddress'] = array(); $this->attributes['mailLocalAddress'] = array();
$this->attributes['mailHost'] = array(); $this->attributes['mailHost'] = array();