Source

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

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

{% block js_tablesorter %}{% endblock %}

{% block title %}{{ _('Preferences') }}{% 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 %}

<div class="main-subhead">
    <h2 class="hn"><span>
    {% if profile_type == 'general' %}
        {% if mail == session.get('username') %}
            {{ _('View/Update your preferences.') }}
        {% else %}
            {{ _("View/Update <strong>%s</strong>'s preferences.") |format(mail) }}
        {% endif %}
    {% elif profile_type == 'password' %}
        {% if mail == session.get('username') %}
            {{ _('Reset your password.') }}
        {% else %}
            {{ _("Reset <strong>%s</strong>'s password.") |format(mail) }}
        {% endif %}
    {% endif %}
    </span></h2>
</div>

{# Show message #}
{% if msg is defined and msg is not sameas none %}
    <div class="ct-box info-box">
    {% if msg == '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 %}

<form class="frm-form" method="post" action="{{ctx.homepath}}/profile/admin/{{profile_type}}/{{mail}}">
{% if profile_type == 'general' %}
    {% if profile[0] is sameas true %}
        {% set entry = profile[1][0][1] %}
        {% set cn = entry.get('cn', [''])[0].decode('utf-8') %}
        {% set preferredLanguage = entry.get('preferredLanguage', ['en_US'])[0] |string %}
    {% endif %}

    {{ 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.