Source

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

{# defined: profile_type, mail, profile, languagemaps, [msg], #}
{% extends "layout.html" %}
{% from "macros.html" import
                set_account_status_img,
                display_account_status,
                display_cn,
                display_preferredLanguage,
                display_password_policy,
                display_reset_password,
                with context
                %}

{% block js %}{% endblock js %}
{% block js_tablesorter %}{% endblock js_tablesorter %}
{% block jquery_docoment_ready %}{% endblock jquery_docoment_ready %}

{% block title %}{{ _('Edit admin profile') }}{% endblock %}
{% block navlinks_active_admins %}active{% endblock %}

{% block id_welcome %}
<span><a href="{{ctx.homepath}}/profile/admin/general/{{mail}}" {% if profile_type == 'general' %}class="active"{%endif%}>{{ _('General') }}</a>&nbsp;</span>
<span><a href="{{ctx.homepath}}/profile/admin/password/{{mail}}" {% if profile_type == 'password' %}class="active"{%endif%}>{{ _('Reset password') }}</a>&nbsp;</span>
{% endblock id_welcome %}

{% if session.get('domainGlobalAdmin') == 'yes' %}
    {% block id_visit_links %}
        <span><a href="{{ctx.homepath}}/admins">{{ _('Back to admin list') }}</a></span>
    {% endblock id_visit_links %}
{% endif %}

{% block main %}

{# Show message #}
{% if msg is defined and msg is not sameas none %}
    <div class="ct-box info-box">
    {% if msg == 'ADMIN_CREATED_SUCCESS' %}
        <div class="success">{{ _('Account created success. Would you like to <a href="%s/create/admin">add one more</a>?') |format(ctx.homepath) }}</div>
    {% elif msg == 'ADMIN_PROFILE_UPDATED_SUCCESS' %}
        <div class="success">{{ _('Profile update success.') }}</div>
    {% else %}
        <div class="error">
            {% if msg == 'PERMISSION_DENIED' %}
                {{ _("You are NOT permited to view/update other's profile.") }}
            {# Password related #}
            {% elif msg == 'INCORRECT_OLDPW' %}
                {{ _('Current password is incorrect.') }}
            {% elif msg == 'PW_LESS_THAN_MIN_LENGTH' %}
                {{ _('New password must contain at least %s characters.') |format(min_passwd_length) }}
            {% elif msg == 'PW_MISMATCH' %}
                {{ _('New passwords are not match.') }}
            {% else %}
                {# Catch-all #}
                {{ msg }}
            {% endif %}
        </div>
    {% endif %}
    </div>
{% endif %}

{% set entry = profile[0][1] %}
{% set cn = entry.get('cn', [''])[0].decode('utf-8') %}
{% set accountStatus = entry.get('accountStatus', ['disabled'])[0] %}
{% set createTimestamp = entry.get('createTimestamp', ['--------------'])[0] %}

<form class="frm-form" method="post" action="{{ctx.homepath}}/profile/admin/{{profile_type}}/{{mail}}">
<div class="main-frm">
    <div class="profile ct-group data-group vcard">
        <div class="ct-set data-set set1">
            <div class="ct-box data-box">
                <ul class="data-list">
                    <li class="username fn nickname"><span>{{ _('Display Name') }}{{ _(':') }} <strong>{{cn}}</strong></span></li>
                    <li><span>{{ _('Mail Address') }}{{ _(':') }} <strong>{{mail}}</strong> {{ set_account_status_img(accountStatus) }}</span></li>
                    <li><span>{{ _('Created Date') }}{{ _(':') }} <strong>{{createTimestamp[:4]}}-{{createTimestamp[4:6]}}-{{createTimestamp[6:8]}} {{createTimestamp[8:10]}}:{{createTimestamp[10:12]}}:{{createTimestamp[12:14]}}</strong></span></li>
                </ul>
            </div>
        </div>
    </div>
{% if profile_type == 'general' %}
    {% set preferredLanguage = entry.get('preferredLanguage', ['en_US'])[0] |string %}

    {{ display_account_status(accountStatus, firstitem='yes',) }}

    {{ display_cn(
            value=cn,
            accountType='admin')
            }}

    {{ display_preferredLanguage(
            value=preferredLanguage,
            languagemaps=languagemaps)
            }}
{% endif %}

{% if profile_type == 'password' %}
    {{ display_password_policy(
            min_passwd_length=min_passwd_length,
            max_passwd_length=max_passwd_length)
            }}

    {% if session.get('domainGlobalAdmin') == 'yes' %}
        {{ display_reset_password(show_confirmpw='yes') }}
    {% else %}
        {{ display_reset_password(show_oldpw='yes', show_confirmpw='yes') }}
    {% endif %}

{% endif %}

    <div class="frm-buttons">
        <span class="submit"><input type="submit" value="{{ _('Save changes') }}" /></span>
    </div>
</form>
{% 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.