Source

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

{# users, cur_domain, allDomains, msg #}

{% extends "layout.html" %}

{% from "macros.html" import set_account_status_img, display_quota, %}

{% block title %}{{ _('Mail Users') }}{% endblock %}
{% block navlinks_active_users %}active{% endblock %}

{# Show drop-down menu of domain list #}
{% block id_welcome %}
<span>{{ _('View users under domain:') }} </span>
<span>
    <select id="domainSelect" name="domainName" onchange="changeDomain(this, baseurl='{{ctx.homepath}}/users/');">
        <option value="none" {% if cur_domain is sameas none %}selected{%endif%}>{{ _('Select one domain') }}</option>
        {% for d in allDomains %}
            <option value="{{d[1].domainName[0]}}" {% if cur_domain == d[1].domainName[0] %}selected{%endif%}>{{d[1].domainName[0]}}</option>
        {% endfor %}
    </select>
</span>
{% if users |length > 0 %}<span>{{ _('Total: %s.') |format(users |length) }}</span>{% endif %}
{% endblock id_welcome %}

{% block id_visit_links %}
<span><a href="{{ctx.homepath}}/create/user/{{cur_domain}}">{{ _('Create new mail user') }}</a></span>
{% if cur_domain is defined %}
<span><a href="{{ctx.homepath}}/profile/domain/general/{{cur_domain}}">{{ _('View/Update domain profile') }}</a></span>
{% endif %}
{% endblock id_visit_links %}

{% block main %}
{# Show system message #}
{% if msg is defined and msg is not sameas none %}
<div class="ct-box info-box">
    {% if msg == 'USER_DELETED_SUCCESS' %}
        <div class="success">{{ _('Selected accounts were deleted.') }}</div>
    {% elif msg == 'USER_DISABLED_SUCCESS' %}
        <div class="success">{{ _('Selected accounts were diabled.') }}</div>
    {% elif msg == 'USER_ENABLED_SUCCESS' %}
        <div class="success">{{ _('Selected accounts were enabled.') }}</div>
    {% else %}
        <div class="error">
            {% if msg == 'INVALID_PROFILE_TYPE' %}
                {{ _('Invalid profile type: %s.') |format(profile_type) }}
            {% elif msg == 'NO_DOMAIN_AVAILABLE' %}
                {{ _('No mail domain available.') }}
            {% else %}
                {{ msg }}
            {% endif %}
        </div>
    {% endif %}
</div>
{% endif %}

{% if users is defined %}
    {# List all users. #}
    <div class="main-frm">
    <form id="list_table" method="post" action="{{ctx.homepath}}/users/{{cur_domain}}">
    <table id="account_list" class="tablesorter">
        {# Table header. #}
        <thead>
        <tr>
            <th>{{ _('Display Name') }}</th>
            <th>{{ _('Mail Address') }}</th>
            <th>{{ _('Employee ID') }}</th>
            <th>{{ _('Quota') }}</th>
            <th>{{ _('Created Date') }}</th>
        </tr>
        </thead>

        {# List user attributes/avalues. #}
        <tbody>
        {% if users is not string or users |length != 0 %}
            {% for i in users %}
                {% set entries = i[1] %}
                {% set mail = entries.get('mail')[0] |string %}
                {% set cn = entries.get('cn', [''])[0].decode('utf-8') %}
                {% set employeeid = entries.get('employeeNumber', [''])[0].decode('utf-8') %}
                {# If not present, mark as 'disabled'. #}
                {% set accountStatus = entries.get('accountStatus', ['disabled'])[0] %} 
                {% set createTimestamp = entries.get('createTimestamp', ['--------------'])[0] %}

                {# Display username part of mail address when cn is empty. #}
                {% if cn == '' %}
                    {% set cn = mail.split('@', 1)[0] %}
                {% endif %}

                <tr class="{{ loop.cycle('odd', 'even') }} {{ accountStatus |lower }}">
                    <td>
                        <span class="float_left">
                            <input type="checkbox" name="mail" value="{{mail}}" />
                            <a href="{{ctx.homepath}}/profile/user/general/{{mail}}" title="{{ _('Edit user profile') }}">{{ cn }}</a>
                        </span>
                        <span class="float_right">{{ set_account_status_img(accountStatus) }}</span>
                    </td>
                    <td>{{mail}}</td>
                    <td>{{ employeeid }}</td>

                    {# mail quota #}
                    <td>{% if entries.get('mailQuota', ['0'])[0] == '0' %}{{ _('Unlimited') }}{% else %}{{ entries.get('mailQuota', ['0'])[0] |filesizeformat }} {% endif %}</td>

                    <td>{{createTimestamp[:4]}}-{{createTimestamp[4:6]}}-{{createTimestamp[6:8]}} {{createTimestamp[8:10]}}:{{createTimestamp[10:12]}}:{{createTimestamp[12:14]}}</td>
                </tr>
            {% endfor %}
        {% endif %}
        </tbody>
    </table>

    <div class="frm-buttons">
        <span class="submit">
            <input type="checkbox" id="checkall" />{{ _('Select/Unselect all') }}
            <input type="submit" name="delete" value="{{ _('Delete') }}" onclick="return confirm('{{ _('Are you sure want to delete selected account(s)?') }}');" }}" />
            <input type="submit" name="disable" value="{{ _('Disable') }}" onclick="return confirm('{{ _('Are you sure want to disable selected account(s)?') }}');" }}" />
            <input type="submit" name="enable" value="{{ _('Enable') }}" onclick="return confirm('{{ _('Are you sure want to enable selected account(s)?') }}');" }}" />
        </span>
    </div>
</form>
</div>
{% endif %}
{% endblock main %}
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.