Implement custom password reset pages
This commit is contained in:
parent
68eae42444
commit
d111d37736
@ -176,14 +176,15 @@ AUTH_PROFILE_MODULE = 'account_manager.UserProfile'
|
||||
########################################################################################################################
|
||||
# EMAIL Config #
|
||||
########################################################################################################################
|
||||
# EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
|
||||
# EMAIL_FILE_PATH = os.path.join(BASE_DIR, "sent_emails")
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
|
||||
EMAIL_FILE_PATH = os.path.join(BASE_DIR, "sent_emails")
|
||||
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
EMAIL_TIMEOUT = 15
|
||||
EMAIL_HOST = 'smtp.uni-bamberg.de'
|
||||
EMAIL_PORT = 587
|
||||
EMAIL_USE_TLS = False
|
||||
EMAIL_USE_SSL = False
|
||||
EMAIL_HOST_USER = 'vergesslich@uni-bamberg.de'
|
||||
|
||||
########################################################################################################################
|
||||
# Logging Config #
|
||||
|
||||
12
templates/registration/password_reset_complete.html
Normal file
12
templates/registration/password_reset_complete.html
Normal file
@ -0,0 +1,12 @@
|
||||
{% extends 'base.jinja2' %}
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
{% block content %}
|
||||
<div class="col-12 ">
|
||||
<div class="row justify-content-center justify-content-sm-center">
|
||||
<div class="col-12 col-sm-8 col-md-7 col-lg-5 col-xl-4 bg-white text-dark p-3 mt-5 border text-center">
|
||||
<h1 class="mb-4">Passwort zurücksetzen beendet</h1>
|
||||
<p>Dein Passwort wurde erfolgreich zurückgesetzt.</p>
|
||||
<p></p><a href="{{ url('realm-home') }}">Hier geht's zum Login</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
17
templates/registration/password_reset_confirm.html
Normal file
17
templates/registration/password_reset_confirm.html
Normal file
@ -0,0 +1,17 @@
|
||||
{% extends 'base.jinja2' %}
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
{% block content %}
|
||||
<div class="col-12 ">
|
||||
<div class="row justify-content-center justify-content-sm-center">
|
||||
<div class="col-12 col-sm-8 col-md-7 col-lg-5 col-xl-4 bg-white text-dark p-3 mt-5 border">
|
||||
<h1 class="mb-4">Passwort neu setzen</h1>
|
||||
<form method="post" class="floating-label-form">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ mform.password_input(form.new_password1) }}
|
||||
{{ mform.password_input(form.new_password2) }}
|
||||
<button type="submit" class="btn btn-primary mr-auto p-2 w-100">Speichern</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
16
templates/registration/password_reset_done.html
Normal file
16
templates/registration/password_reset_done.html
Normal file
@ -0,0 +1,16 @@
|
||||
{% extends 'base.jinja2' %}
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
{% block content %}
|
||||
<div class="col-12 ">
|
||||
<div class="row justify-content-center justify-content-sm-center">
|
||||
<div class="col-12 col-sm-8 col-md-7 col-lg-5 col-xl-4 bg-white text-dark p-3 mt-5 border text-center">
|
||||
<h1 class="mb-4">Mail versendet</h1>
|
||||
<p>Wenn ein Account mit dieser Mail existiert, haben wir dir eine Mail gesendet. Du solltest also
|
||||
bald
|
||||
eine Mail erhalten.</p>
|
||||
<p>Wenn du keine Mail erhalten hast, dann prüfe deine Mail Adresse und Spam Ordner. Falls du dennoch
|
||||
keine erhalten hast, wende dich and deinen Administrator.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -1,3 +1,10 @@
|
||||
Someone asked for password reset for email {{ email }}. Follow the link below:
|
||||
{{ protocol }}://{{ domain }}{{ url('ldap_password_reset_confirm', kwargs={'uidb64':uid, 'token':token}) }}
|
||||
<p>Es wurde Passwort zurücksetzen für den Account mit der E-Mail {{ email }} angefordert</p>
|
||||
<p>Wenn Sie keine Mail angefordert haben, ignorieren Sie diese.</p>
|
||||
<p>Der Link ist nur <strong>{{ expiration_days }} Tage</strong> gültig!</p>
|
||||
<p>Bitte klicke auf den folgenden Link um Ihr Password zurückzusetzen</p>
|
||||
<a href="{{ protocol }}://{{ domain }}{{ url('ldap_password_reset_confirm', kwargs={'uidb64':uid, 'token':token}) }}">
|
||||
{{ protocol }}://{{ domain }}{{ url('ldap_password_reset_confirm', kwargs={'uidb64':uid, 'token':token}) }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
23
templates/registration/password_reset_form.html
Normal file
23
templates/registration/password_reset_form.html
Normal file
@ -0,0 +1,23 @@
|
||||
{% extends 'base.jinja2' %}
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
{% block content %}
|
||||
<div class="col-12 ">
|
||||
<div class="row justify-content-center justify-content-sm-center">
|
||||
<div class="col-12 col-sm-8 col-md-7 col-lg-5 col-xl-4 bg-white text-dark p-3 mt-5 border text-center">
|
||||
<h1 class="mb-4">Passwort zurücksetzen</h1>
|
||||
<p>Password vergessen?</p>
|
||||
<p>Schreibe uns deine E-Mail Adresse und wir schicken dir eine Mail mit der Anleitung,
|
||||
wie du dein Passwort zurücksetzen kannst.</p>
|
||||
<form method="post" class="floating-label-form">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ mform.email_input(form.email) }}
|
||||
<div class="d-flex mt-4">
|
||||
<button type="submit" class="btn btn-primary mr-auto p-2">Senden</button>
|
||||
<a href="{{ url('realm-home')}}"
|
||||
class="btn btn-secondary p-2">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user