diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc
index 48a02aa..b975009 100644
Binary files a/digitaleagentur/__pycache__/settings.cpython-38.pyc and b/digitaleagentur/__pycache__/settings.cpython-38.pyc differ
diff --git a/digitaleagentur/settings.py b/digitaleagentur/settings.py
index 22a4d84..a8ef592 100644
--- a/digitaleagentur/settings.py
+++ b/digitaleagentur/settings.py
@@ -156,9 +156,19 @@ AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
+ #{
+ # 'NAME' : "passwords.auth_password_validators.ComplexityValidator",
+ #}
]
-
+PASSWORD_COMPLEXITY = { # You can omit any or all of these for no limit for that particular set
+ "UPPER": 1, # Uppercase
+ "LOWER": 1, # Lowercase
+ "LETTERS": 1, # Either uppercase or lowercase letters
+ "DIGITS": 1, # Digits
+ "SPECIAL": 1, # Not alphanumeric, space or punctuation character
+ "WORDS": 0 # Words (alphanumeric sequences separated by a whitespace or punctuation character)
+}
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
diff --git a/recoverdir/forms.py b/recoverdir/forms.py
index f9ec44e..61f5681 100644
--- a/recoverdir/forms.py
+++ b/recoverdir/forms.py
@@ -2,6 +2,9 @@ from django import forms
from django.forms import ModelForm
from .models import *
from bootstrap_datepicker_plus import DatePickerInput
+from django.contrib.auth.password_validation import validate_password
+from django.core import validators
+from passwords.validators import *
class PersLetterForm(forms.ModelForm):
@@ -18,6 +21,22 @@ class PersLetterForm(forms.ModelForm):
super(PersLetterForm, self).__init__(*args, **kwargs)
self.fields['text'] = forms.CharField(label="Ihr persönlicher Text", widget=forms.Textarea(attrs={"rows":15, "cols":35}))
+class LoginRDForm(forms.Form):
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.fields['pass'] = forms.CharField(widget=forms.PasswordInput, label="Passwort", required=True)
+
+class RecoverDirSettingForm(forms.ModelForm):
+
+ class Meta:
+ model = RecoverDirSetting
+ fields = ['logpass']
+
+ def __init__(self, *args, **kwargs):
+ super(RecoverDirSettingForm, self).__init__(*args, **kwargs)
+ self.fields['logpass'] = forms.CharField(widget=forms.PasswordInput, label="Passwort", required=True, validators=[dictionary_words, complexity, validate_length])
+ self.fields['logpass_check'] = forms.CharField(widget=forms.PasswordInput, label="Passwort wiederholen", required=True,validators=[dictionary_words, complexity, validate_length])
+
# Notfallhilfe FORMS
# 1 Handlungsleitfaden
diff --git a/recoverdir/models.py b/recoverdir/models.py
index 9ce0dcc..814e7ea 100644
--- a/recoverdir/models.py
+++ b/recoverdir/models.py
@@ -18,6 +18,12 @@ def rd_path_agency(instance, filename):
return 'agencydata/agency_{0}/rd/{1}'.format(instance.agency.pk, filename)
+# MAIN RECOVERDIR PASSWORD AND CONFIG
+class RecoverDirSetting(models.Model):
+ agency = models.ForeignKey(Agency, on_delete=models.CASCADE)
+ logpass = encrypt(models.CharField(max_length=500, blank=True, default="", null=True))
+ recoverkey = encrypt(models.CharField(max_length=500, blank=True, default="", null=True))
+
# Create your models here.
class PersLetter(models.Model):
diff --git a/recoverdir/templates/recoverdir/rd_areas/rd_area_5.html b/recoverdir/templates/recoverdir/rd_areas/rd_area_5.html
index 77f32bb..3de1714 100644
--- a/recoverdir/templates/recoverdir/rd_areas/rd_area_5.html
+++ b/recoverdir/templates/recoverdir/rd_areas/rd_area_5.html
@@ -1,7 +1,6 @@
Personal, interne und externe Partner inkl. Funktionen usw.
Personal
-Beim externen Aufrufen der Notfallhilfe werden alle aktuell angelegten Mitarbeiter inkl. Kontaktdaten angezeigt. Erstellen Sie daher hier Mitarbeiter, die nicht in der digitalen Agentur angelegt sind.
@@ -29,6 +28,17 @@
{% endfor %}
+ {% for us in users_of_agency %}
+
+ | {{us.get_full_name}} |
+ {{us.profile.func|default:""}} |
+
+ Intern
+ |
+
+ |
+
+ {% endfor %}
@@ -101,7 +111,8 @@ $(document).ready(function(){
"pageLength": 50,
"buttons" : {
"className" : "btn-danger"
- }
+ },
+ "order": [[ 1, "desc" ]]
});
});
diff --git a/recoverdir/templates/recoverdir/rd_elements_forms/rd_mainlogin.html b/recoverdir/templates/recoverdir/rd_elements_forms/rd_mainlogin.html
new file mode 100644
index 0000000..d1bac55
--- /dev/null
+++ b/recoverdir/templates/recoverdir/rd_elements_forms/rd_mainlogin.html
@@ -0,0 +1,26 @@
+{% extends "users/base.html" %}
+{% load counter_tag %}
+{% load crispy_forms_tags %}
+{% block content %}
+{% if request.user.profile.agency.module_recoverdir %}
+
+
Notfallhilfe{% if request.user.profile.showtooltips %} {% endif %}
+
+
+
+
+ Bitte melden Sie sich mit dem Passwort für die Notfallhilfe an!
+
+
+
+
+{% else %}
+Sie haben keinen Zugriff auf das Modul Notfallhilfe. Bitte wenden Sie sich an den Support!
+{% endif %}
+{% endblock content %}
diff --git a/recoverdir/templates/recoverdir/rd_management.html b/recoverdir/templates/recoverdir/rd_management.html
index 6bdcfa4..98e60c9 100644
--- a/recoverdir/templates/recoverdir/rd_management.html
+++ b/recoverdir/templates/recoverdir/rd_management.html
@@ -5,6 +5,7 @@
Notfallhilfe{% if request.user.profile.showtooltips %} {% endif %}
+
@@ -63,7 +64,10 @@
- Einstellungen
+
Einstellungen{% if request.user.profile.showtooltips %} {% endif %}
+ {% block settings_content %}
+ {% include "recoverdir/rd_viewsettings.html" %}
+ {% endblock %}
diff --git a/recoverdir/templates/recoverdir/rd_rd.html b/recoverdir/templates/recoverdir/rd_rd.html
index c4259a4..9dc0398 100644
--- a/recoverdir/templates/recoverdir/rd_rd.html
+++ b/recoverdir/templates/recoverdir/rd_rd.html
@@ -125,7 +125,7 @@