{# @queryResult List which stores LDAP query results #} {% extends "layout.html" %} {% from "macros/general.html" import set_account_status_img, highlight_username_in_mail, display_maillist_restrictions, with context %} {% from "macros/msgHandlers.html" import searchMsgHandler with context %} {% block title %}{{ _('Search') }}{% endblock %} {% block main %} {{ searchMsgHandler(msg) }}

{{ _('Search account display name or email') }}

{% if totalResults is defined %}

{{ _('Search results.') }}

{% if totalResults > 0 %} {# List all users. #} {% if users |length > 0 %}

{{ _('%d user(s) found.') |format( users |length ) }}

{% for account in users %} {% set mail = account.get('mail')[0] |string %} {% set accountStatus = account.get('accountStatus', ['disabled'])[0] %} {# mail quota #} {% endfor %}
{{ _('Display Name') }} {{ _('Mail Address') }} {{ _('User ID') }} {{ _('Job Title') }} {{ _('Quota') }} {{ _('Created') }}
{{ set_account_status_img(accountStatus) }} {{ account.get('cn', [''])[0].decode('utf-8') |cutString }} {{ highlight_username_in_mail(mail) }} {{ account.get('employeeNumber', [''])[0].decode('utf-8') }} {{ account.get('title', [''])[0].decode('utf-8') }}{% if account.get('mailQuota', ['0'])[0] == '0' %}{{ _('Unlimited') }}{% else %}{{ account.get('mailQuota', ['0'])[0] |filesizeformat }} {% endif %} {{ account.get('createTimestamp', ['--------------'])[0] |setDatetimeFormat(hour=false) }}
{% endif %} {# List all mail lists. #} {% if maillists |length > 0 %}

{{ _('%d mail list(s) found.') |format( maillists |length ) }}

{# List group attributes/avalues. #} {% for account in maillists %} {% set mail = account.get('mail')[0] |string %} {% set accessPolicy = account.get('accessPolicy', ['public'])[0] %} {% endfor %}
{{ _('Display Name') }} {{ _('Mail Address') }} {{ _('Mail Deliver Restriction') }} {{ _('Created') }}
{{ set_account_status_img(account.get('accountStatus', ['disabled'])[0]) }} {{ account.get('cn', [''])[0].decode('utf-8') |cutString }} {{ highlight_username_in_mail(mail) }} {{ display_maillist_restrictions(policy=accessPolicy, maillist_email=mail) }} {{ account.get('createTimestamp', ['--------------'])[0] |setDatetimeFormat(hour=false) }}
{% endif %} {# List all mail aliases. #} {% if aliases |length > 0 %}

{{ _('%d mail alias(es) found.') |format( aliases |length ) }}

{# List alias attributes/avalues. #} {% for account in aliases %} {% set mail = account.get('mail')[0] |string %} {% endfor %}
{{ _('Display Name') }} {{ _('Mail Address') }} {{ _('Created') }}
{{ set_account_status_img(account.get('accountStatus', ['disabled'])[0]) }} {{ account.get('cn', [''])[0].decode('utf-8') |cutString }} {{ highlight_username_in_mail(mail) }} {{ account.get('createTimestamp', ['--------------'])[0] |setDatetimeFormat(hour=false) }}
{% endif %} {% elif totalResults == 0 %}

{{ _('Your search returned no hits.') }}

{% endif %}

{# .box-wrap #}
{# .box-body #}
{# .content-box #} {% endif %} {% endblock main %}