Source

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

{#
#---------------------------------------------------------------------
# This file is part of iRedAdmin-OSE, which is official web-based admin
# panel (Open Source Edition) for iRedMail.
#
# iRedMail is an open source mail server solution for Red Hat(R)
# Enterprise Linux, CentOS, Debian and Ubuntu.
#
# iRedAdmin-OSE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# iRedAdmin-OSE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with iRedAdmin-OSE.  If not, see <http://www.gnu.org/licenses/>.
#---------------------------------------------------------------------
#}

{# 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
                %}
{% from "msgHandlers.html" import adminMsgHandler 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 system message #}
{{ adminMsgHandler(msg) }}

{% 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 %}