{# @allDomains LDAP query result set @domain Current domain name. @domainAccountSetting @numberOfCurrentAccounts @[msg,] #} {% extends "layout.html" %} {% from "macros/general.html" import display_subnav, display_input_cn, with context %} {% from "macros/msgHandlers.html" import aliasMsgHandler, warningInfo with context %} {% block title %}{{ _('Add alias') }}{% endblock title %} {% block navlinks_active_create %}class="active"{% endblock %} {% block breadcrumb %} {% set crumbs = [ (ctx.homepath + '/domains', _('All domains'),), (ctx.homepath + '/profile/domain/general/' + cur_domain, cur_domain,), (ctx.homepath + '/aliases/' + cur_domain, _('Mail Aliases'),), (None, _('Add mail alias'),), ] %} {{ display_subnav(crumbs) }} {% endblock %} {% block main %} {# Show system message #} {{ aliasMsgHandler(msg) }} {# Number of accounts #} {% set numberOfAccounts = domainAccountSetting.get('numberOfAliases', '0') %} {# Display input field for adding new alias. #}
{% set createNewAccount = true %} {% if numberOfAccounts != '0' %} {% if numberOfCurrentAccounts >= numberOfAccounts |int %} {% set createNewAccount = false %}

{{ _('Error:') }} {{ _("You can't create more mail aliases under domain %s.") |format('' + cur_domain + '') }} {{ _('Already exceed max number of account limit (%s).') |format(numberOfAccounts) }}

{% else %}

{{ _('You can create %d more mail alias(es) under domain %s.') |format(numberOfAccounts |int - numberOfCurrentAccounts, '' + cur_domain + '') }}

{% endif %} {% endif %}

{{ _('Mail Address') }} *

@
{{ display_input_cn(cn=cn, accountType='alias', size="size-170") }}

 

{# -- End col2-3 #}
{# -- Recommend to use mail list instead of alias -- #} {{ warningInfo( _("It's better to use mail list instead of alias, since we have mail deliver restriction for mail list.") ) }}
{# -- End columns -- #}
{# -- End box-wrap -- #}
{# -- End content-box -- #}
{# -- End box-body -- #} {% endblock main %}