From d97f04a8ad157c6d441671fa59a3a1f87c2d0f16 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 9 Mar 2023 11:59:58 +0100 Subject: [PATCH] =?UTF-8?q?CAS:=20am=C3=A9liore=20formulaire=20config.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/main/config_cas.py | 2 +- app/models/config.py | 2 +- app/static/css/scodoc.css | 17 +++++++++++++++-- app/templates/config_cas.j2 | 36 ++++++++++++++++++++++++++++-------- app/views/scodoc.py | 13 ++++++++----- sco_version.py | 2 +- 6 files changed, 54 insertions(+), 18 deletions(-) diff --git a/app/forms/main/config_cas.py b/app/forms/main/config_cas.py index 0c6baac4a..9ebf2d871 100644 --- a/app/forms/main/config_cas.py +++ b/app/forms/main/config_cas.py @@ -63,7 +63,7 @@ class ConfigCASForm(FlaskForm): cas_attribute_id = StringField( label="Attribut CAS utilisé comme id (laissez vide pour prendre l'id par défaut)", - description="""Le champs CAS qui sera considéré comme l'id unique des + description="""Le champs CAS qui sera considéré comme l'id unique des comptes utilisateurs.""", ) diff --git a/app/models/config.py b/app/models/config.py index 09699cf74..71b462bcf 100644 --- a/app/models/config.py +++ b/app/models/config.py @@ -92,7 +92,7 @@ class ScoDocSiteConfig(db.Model): "cas_server": str, "cas_login_route": str, "cas_logout_route": str, - "cas_valmidate_route": str, + "cas_validate_route": str, "cas_attribute_id": str, } diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index f5c6c2fbf..cc1983921 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -4575,8 +4575,21 @@ div.cas_link { margin-top: 16px; } +div.cas_settings { + margin-left: -15px; + margin-bottom: 8px; + border: 1px dashed rgb(191, 34, 191); + background-color: #feb4e54f; +} + +div.cas_settings>div, +div.cas_settings div.form-group { + margin-left: 8px; +} + div.cas_etat_certif_ssl { - margin-top: 12px; + margin-top: -15px; + margin-bottom: 8px; font-style: italic; - border: 1px dashed black; + color: rgb(231, 0, 0); } \ No newline at end of file diff --git a/app/templates/config_cas.j2 b/app/templates/config_cas.j2 index 5c0cebd15..14b456955 100644 --- a/app/templates/config_cas.j2 +++ b/app/templates/config_cas.j2 @@ -10,20 +10,40 @@
- {{ wtf.quick_form(form) }} -
Certificat SSL - {% if cas_ssl_certificate_loaded %} - chargé. - {% else %} - non chargé. - {% endif %} + +
+ {{ form.hidden_tag() }} + {{ wtf.form_errors(form, hiddens="only") }} + + {{ wtf.form_field(form.cas_enable) }} + {{ wtf.form_field(form.cas_force) }} + {{ wtf.form_field(form.cas_server) }} + {{ wtf.form_field(form.cas_login_route) }} + {{ wtf.form_field(form.cas_logout_route) }} + {{ wtf.form_field(form.cas_validate_route) }} + {{ wtf.form_field(form.cas_attribute_id) }} +
+ {{ wtf.form_field(form.cas_ssl_verify) }} + {{ wtf.form_field(form.cas_ssl_certificate_file) }} +
Certificat SSL + {% if cas_ssl_certificate_loaded %} + chargé. + {% else %} + non chargé. + {% endif %} +
-
+
+ {{ wtf.form_field(form.submit) }} + {{ wtf.form_field(form.cancel) }} +
+
ℹ️ Note: si le CAS est forcé, le super-admin et les utilisateurs autorisés à "se connecter via ScoDoc" pourront toujours se connecter via l'adresse spéciale {{url_for("auth.login_scodoc", _external=True)}}
+
diff --git a/app/views/scodoc.py b/app/views/scodoc.py index 915287f0e..ec6167686 100644 --- a/app/views/scodoc.py +++ b/app/views/scodoc.py @@ -149,15 +149,15 @@ def config_cas(): if ScoDocSiteConfig.set("cas_force", form.data["cas_force"]): flash("CAS " + ("forcé" if form.data["cas_force"] else "non forcé")) if ScoDocSiteConfig.set("cas_server", form.data["cas_server"]): - flash("Serveur CAS enregistré") + flash("URL du serveur CAS enregistrée") if ScoDocSiteConfig.set("cas_login_route", form.data["cas_login_route"]): - flash("Serveur CAS enregistré") + flash("Route du login CAS enregistrée") if ScoDocSiteConfig.set("cas_logout_route", form.data["cas_logout_route"]): - flash("Serveur CAS enregistré") + flash("Route du logout CAS enregistrée") if ScoDocSiteConfig.set("cas_validate_route", form.data["cas_validate_route"]): - flash("Serveur CAS enregistré") + flash("Route de validation CAS enregistrée") if ScoDocSiteConfig.set("cas_attribute_id", form.data["cas_attribute_id"]): - flash("Serveur CAS enregistré") + flash("Attribut CAS ID enregistré") if ScoDocSiteConfig.set("cas_ssl_verify", form.data["cas_ssl_verify"]): flash("Vérification SSL modifiée") if form.cas_ssl_certificate_file.data: @@ -175,6 +175,9 @@ def config_cas(): form.cas_enable.data = ScoDocSiteConfig.get("cas_enable") form.cas_force.data = ScoDocSiteConfig.get("cas_force") form.cas_server.data = ScoDocSiteConfig.get("cas_server") + form.cas_login_route.data = ScoDocSiteConfig.get("cas_login_route") + form.cas_logout_route.data = ScoDocSiteConfig.get("cas_logout_route") + form.cas_validate_route.data = ScoDocSiteConfig.get("cas_validate_route") form.cas_attribute_id.data = ScoDocSiteConfig.get("cas_attribute_id") form.cas_ssl_verify.data = ScoDocSiteConfig.get("cas_ssl_verify") return render_template( diff --git a/sco_version.py b/sco_version.py index c34d6085f..c65998d13 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.4.61" +SCOVERSION = "9.4.62" SCONAME = "ScoDoc"