diff --git a/app/flask-postgres/app/app.py b/app/flask-postgres/app/app.py index 7daa572..d799707 100644 --- a/app/flask-postgres/app/app.py +++ b/app/flask-postgres/app/app.py @@ -18,7 +18,7 @@ from flask import ( from werkzeug.security import check_password_hash, generate_password_hash from werkzeug.utils import secure_filename -from config import Config, COUNTRY_VAT_LABELS, FILES_DIR +from config import Config, COUNTRY_VAT_LABELS from db import get_connection, fetchone_dict, fetchall_dict from auth import login_required from permissions import is_video_allowed_for_level, is_course_allowed_for_level, get_allowed_checklist_levels_for_mandant_level diff --git a/app/flask-postgres/app/config.py b/app/flask-postgres/app/config.py index 6ff1983..ef66ae1 100644 --- a/app/flask-postgres/app/config.py +++ b/app/flask-postgres/app/config.py @@ -11,9 +11,11 @@ class Config: DB_PORT = os.getenv("DB_PORT", "5432") LOG_DIR = os.getenv("LOG_DIR", "./logs") + FILES_DIR = os.getenv("FILES_DIR", "/app/files") COUNTRY_VAT_LABELS = { "DE": "inkl. 19% USt", "AT": "inkl. 20% USt", "CH": "exkl. MwSt", -} \ No newline at end of file +} + diff --git a/app/flask-postgres/app/templates/admin_mandanten.html b/app/flask-postgres/app/templates/admin_mandanten.html index 34c1fe2..cf75fe8 100644 --- a/app/flask-postgres/app/templates/admin_mandanten.html +++ b/app/flask-postgres/app/templates/admin_mandanten.html @@ -59,6 +59,29 @@ min="0"> +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
@@ -173,6 +196,37 @@ errorBox.innerHTML = ""; errorBox.style.display = "none"; } + + const adminName = document.getElementById("admin_name").value.trim(); + const adminEmail = document.getElementById("admin_email").value.trim(); + const adminPassword = document.getElementById("admin_password").value; + const adminPassword2 = document.getElementById("admin_password2").value; + + if (!adminName) { + errors.push("Admin User Name ist ein Pflichtfeld."); + } + + if (!adminEmail) { + errors.push("Admin User E-Mail ist ein Pflichtfeld."); + } else if (!emailRegex.test(adminEmail)) { + errors.push("Bitte eine gültige Admin E-Mail-Adresse eingeben."); + } + + if (!adminPassword) { + errors.push("Admin Passwort ist ein Pflichtfeld."); + } + + if (!adminPassword2) { + errors.push("Bitte Admin Passwort bestätigen."); + } + + if (adminPassword && adminPassword2 && adminPassword !== adminPassword2) { + errors.push("Die beiden Admin-Passwörter stimmen nicht überein."); + } + + if (adminPassword && adminPassword.length < 8) { + errors.push("Das Admin Passwort muss mindestens 8 Zeichen lang sein."); + } }); });