iredadmin-ose / templates / default / ldap / user / list.html

{% extends "layout.html" %}

{% from "macros/general.html" import
        display_csrf_token,
        set_account_status_img,
        highlight_username_in_mail,
        show_pages,
        with context %}

{% from "macros/msgHandlers.html" import userMsgHandler with context %}

{% block title %}{{ _('Mail Users') }}{% endblock %}
{% block navlinks_active_domains %}class="active"{% endblock %}


{% block main %}

{# Show system message #}
{{ userMsgHandler(msg) }}

{% if users is defined %}
    {# List all users. #}
    <div class="content-box">
        <div class="box-body">
            <div class="box-header clear">
                <ul class="tabs clear">
                    <li class="active"><a href="{{ctx.homepath}}/users/{{cur_domain}}">{{ _('Users') }}</a></li>
                    <li><a href="{{ctx.homepath}}/create/user/{{cur_domain}}"><img src="{{ctx.homepath}}/static/{{skin}}/images/ico_add_12.png" /> {{ _('User') }}</a>
                </ul>

                <h2>
                    {{ _('Users under domain: %s') |format(cur_domain) }}
                    {% if total is defined and users|length > 0 %}
                        ({{ (cur_page-1) * pageSizeLimit + 1 }}-{{ (cur_page-1) * pageSizeLimit + users|length}}/{{ total }})
                    {% endif %}
                    <a href="{{ctx.homepath}}/profile/domain/general/{{cur_domain}}"><img src="{{ctx.homepath}}/static/{{skin}}/images/action_edit.png" title="{{ _('Edit domain profile') }}" class="vcenter"/></a>
                </h2>
            </div>

            <div id="user_list">
                <form name="users" id="account_list" method="post" action="{{ctx.homepath}}/users/{{cur_domain}}">
                    {{ display_csrf_token() }}
                    <table class="style1 tablesorter" cellspacing="0">
                        <thead>
                            <tr>
                                <th class="checkbox"><input type="checkbox" class="checkbox select-all" /></th>
                                <th>{{ _('Display Name') }}</th>
                                <th>{{ _('Mail Address') }}</th>
                                <th>{{ _('User ID') }}</th>
                                <th>{{ _('Job Title') }}</th>
                                <th>{{ _('Quota') }}</th>
                            </tr>
                        </thead>

                    <tbody>
                        {% if users|length > 0 %}
                            {% for (dn, entries) in users %}
                                {% set mail = entries.get('mail')[0] |string |e %}
                                {% set cn = entries.get('cn', [''])[0].decode('utf-8') |e %}
                                {% set employeeid = entries.get('employeeNumber', [''])[0].decode('utf-8') |e %}
                                {% set jobTitle = entries.get('title', [''])[0].decode('utf-8') |e %}

                                {### If accountStatus is not present, mark as 'disabled'. #}
                                {% set accountStatus = entries.get('accountStatus', ['disabled'])[0] |e %}

                                {% set mailQuota = entries.get('mailQuota', ['0'])[0] |e %}
                                {% set shadowAddresses = entries.get('shadowAddress', []) %}

                                <tr class="{{ accountStatus |lower }}">
                                    <td class="checkbox"><input type="checkbox" name="mail" value="{{mail}}" /></td>
                                    <td class="vcenter">
                                        <a href="{{ctx.homepath}}/profile/user/general/{{mail}}"><img src="{{ctx.homepath}}/static/{{skin}}/images/action_edit.png" title="{{ _('Edit account profile') }}" class="fr-space"/></a>
                                        {{ set_account_status_img(accountStatus) }}
                                        {{ cn |cutString }}
                                    </td>
                                    <td class="vcenter">{{ highlight_username_in_mail(mail) }}</td>
                                    <td class="vcenter">{{ employeeid }}</td>
                                    <td class="vcenter">{{ jobTitle }}</td>
                                    <td class="vcenter">{{ mailQuota |filesizeformat }}</td>
                                </tr>
                            {% endfor %}
                        {% else %}
                            <tr>
                                <td class="checkbox"></td>
                                <td colspan="5">{{ _('No mail user available.') }} <a href="{{ctx.homepath}}/create/user/{{ cur_domain }}">{{ _('Add one') }}</a>?</td>
                            </tr>
                        {% endif %}
                    </tbody>
                </table>

                <input type="hidden" name="cur_page" value="{{cur_page}}" />

                <div class="tab-footer clear f1">
                    <div class="fl">
                        <select name="action" class="fl-space">
                            <option>{{ _('Choose Action') }}</option>
                            <option value="enable">{{ _('Enable') }}</option>
                            <option value="disable">{{ _('Disable') }}</option>
                            <option value="delete">{{ _('Delete') }}</option>
                        </select>
                        <input type="submit" value="{{ _('Apply') }}" class="button fl-space" />
                    </div>

                    {{ show_pages(baseurl=ctx.homepath + '/users/' + cur_domain, total=total, cur_page=cur_page) }}
                </div>
            </div>
        </form>
    </div>{# #user_list #}
</div>
{% endif %}
{% endblock main %}

{% block js %}
    {{ load_jquery(['tablesorter'], nonSortedCols=[0]) }}
{% endblock js %}
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.