diff --git a/core/admin/mailu/configuration.py b/core/admin/mailu/configuration.py
index 7cd3a56b..025a173c 100644
--- a/core/admin/mailu/configuration.py
+++ b/core/admin/mailu/configuration.py
@@ -51,6 +51,7 @@ DEFAULT_CONFIG = {
# Web settings
'SITENAME': 'Mailu',
'WEBSITE': 'https://mailu.io',
+ 'ADMIN' : 'none',
'WEB_ADMIN': '/admin',
'WEB_WEBMAIL': '/webmail',
'WEBMAIL': 'none',
diff --git a/core/admin/mailu/sso/forms.py b/core/admin/mailu/sso/forms.py
index a81667a2..bc2b5363 100644
--- a/core/admin/mailu/sso/forms.py
+++ b/core/admin/mailu/sso/forms.py
@@ -6,6 +6,8 @@ import flask_login
import flask_wtf
import re
+LOCALPART_REGEX = "^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*$"
+
class LoginForm(flask_wtf.FlaskForm):
class Meta:
csrf = False
diff --git a/core/admin/mailu/sso/templates/base_sso.html b/core/admin/mailu/sso/templates/base_sso.html
index a95cb23b..0edd692c 100644
--- a/core/admin/mailu/sso/templates/base_sso.html
+++ b/core/admin/mailu/sso/templates/base_sso.html
@@ -6,46 +6,53 @@
-
Mailu-login - {{ config["SITENAME"] }}
+ Mailu - {{ config["SITENAME"] }}
-
+
-
-
+
+
-
-
+
+
diff --git a/core/admin/mailu/sso/templates/form_sso.html b/core/admin/mailu/sso/templates/form_sso.html
index fcabad41..d28b82bf 100644
--- a/core/admin/mailu/sso/templates/form_sso.html
+++ b/core/admin/mailu/sso/templates/form_sso.html
@@ -1,7 +1,7 @@
{% extends "base_sso.html" %}
{% block content %}
-{% call macros.box() %}
+{% call macros.card() %}
{{ macros.form(form) }}
{% endcall %}
{% endblock %}
diff --git a/core/admin/mailu/sso/templates/login.html b/core/admin/mailu/sso/templates/login.html
index 851e6643..81d83a46 100644
--- a/core/admin/mailu/sso/templates/login.html
+++ b/core/admin/mailu/sso/templates/login.html
@@ -5,5 +5,9 @@
{% endblock %}
{% block subtitle %}
-{% trans %}to access IF statement for switch text for loggin in what the administration tools{% endtrans %}
+{% if endpoint == 'ui.index' %}
+{% trans %}to access the configuration page{% endtrans %}
+{% elif endpoint == 'ui.webmail' %}
+{% trans %}to access the webmail page{% endtrans %}
+{% endif %}
{% endblock %}
diff --git a/core/admin/mailu/sso/templates/sidebar_sso.html b/core/admin/mailu/sso/templates/sidebar_sso.html
new file mode 100644
index 00000000..6e919731
--- /dev/null
+++ b/core/admin/mailu/sso/templates/sidebar_sso.html
@@ -0,0 +1,60 @@
+
diff --git a/core/admin/mailu/sso/views/base.py b/core/admin/mailu/sso/views/base.py
index dd6f60c9..702b1582 100644
--- a/core/admin/mailu/sso/views/base.py
+++ b/core/admin/mailu/sso/views/base.py
@@ -1,5 +1,6 @@
from mailu import models
from mailu.sso import sso, forms
+from mailu.ui import access
from flask import current_app as app
import flask
@@ -8,23 +9,15 @@ import flask_login
@sso.route('/login', methods=['GET', 'POST'])
def login():
form = forms.LoginForm()
+ endpoint = flask.request.args.get('next', 'ui.index')
if form.validate_on_submit():
user = models.User.login(form.email.data, form.pw.data)
if user:
flask.session.regenerate()
flask_login.login_user(user)
- endpoint = flask.request.args.get('next', 'ui.index')
return flask.redirect(flask.url_for(endpoint)
or flask.url_for('ui.index'))
else:
flask.flash('Wrong e-mail or password', 'error')
- return flask.render_template('login.html', form=form)
-
-"""
-@ui.route('/logout', methods=['GET'])
-@access.authenticated
-def logout():
- flask_login.logout_user()
- flask.session.destroy()
- return flask.redirect(flask.url_for('.index'))
-"""
\ No newline at end of file
+ return flask.render_template('login.html', form=form, endpoint=endpoint)
+
\ No newline at end of file
diff --git a/core/admin/mailu/ui/templates/sidebar.html b/core/admin/mailu/ui/templates/sidebar.html
index 0fdae9db..0938f8ac 100644
--- a/core/admin/mailu/ui/templates/sidebar.html
+++ b/core/admin/mailu/ui/templates/sidebar.html
@@ -125,7 +125,7 @@
{% else %}
-
+
{% trans %}Sign in{% endtrans %}
diff --git a/core/nginx/conf/nginx.conf b/core/nginx/conf/nginx.conf
index 9ce12980..ac5aabe2 100644
--- a/core/nginx/conf/nginx.conf
+++ b/core/nginx/conf/nginx.conf
@@ -117,6 +117,12 @@ http {
include /overrides/*.conf;
# Actual logic
+ location /sso {
+ include /etc/nginx/proxy.conf;
+ proxy_set_header Host $host;
+ proxy_pass http://$admin/sso;
+ }
+
{% if WEB_WEBMAIL != '/' and WEBROOT_REDIRECT != 'none' %}
location / {
{% if WEBROOT_REDIRECT %}
@@ -158,7 +164,7 @@ http {
}
location @webmail_login {
- return 302 {{ WEB_ADMIN }}/ui/login?next=ui.webmail;
+ return 302 {{ WEB_ADMIN }}/sso/login?next=ui.webmail;
}
{% else %}
}