diff --git a/note_kfet/settings/base.py b/note_kfet/settings/base.py index 779ee23d..8a0fc738 100644 --- a/note_kfet/settings/base.py +++ b/note_kfet/settings/base.py @@ -308,6 +308,10 @@ PHONENUMBER_DEFAULT_REGION = 'FR' # We add custom information to CAS, in order to give a normalized name to other services CAS_AUTH_CLASS = 'member.auth.CustomAuthUser' +CAS_LOGIN_TEMPLATE = 'cas/login.html' +CAS_LOGOUT_TEMPLATE = 'cas/logout.html' +CAS_WARN_TEMPLATE = 'cas/warn.html' +CAS_LOGGED_TEMPLATE = 'cas/logged.html' # Default field for primary key DEFAULT_AUTO_FIELD = "django.db.models.AutoField" diff --git a/note_kfet/templates/base.html b/note_kfet/templates/base.html index 70e55f90..45dcdfe7 100644 --- a/note_kfet/templates/base.html +++ b/note_kfet/templates/base.html @@ -216,7 +216,7 @@ SPDX-License-Identifier: GPL-3.0-or-later {% trans "Managed by BDE" %}{% trans "Hosted by Cr@ns" %} &mdahs; + class="text-muted">{% trans "Hosted by Cr@ns" %} — {% csrf_token %} {% trans "Log me out from all my sessions" %} + + + {% if settings.CAS_FEDERATE and request.COOKIES.remember_provider %} +
+ +
+ {% endif %} + + + + +{% endblock %} diff --git a/note_kfet/templates/cas/login.html b/note_kfet/templates/cas/login.html new file mode 100644 index 00000000..84fd0cf8 --- /dev/null +++ b/note_kfet/templates/cas/login.html @@ -0,0 +1,42 @@ +{% extends "base.html" %} +{% comment %} +Copyright (C) by BDE ENS-Paris-Saclay +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block ante_messages %} + {% if auto_submit %}{% endif %} +{% endblock %} + +{% block content %} +
+
+
+ +
+ +{% endblock %} + +{% block javascript_inline %} +jQuery(function( $ ){ + $("#id_warn").click(function(e){ + if($("#id_warn").is(':checked')){ + createCookie("warn", "on", 10 * 365); + } else { + eraseCookie("warn"); + } + }); +}); +{% if auto_submit %}document.getElementById('login_form').submit(); // SUBMIT FORM{% endif %} +{% endblock %} diff --git a/note_kfet/templates/cas/logout.html b/note_kfet/templates/cas/logout.html new file mode 100644 index 00000000..814f7d33 --- /dev/null +++ b/note_kfet/templates/cas/logout.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% comment %} +Copyright (C) by BDE ENS-Paris-Saclay +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n static %} +{% block content %} + +{% endblock %} + diff --git a/note_kfet/templates/cas/warn.html b/note_kfet/templates/cas/warn.html new file mode 100644 index 00000000..89ee1815 --- /dev/null +++ b/note_kfet/templates/cas/warn.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +{% comment %} +Copyright (C) by BDE ENS-Paris-Saclay +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n static %} + +{% block content %} +
+
+ +
+
+{% endblock %} +