iredadmin-ose / templates / default / ldap / macros.html

{% macro set_account_status_img(status) -%}
    {% if status == 'active' or status == 'yes' %}
        {% set img = "enabled.png" %}
    {% else %}
        {% set img = "disabled.png" %}
    {% endif %}
    <img title="{{ _('Status:') }} {{status |title }}" src="{{ctx.homepath}}/static/{{skin}}/images/{{img}}">
{%- endmacro %}

{% macro set_status_img(status) -%}
    {% if status == 'active' or status == 'yes' %}
        {% set img = "enabled.png" %}
    {% else %}
        {% set img = "disabled.png" %}
    {% endif %}
    <img title="{{status |title }}" src="{{ctx.homepath}}/static/{{skin}}/images/{{img}}">
{%- endmacro %}

{% macro display_input_img(image="", alt="") -%}
    <input type="image" src="{{ctx.homepath}}/static/{{skin}}/images/{{image}}" alt="{{alt}}">
{%- endmacro %}

{% macro input_hidden(name, value) -%}
    <input type="hidden" name="{{ name }}" value="{{ value }}">
{%- endmacro %}

{% macro display_cn(value='', accountType='domain', firstitem='yes') -%}
    <fieldset class="frm-group {% if firstitem == 'yes' %}group1{% endif %}">
        <div class="sf-set {% if firstitem == 'yes' %}set1{% endif %}">
            <div class="sf-box text">
                <label><span>
                {% if accountType == 'domain' %}
                    {{ _('Company/Organization') }}
                {% else %}
                    {{ _('Display Name') }}
                {% endif %}
                </span></label>
                <span class="fld-input"><input type="text" name="cn" value="{% if value != 'None' %}{{value}}{% endif %}" size="35" /></span>
            </div>
        </div>
    </fieldset>
{%- endmacro %}

{% macro display_preferredLanguage(value='', languagemaps=['en_US',], firstitem='yes') -%}
    <fieldset class="frm-group {% if firstitem == 'yes' %}group1{% endif %}">
        <div class="sf-set {% if firstitem == 'yes' %}set1{% endif %}">
            <div class="sf-box select">
                <label><span>{{ _('Default language') }}</span></label>
                <span class="fld-input">
                    <select name="preferredLanguage">
                        {% for lang in languagemaps %}
                            <option value="{{lang}}" {% if value == lang %}selected{%endif%}>{{languagemaps[lang]}}</option>
                        {% endfor %}
                    </select>
            </div>
        </div>
    </fieldset>
{%- endmacro %}

