Skip to content

Commit

Permalink
Merge pull request #155 from fsinfuhh/admin_login_oidc
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid authored Feb 27, 2024
2 parents deb3fde + 6b7f654 commit 694ca90
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 126 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ verify_ssl = true
name = "pypi"

[packages]
Django = "~=4.1.12" # can be upgraded once we have postgres >11 deployed
Django = "~=5.0"
Pillow = "~=10.0"
PyPDF2 = "~=1.27"
bleach = {extras = ["css"], version = "~=6.1"}
Expand Down
244 changes: 122 additions & 122 deletions Pipfile.lock

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion locale/de_DE/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-12 16:48+0100\n"
"POT-Creation-Date: 2024-02-26 19:24+0100\n"
"PO-Revision-Date: 2024-01-12 16:56+0100\n"
"Last-Translator: Timon Engelke <timon.engelke@uni-hamburg.de>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -88,6 +88,15 @@ msgstr "Probleme?"
msgid "License information"
msgstr "Lizenzinformationen"

#: mafiasi/base/templates/base/login.html:8
#, python-format
msgid ""
"You are authenticated as %(username)s, but are not authorized to access this "
"page. Would you like to login to a different account?"
msgstr ""
"Sie sind als %(username)s angemeldet, aber nicht autorisiert, auf diese "
"Seite zuzugreifen. Wollen Sie sich mit einem anderen Account anmelden?"

#: mafiasi/base/templates/base/problems.html:7
#, python-format
msgid ""
Expand Down
9 changes: 8 additions & 1 deletion locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-12 17:28+0100\n"
"POT-Creation-Date: 2024-02-26 19:24+0100\n"
"PO-Revision-Date: 2024-01-12 17:06+0100\n"
"Last-Translator: Timon Engelke <timon.engelke@uni-hamburg.de>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -80,6 +80,13 @@ msgstr ""
msgid "License information"
msgstr ""

#: mafiasi/base/templates/base/login.html:8
#, python-format
msgid ""
"You are authenticated as %(username)s, but are not authorized to access this "
"page. Would you like to login to a different account?"
msgstr ""

#: mafiasi/base/templates/base/problems.html:7
#, python-format
msgid ""
Expand Down
12 changes: 11 additions & 1 deletion locale/fr_FR/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-12 16:48+0100\n"
"POT-Creation-Date: 2024-02-26 19:24+0100\n"
"PO-Revision-Date: 2024-01-15 16:39+0100\n"
"Last-Translator: Timon Engelke <timon.engelke@uni-hamburg.de>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -88,6 +88,16 @@ msgstr "Problèmes?"
msgid "License information"
msgstr "Informations sur la licence"

#: mafiasi/base/templates/base/login.html:8
#, python-format
msgid ""
"You are authenticated as %(username)s, but are not authorized to access this "
"page. Would you like to login to a different account?"
msgstr ""
"Vous êtes authentifié sous le nom %(username)s, mais vous n’êtes pas "
"autorisé à accéder à cette page. Souhaitez-vous vous connecter avec un autre "
"compte utilisateur ?"

#: mafiasi/base/templates/base/problems.html:7
#, python-format
msgid ""
Expand Down
1 change: 1 addition & 0 deletions mafiasi/base/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ class MafiasiAdmin(UserAdmin):

admin.site.register(Yeargroup)
admin.site.register(Mafiasi, MafiasiAdmin)
admin.site.login_template = "base/login.html"
22 changes: 22 additions & 0 deletions mafiasi/base/templates/base/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% extends "admin/login.html" %}
{% load i18n %}
{% block content %}
<div id="content-main">

{% if user.is_authenticated %}
<p class="errornote">
{% blocktranslate trimmed %}
You are authenticated as {{ username }}, but are not authorized to
access this page. Would you like to login to a different account?
{% endblocktranslate %}
</p>
{% endif %}

<form id="login-form" method="get" action="{% url 'simple_openid_connect:login' %}">
<div class="submit-row">
<input type="submit" value="Log in with Mafiasi">
</div>
</form>

</div>
{% endblock %}

0 comments on commit 694ca90

Please sign in to comment.