Add files via upload

This commit is contained in:
Harold Finch
2023-04-10 07:23:44 +02:00
committed by GitHub
parent 047f85e92d
commit ae35dc5986
56 changed files with 11982 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
{% extends "layout.html" %}
{% from "macros/form_inputs.html" import
input_submit,
input_csrf_token
with context
%}
{% from "macros/general.html" import
display_random_password,
display_preferred_language,
display_add_admin,
display_domain_creation_options_of_normal_admin
with context %}
{% from "macros/msg_handlers.html" import admin_msg_handler with context %}
{% block navlinks_create %}class="active"{% endblock %}
{% block title %}{{ _('Add admin') }}{% endblock title %}
{% block main %}
{# Show system message #}
{% if msg %}
{% if msg.startswith('PW_') %}
{% set _pw_errors = msg.split(',') %}
{% for _err in _pw_errors %}
{{ admin_msg_handler(_err) }}
{% endfor %}
{% else %}
{{ admin_msg_handler(msg) }}
{% endif %}
{% endif %}
<div class="content-box">
<div class="box-body">
<div class="box-header clear">
{# -- Tabs -- #}
<ul class="tabs clear">
<li><a href="{{ctx.homepath}}/admins">{{ _('All admins') }}</a></li>
<li class="active"><a href="{{ctx.homepath}}/create/admin"><i class="fa fa-plus"></i>&nbsp;{{ _('Add admin') }}</a></li>
</ul>
<h2>{{ _('Add admin') }}</h2>
</div>
<div class="columns clear">
<div class="col2-3">
<div id="admin_add" class="box-wrap clear">
<form name="create" method="post" action="{{ctx.homepath}}/create/admin">
{{ input_csrf_token() }}
{{ display_add_admin(min_passwd_length=min_passwd_length,
max_passwd_length=max_passwd_length,
lang=default_language,
languagemaps=languagemaps) }}
{{ display_domain_creation_options_of_normal_admin(admin_settings={}) }}
{{ input_submit(label=_('Add')) }}
</form>
</div>
</div>
<div class="box-wrap clear">
<div class="col1-3 lastcol">
{{ display_random_password(password_length=min_passwd_length,
password_policies=password_policies) }}
</div>
</div>
</div>
</div>
</div>
{% endblock main %}

View File

@@ -0,0 +1,118 @@
{% extends "layout.html" %}
{% from "macros/form_inputs.html" import
input_csrf_token
with context
%}
{% from "macros/general.html" import
set_account_status_img,
highlight_username_in_mail,
set_admin_type_img,
show_pages
with context
%}
{% from "macros/msg_handlers.html" import admin_msg_handler with context %}
{% block title %}{{ _('Domain Admins') }}{% endblock %}
{% block navlinks_admins %}class="active"{% endblock %}
{% block main %}
{# Show system message #}
{{ admin_msg_handler(msg) }}
{# List admins #}
{#{% if admins|length > 0 %}#}
{% if admins is not string %}
<div class="content-box">
<div class="box-body">
<div class="box-header clear">
{% if session.get('is_global_admin') %}
<ul class="tabs clear">
<li><a href="{{ctx.homepath}}/create/admin"><i class="fa fa-plus"></i>&nbsp;{{ _('Add admin') }}</a></li>
</ul>
{% endif %}
<h2>{{ _('All admins') }}
{% if total is defined and admins|length > 0 %}
({{ (cur_page-1) * page_size_limit + 1 }}-{{ (cur_page-1) * page_size_limit + admins|length}}/{{ total }})
{% endif %}
</h2>
</div>
<form name="admins" id="list_table" method="post" action="{{ctx.homepath}}/admins">
{{ input_csrf_token() }}
<table class="style1">
<thead>
<tr>
<th class="checkbox"><input type="checkbox" class="checkbox select-all" /></th>
<th data-sort="string-ins">{{ _('Display Name') }}</th>
<th data-sort="string-ins">{{ _('Mail Address') }}</th>
<th data-sort="string-ins">{{ _('Global Admin') }}</th>
</tr>
</thead>
<tbody>
{% for r in admins %}
{% set mail = r.username |e %}
{% set name = r.name |e %}
<tr>
<td class="checkbox">
<input type="checkbox"
name="mail"
class="checkbox"
value="{{ mail }}"
{% if mail == session.get('username') %}disabled="disabled"{% endif %}
/>
</td>
<td>
<a href="{{ctx.homepath}}/profile/{% if r.get('isadmin') is not sameas none %}user{% else %}admin{% endif %}/general/{{ mail }}"><i class="fa fa-cog fa-lg fr-space" title="{{ _('Edit account profile') }}"></i></a>
{{ set_account_status_img(r.active) }}
{# -- Show name -- #}
<a href="{{ctx.homepath}}/profile/{% if r.get('isadmin') is not sameas none %}user{% else %}admin{% endif %}/general/{{ mail }}" title="{{ _('Edit account profile') }}">{% if name == '' %}{{ mail.split('@', 1)[0] }}{% else %}{{ name |cut_string }}{% endif %}</a>
</td>
<td>{{ mail }}</td>
{% if r.get('isglobaladmin') is not sameas none %}
{# users marked as admin #}
{% if r.get('isglobaladmin') == 1 %}
<td>{{ set_admin_type_img('yes') }}</td>
{% else %}
<td>{{ set_admin_type_img('no') }}</td>
{% endif %}
{% else %}
{# Separate admin accounts #}
{% if mail in allGlobalAdmins %}
<td>{{ set_admin_type_img('yes') }}</td>
{% else %}
<td>{{ set_admin_type_img('no') }}</td>
{% endif %}
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
<div class="tab-footer clear f1">
<div class="fl">
<select name="action" class="fl-space">
<option>{{ _('Choose Action') }}</option>
<option value="enable">{{ _('Enable') }}</option>
<option value="disable">{{ _('Disable') }}</option>
<option value="delete">{{ _('Delete') }}</option>
</select>
<input type="submit" value="{{ _('Apply') }}" class="button fl-space" />
</div>
{{ show_pages(baseurl=ctx.homepath + '/admins', total=total, cur_page=cur_page) }}
</div>
</form>
</div>{# -- box body -- #}
</div>{# -- content box -- #}
{% endif %}
{% endblock main %}

View File

@@ -0,0 +1,165 @@
{% extends "layout.html" %}
{% from "macros/form_inputs.html" import
input_submit,
input_csrf_token
with context
%}
{% from "macros/general.html" import
display_subnav,
set_account_status_img,
display_account_status,
display_input_cn,
display_preferred_language,
display_timezones,
display_reset_password,
display_random_password,
display_input_global_admin,
display_domain_creation_options_of_normal_admin
with context
%}
{% from "macros/sql.html" import
display_all_domains
with context
%}
{% from "macros/msg_handlers.html" import admin_msg_handler with context %}
{% block title %}{{ _('Edit account profile') }}{% endblock %}
{% block navlinks_admins %}class="active"{% endblock %}
{% block breadcrumb %}
{% if session.get('is_global_admin') %}
{% set crumbs = [(ctx.homepath + '/admins', _('All admins')),
('active', ctx.homepath + '/profile/admin/general/' + mail, _('Profile of admin:') + '&nbsp;' + mail)] %}
{% else %}
{% set crumbs = [('active', ctx.homepath + '/profile/admin/general/' + mail, _('Profile of admin:') + '&nbsp;' + mail)] %}
{% endif %}
{{ 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 %}
{{ admin_msg_handler(_err) }}
{% endfor %}
{% else %}
{{ admin_msg_handler(msg) }}
{% endif %}
{% endif %}
{% set navlinks = [
('general', _('General'), []),
('password', _('Password'), []),
]
%}
<div class="content-box">
<div class="box-body">
<div class="box-header clear">
<ul class="tabs clear">
{% for nav in navlinks %}
{% if not false in nav[2] and not none in nav[2] %}
<li><a href="#profile_{{ nav[0] }}">{{ nav[1] }}</a></li>
{% endif %}
{% endfor %}
</ul>
<h2>{{ _('Profile of admin:') }} {{ mail }}</h2>
</div>
<div class="box-wrap clear">
<div id="profile_general">
<form name="general" method="post" action="{{ctx.homepath}}/profile/admin/general/{{mail}}">
{{ input_csrf_token() }}
<div class="columns clear">
<div class="col2-3">
{% if session.get('is_global_admin') %}
{{ display_account_status(profile.active) }}
{% endif %}
{{ display_input_cn(value=profile.name, account_type='admin') }}
{{ display_preferred_language(value=profile.get('language', 'en_US') |e,
languagemaps=languagemaps) }}
{{ display_timezones(value=admin_settings.get('timezone'), timezones=timezones) }}
{% if session.get('is_global_admin') %}
<div class="rule"></div>
{{ display_input_global_admin(value=is_global_admin) }}
{% endif %}
</div>
{% if session.get('is_global_admin') %}
<div class="col2-3">
{{ display_domain_creation_options_of_normal_admin(admin_settings=admin_settings) }}
</div>
<div class="col1-3 lastcol normal_admin_create_domain_options">
<div class="mark_blue bt-space10">
<p>{{ _('All domains managed by this admin share the mailbox quota and limit of mail accounts.') }}</p>
</div>
</div>{# .col1-3 #}
{% endif %}
{% if session.get('is_global_admin') %}
{{ display_all_domains(managedDomains=managedDomains, allDomains=allDomains) }}
{% endif %}
</div>{# .columns #}
{{ input_submit() }}
</form>
</div>
<div id="profile_password">
<form name="password" method="post" action="{{ctx.homepath}}/profile/admin/password/{{mail}}">
{{ input_csrf_token() }}
<div class="columns clear">
<div class="col3-4">
{% if session.get('is_global_admin') %}
{{ 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) }}
{% else %}
{{ display_reset_password(
min_passwd_length=min_passwd_length,
max_passwd_length=max_passwd_length,
show_oldpw=true,
show_confirmpw=true,
store_password_in_plain_text=store_password_in_plain_text) }}
{% endif %}
</div>
<div class="col1-4 lastcol">
{{ display_random_password(password_length=min_passwd_length,
password_policies=password_policies) }}
</div>
</div>
{{ input_submit() }}
</form>
</div>
</div>{# .box-wrap #}
</div>{# .box-body #}
</div>{#-- .content-box --#}
{% endblock main %}
{% block extra_js %}
<script type="text/javascript">
$(document).ready(function() {
$(".tabs li").idTabs("profile_{{ profile_type }}");
$('#domain_search').quickfilter('#all_domains tr');
});
</script>
{% endblock extra_js %}