{# Display accountStatus #}
{% macro display_account_status(accountStatus, firstitem='yes') %}
    <fieldset class="frm-group {% if firstitem == 'yes' %}group1{% endif %}">
        <fieldset class="mf-set required {% if firstitem == 'yes' %}set1{% endif %}">
            <legend><span>{{ _('Account status') }}<em>{{ _('(Required)') }}</em></span></legend>
            <div class="mf-box">
                <div class="mf-item">
                    <span class="fld-input"><input type="radio" name="accountStatus" value="active" {% if accountStatus == 'active' %}checked="on"{%endif%}/></span>
                    <label>{{ _('Active') }}</label>
                </div>
                <div class="mf-item">
                    <span class="fld-input"><input type="radio" name="accountStatus" value="disabled" {% if accountStatus == 'disabled' %}checked{%endif%}/></span>
                    <label>{{ _('Disabled') }}</label>
                </div>
            </div>
        </fieldset>
    </fieldset>
{%- endmacro %}

{# Display domainBackupMX #}
{% macro display_domain_backup_mx(domainBackupMX) %}
    <fieldset class="frm-group group1">
        <legend class="group-legend"><strong>{{ _('Backup MX') }}</strong></legend>
        <fieldset class="mf-set">
            <legend><span>{{ _('Backup MX') }}</span></legend>
            <div class="mf-box">
                <div class="mf-item">
                    <span class="fld-input"><input type="radio" name="domainBackupMX" {% if domainBackupMX == 'yes' %}value="yes" checked{%endif%} /></span>
                    <label>{{ _('Enabled') }}</label>
                </div>
                <div class="mf-item">
                    <span class="fld-input"><input type="radio" name="domainBackupMX" {% if domainBackupMX == 'no' %}value="no" checked{%endif%} /></span>
                    <label>{{ _('Disabled') }}</label>
                </div>
            </div>
        </fieldset>
    </fieldset>
{%- endmacro %}

{% macro display_all_admins(admins, domainAdmins=[]) -%}
    <div class="frm-group group1">
        <fieldset class="mf-set set1">
        <legend><span>{{ _('Domain admin assignment') }}<em>{{ _('If no admin assigned, you can manage it with global admin.') }}</em></span></legend>
        <div class="mf-box">
            <div class="checklist">
                <fieldset>
                    {% for admin in admins %}
                    {% set adminMail = admin[1].get('mail')[0] %}
                    <div class="checklist-item">
                        <span class="fld-input">
                            <input type="checkbox" name="domainAdmin" value="{{ adminMail }}" {% if adminMail in domainAdmins %}checked{%endif%} />
                        </span>
                        <label>
                            {% if admin[1].has_key('cn') %}
                                {{ _("%s (%s)") |format( admin[1].get('cn')[0].decode('utf-8'), adminMail ) }}
                            {% else %}
                            {{ adminMail }}
                            {% endif %}
                            {% if 'yes' in admin[1].get('domainGlobalAdmin', []) %}<em><strong>{{ _('(Global Admin)') }}</strong></em>{% endif %}
                        </label>
                    </div>
                    {% endfor %}
                </fieldset>
            </div>
            <div><span><a href="{{ctx.homepath}}/create/admin" target="_blank">{{ _('Create new mail admin') }}</a></span></div>
        </div>
    </fieldset>
{%- endmacro %}

{% macro display_mta_transport(mtaTransport) -%}
    <fieldset class="frm-group">
        <legend class="group-legend"><strong>{{ _('MTA transport') }}</strong></legend>
        <div class="sf-set">
            <div class="sf-box text required">
                <label><span>{{ _('MTA transport') }}</span><small>{{ _('Default is <strong>%s</strong>.') |format(mtaTransport) }}</em></small></label>
                <span class="fld-input"><input type="text" name="mtaTransport" size="25" /><em>{{ _('Leave it empty to use default transport.') }}</em></span>
            </div>
        </div>
    </fieldset>
{%- endmacro %}

{% macro display_password_policy(min_passwd_length='0', max_passwd_length='0') -%}
    {% if min_passwd_length != '0' or max_passwd_length != '0' %}
    <div class="ct-box info-box">
        <ul class="info-list">
            {% if min_passwd_length != '0' %}
            <li><span>{{ _('New password must contain at least <strong>%s</strong> characters.') |format(min_passwd_length) }}</span><br />
            {% endif %}

            {% if max_passwd_length != '0' %}
            <li><span>{{ _('New password must <strong>NOT</strong> contain more than <strong>%s</strong> characters.') |format(max_passwd_length) }}</span><br />
            {% endif %}
        </ul>
    </div>
    {% endif %}
{%- endmacro %}

{% macro display_reset_password(oldpw='', newpw='', confirmpw='', show_oldpw='no', show_confirmpw='yes', firstitem='yes') -%}
    <fieldset class="frm-group {%if firstitem == 'yes' %}group1{%endif%}">
        <legend class="group-legend"><strong>Required information</strong></legend>
        {% if show_oldpw == 'yes' %}
        <div class="sf-set {%if firstitem == 'yes' %}set1{%endif%}">
            <div class="sf-box text required">
                <label for="oldpw"><span>{{ _('Old password') }} <em>{{ _('(Required)') }}</em></span></label><br />
                <span class="fld-input"><input type="password" name="oldpw" size="35" value="{{oldpw}}"/></span><br />
            </div>
        </div>
        {% endif %}

        <div class="sf-set">
            <div class="sf-box text required">
                <label for="newpw"><span>{{ _('New password') }} <em>{{ _('(Required)') }}</em></span></label><br />
                <span class="fld-input"><input type="password" name="newpw" size="35" value="{{newpw}}"/></span><br />
            </div>
        </div>

        {% if show_confirmpw == 'yes' %}
        <div class="sf-set">
            <div class="sf-box text required">
                <label for="confirmpw"><span>{{ _('Confirm new password') }} <em>{{ _('(Required)') }}</em></span> <small>{{ _('Re-enter your password exactly as before.') }}</small></label><br />
                <span class="fld-input"><input type="password" name="confirmpw" size="35" value="{{confirmpw}}"/></span><br />
            </div>
        </div>
        {% endif %}
    </fieldset>
{%- endmacro %}

{% macro display_quota(value='', show_quota_in_input='no', display_current_value='yes', firstitem='yes') -%}
<fieldset class="frm-group {% if firstitem == 'yes' %}group1{% endif %}">
    <div class="sf-set {% if firstitem == 'yes' %}set1{% endif %}">
        <div class="sf-box text">
            <label><span>{{ _('Mail quota (in MB)') }}</span></label>
            <span class="fld-input"><input type="text" name="mailQuota" {% if show_quota_in_input == 'yes' %}value="{{value}}"{% endif%} size="25" />{% if display_current_value == 'yes' %}&nbsp;{{_('Current quota:') }} {% if value == 0 or value == '0' or value == 'None' %}<strong>{{ _('Unlimited') }}</strong>{%else%}<strong>{{ value |filesizeformat}}</strong>&nbsp;({{value}}&nbsp;Bytes){%endif%}{%endif%}</span>
        </div>
    </div>
</fieldset>
{%- endmacro %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.