{% extends "layout.html" %} {% from "macros/form_inputs.html" import input_submit, input_csrf_token with context %} {% from "macros/general.html" import display_subnav, display_input_cn, display_preferred_language, display_timezones, display_quota, display_input_employeeid, display_input_mobile, display_phone_numbers, display_account_status, display_reset_password, display_random_password, display_mark_user_as_admin with context %} {% from "macros/ldap.html" import display_job_titles, with context %} {% from "macros/msg_handlers.html" import warning_info, user_msg_handler with context %} {% block title %}{{ _('Edit account profile') }}{% endblock %} {% block navlinks_domains %}class="active"{% endblock %} {# User profile. #} {% set mail = user_profile.get('mail')[0] |e %} {% set cn = user_profile.get('cn', [ mail.split('@')[0] ])[0] |e %} {% set username, cur_domain = mail.split('@', 1) %} {% set employeeNumber = user_profile.get('employeeNumber', [''])[0] |e %} {% set accountStatus = user_profile.get('accountStatus', ['disabled'])[0] |e %} {# Disabled user profiles #} {% set disabled_user_profiles = domainAccountSetting.get('disabledUserProfile', []) %} {% if profile_type == 'general' %} {% set first_name = user_profile.get('givenName', [''])[0] |e %} {% set last_name = user_profile.get('sn', [''])[0] |e %} {% set jobtitles = user_profile.get('title', []) %} {% set mobile = user_profile.get('mobile', [''])[0] |e %} {% set telephoneNumber = user_profile.get('telephoneNumber', []) %} {% set mailQuota = '%d' % (user_profile.get('mailQuota', [0])[0] |int /1024/1024) %} {% set stored_mailbox_size = accountUsedQuota.get(mail, {}).get('bytes', 0) %} {% set stored_mailbox_messages = accountUsedQuota.get(mail, {}).get('messages', 0) %} {% elif profile_type == 'password' %} {% set shadowLastChange = user_profile.get('shadowLastChange', [''])[0] |e %} {% if shadowLastChange %} {% set password_last_change_date = shadowLastChange | epoch_days_to_date | utc_to_timezone(timezone=session.get('timezone')) %} {% else %} {% set password_last_change_date = '' %} {% endif %} {% endif %} {% block breadcrumb %} {% set crumbs = [ (ctx.homepath + '/domains', _('All domains')), (ctx.homepath + '/profile/domain/general/' + cur_domain, cur_domain), (ctx.homepath + '/users/' + cur_domain, _('Users')), ('active', ctx.homepath + '/profile/user/general/' + mail, _('Profile of user:') + ' ' + mail), ] %} {{ display_subnav(crumbs) }} {% endblock %} {% block main %} {#-- Show system message --#} {% if msg %} {% if msg.startswith('PW_') %} {% set _pw_errors = msg.split(',') %} {% for _err in _pw_errors %} {{ user_msg_handler(_err) }} {% endfor %} {% else %} {{ user_msg_handler(msg) }} {% endif %} {% endif %} {% set navlinks = [ ('general', _('General'), [true]), ('password', _('Password'), [true]), ] %}
    {% for nav in navlinks %} {% if not false in nav[2] and not none in nav[2] %}
  • {{ nav[1] }}
  • {% endif %} {% endfor %}

{{ _('Profile of user:') }} {{ mail }}

{% if profile_type == 'spampolicy' %} {% set form_post_url = ctx.homepath + '/system/' + profile_type + '/' + mail %} {% else %} {% set form_post_url = ctx.homepath + '/profile/user/' + profile_type + '/' + mail %} {% endif %}
{{ input_csrf_token() }} {% if profile_type == 'general' %}
{{ display_account_status(accountStatus) }}
{{ display_quota(value=mailQuota, show_value_in_input=true, used_quota=stored_mailbox_size, stored_messages=stored_mailbox_messages, show_used_quota=true) }} {{ display_input_cn(value=cn, tooltip=_('Full name'), show_first_last_name=true, first_name=first_name, last_name=last_name, email=mail, empty_if_equal_to_username=true) }}
{{ display_preferred_language(value=user_profile.get('preferredLanguage', [''])[0], languagemaps=languagemaps) }} {{ display_timezones(value=user_account_setting.get('timezone'), timezones=timezones) }}
{% if _login_time or _lda %}
    {% if _imap %}
  • {{ _('IMAP Login:') }} {{ _imap | epoch_seconds_to_gmt | utc_to_timezone(timezone=session.get('timezone')) }}
  • {% endif %} {% if _pop3 %}
  • {{ _('POP3 Login:') }} {{ _pop3 | epoch_seconds_to_gmt | utc_to_timezone(timezone=session.get('timezone')) }}
  • {% endif %} {% if _lda %}
  • {{ _('New Mail Delivered:') }} {{ _lda | epoch_seconds_to_gmt | utc_to_timezone(timezone=session.get('timezone')) }}
  • {% endif %}
{% endif %}
{{ display_input_employeeid(employeeNumber) }} {{ display_job_titles(jobtitles) }}
{{ display_input_mobile(value=mobile) }} {{ display_phone_numbers(phone_numbers=telephoneNumber) }}
{#-- .col2-3 --#}
{#-- .columns --#}
{{ display_mark_user_as_admin(is_global_admin=user_profile.get('domainGlobalAdmin', ['no'])[0]) }}
{% if session.get('is_global_admin') %}

{{ _('All domains managed by this admin share the mailbox quota and limit of mail accounts.') }}

{# .col1-3 #} {% endif %}
{% elif profile_type == 'password' %}
{{ display_reset_password(min_passwd_length=min_passwd_length, max_passwd_length=max_passwd_length, show_confirmpw=true, store_password_in_plain_text=store_password_in_plain_text) }}
{{ display_random_password(password_length=min_passwd_length, password_policies=password_policies, password_last_change_date=password_last_change_date) }}
{% endif %} {{ input_submit() }}
{# box-wrap #}
{# box-body #}
{# content-box #} {% endblock main %} {% block extra_js %} {% endblock extra_js %}