2015-08-02 19:23:24 +00:00
|
|
|
{% extends "layout.html" %}
|
2018-08-24 13:48:09 +00:00
|
|
|
{% block header %}
|
|
|
|
<link href="{{ url_for('static', filename='css/libs/bootstrap-table.min.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/libs/bootstrap-editable.css') }}" rel="stylesheet">
|
|
|
|
{% endblock %}
|
2015-08-02 19:23:24 +00:00
|
|
|
{% block body %}
|
|
|
|
<div class="discover">
|
|
|
|
<h1>{{title}}</h1>
|
2020-05-03 08:55:33 +00:00
|
|
|
<form role="form" class="col-md-10 col-lg-6" method="POST">
|
2021-10-04 15:50:32 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
2021-03-28 12:50:55 +00:00
|
|
|
{% if feature_support['gmail'] %}
|
2015-08-02 19:23:24 +00:00
|
|
|
<div class="form-group">
|
2021-06-19 12:44:57 +00:00
|
|
|
<label for="config_email_type">{{_('Choose Server Type')}}</label>
|
2021-03-27 15:36:24 +00:00
|
|
|
<select name="mail_server_type" id="config_email_type" class="form-control" data-control="email-settings">
|
|
|
|
<option value="0" {% if content.mail_server_type == 0 %}selected{% endif %}>{{_('Use Standard E-Mail Account')}}</option>
|
2021-05-16 07:37:45 +00:00
|
|
|
<option value="1" {% if content.mail_server_type == 1 %}selected{% endif %}>{{_('Gmail Account with OAuth2 Verification')}}</option>
|
2021-03-27 15:36:24 +00:00
|
|
|
</select>
|
2015-08-02 19:23:24 +00:00
|
|
|
</div>
|
2021-03-27 15:36:24 +00:00
|
|
|
<div data-related="email-settings-1">
|
|
|
|
<div class="form-group">
|
|
|
|
{% if content.mail_gmail_token == {} %}
|
|
|
|
<button type="submit" id="gmail_server" name="gmail" value="submit" class="btn btn-default">{{_('Setup Gmail Account as E-Mail Server')}}</button>
|
|
|
|
{% else %}
|
2021-04-17 08:27:30 +00:00
|
|
|
<button type="submit" id="invalidate_server" name="invalidate" value="submit" class="btn btn-danger">{{_('Revoke Gmail Access')}}</button>
|
2021-03-27 15:36:24 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2020-05-03 08:55:33 +00:00
|
|
|
</div>
|
2021-03-27 15:36:24 +00:00
|
|
|
<div data-related="email-settings-0">
|
2021-03-28 12:50:55 +00:00
|
|
|
{% endif %}
|
2021-03-27 15:36:24 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="mail_server">{{_('SMTP Hostname')}}</label>
|
2021-03-27 17:36:11 +00:00
|
|
|
<input type="text" class="form-control" name="mail_server" id="mail_server" value="{{content.mail_server}}" required>
|
2021-03-27 15:36:24 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="mail_port">{{_('SMTP Port')}}</label>
|
2021-03-27 17:36:11 +00:00
|
|
|
<input type="number" min="1" max="65535" step="1" class="form-control" name="mail_port" id="mail_port" value="{% if content.mail_port != None %}{{ content.mail_port }}{% endif %}" autocomplete="off" required>
|
2021-03-27 15:36:24 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="mail_use_ssl">{{_('Encryption')}}</label>
|
|
|
|
<select name="mail_use_ssl" id="mail_use_ssl" class="form-control">
|
|
|
|
<option value="0" {% if content.mail_use_ssl == 0 %}selected{% endif %}>{{ _('None') }}</option>
|
|
|
|
<option value="1" {% if content.mail_use_ssl == 1 %}selected{% endif %}>{{ _('STARTTLS') }}</option>
|
|
|
|
<option value="2" {% if content.mail_use_ssl == 2 %}selected{% endif %}>{{ _('SSL/TLS') }}</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="mail_login">{{_('SMTP Login')}}</label>
|
|
|
|
<input type="text" class="form-control" name="mail_login" id="mail_login" value="{{content.mail_login}}">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2022-07-02 15:45:24 +00:00
|
|
|
<label for="mail_password_e">{{_('SMTP Password')}}</label>
|
|
|
|
<input type="password" class="form-control" name="mail_password_e" id="mail_password_e" value="{{content.mail_password_e}}">
|
2021-03-27 15:36:24 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="mail_from">{{_('From E-mail')}}</label>
|
2021-03-27 17:36:11 +00:00
|
|
|
<input type="text" class="form-control" name="mail_from" id="mail_from" value="{{content.mail_from}}" required>
|
2021-03-27 15:36:24 +00:00
|
|
|
</div>
|
|
|
|
<label for="mail_size">{{_('Attachment Size Limit')}}</label>
|
|
|
|
<div class="form-group input-group">
|
|
|
|
<input type="number" min="1" max="600" step="1" class="form-control" name="mail_size" id="mail_size" value="{% if content.mail_size != None %}{{ (content.mail_size / 1024 / 1024)|int }}{% endif %}" required>
|
|
|
|
<span class="input-group-btn">
|
|
|
|
<button type="button" id="attachement_size" class="btn btn-default" disabled>MB</button>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<button type="submit" name="submit" value="submit" class="btn btn-default">{{_('Save')}}</button>
|
|
|
|
<button type="submit" name="test" value="test" class="btn btn-default">{{_('Save and Send Test E-mail')}}</button>
|
2021-03-28 12:50:55 +00:00
|
|
|
{% if feature_support['gmail'] %}
|
2015-08-02 19:23:24 +00:00
|
|
|
</div>
|
2021-03-28 12:50:55 +00:00
|
|
|
{% endif %}
|
2021-04-17 16:30:55 +00:00
|
|
|
<a href="{{ url_for('admin.admin') }}" id="email_back" class="btn btn-default">{{_('Back')}}</a>
|
2015-08-02 19:23:24 +00:00
|
|
|
</form>
|
2022-03-25 17:30:12 +00:00
|
|
|
{% if g.allow_registration and not simple%}
|
2020-05-13 18:03:54 +00:00
|
|
|
<div class="col-md-10 col-lg-6">
|
2020-02-03 03:22:00 +00:00
|
|
|
<h2>{{_('Allowed Domains (Whitelist)')}}</h2>
|
2019-12-29 12:54:52 +00:00
|
|
|
<form id="domain_add_allow" action="{{ url_for('admin.add_domain',allow=1)}}" method="POST">
|
2021-10-04 15:50:32 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
2019-12-29 12:54:52 +00:00
|
|
|
<div class="form-group required">
|
|
|
|
<label for="domainname_allow">{{_('Add Domain')}}</label>
|
|
|
|
<input type="text" class="form-control" name="domainname" id="domainname_allow" >
|
|
|
|
</div>
|
|
|
|
<button id="domain_allow_submit" class="btn btn-default">{{_('Add')}}</button>
|
|
|
|
</form>
|
2021-09-30 12:09:02 +00:00
|
|
|
<table class="table table-no-bordered" id="domain-allow-table" data-url="{{url_for('admin.list_domain', allow=1)}}" data-id-field="id" data-show-header="false" data-editable-mode="inline" data-locale="{{ g.user.locale }}">
|
2019-12-29 12:54:52 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2021-08-28 13:47:57 +00:00
|
|
|
<th data-field="domain" id="domain-allow" data-escape="true" data-editable-type="text" data-editable-url="{{ url_for('admin.edit_domain', allow = 1)}}" data-editable="true" data-editable-title="{{_('Enter domainname')}}"></th>
|
2019-12-29 12:54:52 +00:00
|
|
|
<th data-field="id" id="id-allow" data-visible="false"></th>
|
|
|
|
<th data-align="right" data-formatter="TableActions"></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</table>
|
2020-02-23 19:07:21 +00:00
|
|
|
<h2>{{_('Denied Domains (Blacklist)')}}</h2>
|
2021-09-30 12:09:02 +00:00
|
|
|
<table class="table table-no-bordered" id="domain-deny-table" data-url="{{url_for('admin.list_domain', allow=0)}}" data-id-field="id" data-show-header="false" data-editable-mode="inline" data-locale="{{ g.user.locale }}">
|
2018-08-24 13:48:09 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2021-08-28 13:47:57 +00:00
|
|
|
<th data-field="domain" id="domain-deny" data-escape="true" data-editable-type="text" data-editable-url="{{ url_for('admin.edit_domain', allow = 0)}}" data-editable="true" data-editable-title="{{_('Enter domainname')}}"></th>
|
2019-12-29 12:54:52 +00:00
|
|
|
<th data-field="id" id="id-deny" data-visible="false"></th>
|
2018-08-24 13:48:09 +00:00
|
|
|
<th data-align="right" data-formatter="TableActions"></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</table>
|
2019-12-29 12:54:52 +00:00
|
|
|
<form id="domain_add_deny" action="{{ url_for('admin.add_domain',allow=0)}}" method="POST">
|
2021-10-04 15:50:32 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
|
|
<div class="form-group required">
|
|
|
|
<label for="domainname_deny">{{_('Add Domain')}}</label>
|
|
|
|
<input type="text" class="form-control" name="domainname" id="domainname_deny" >
|
|
|
|
</div>
|
|
|
|
<button id="domain_deny_submit" class="btn btn-default">{{_('Add')}}</button>
|
2018-08-24 13:48:09 +00:00
|
|
|
</form>
|
2020-05-13 18:03:54 +00:00
|
|
|
</div>
|
2019-12-29 12:54:52 +00:00
|
|
|
|
2018-08-24 13:48:09 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block modal %}
|
|
|
|
{% if g.allow_registration %}
|
2020-12-20 18:17:29 +00:00
|
|
|
{{ delete_confirm_modal() }}
|
2018-08-24 13:48:09 +00:00
|
|
|
{% endif %}
|
2015-08-02 19:23:24 +00:00
|
|
|
{% endblock %}
|
2018-08-24 13:48:09 +00:00
|
|
|
{% block js %}
|
|
|
|
{% if g.allow_registration %}
|
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table.min.js') }}"></script>
|
2021-09-30 12:09:02 +00:00
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table-locale-all.min.js') }}"></script>
|
2018-08-24 13:48:09 +00:00
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table-editable.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-editable.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/table.js') }}"></script>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|