{% 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]), ] %}