New password option fo the tenant adding and heatlth check
Release Inventarsystem / release-docker (push) Successful in 3m16s
Release Inventarsystem / release-docker (push) Successful in 3m16s
This commit is contained in:
+5
-2
@@ -542,7 +542,8 @@ def _enforce_module_access():
|
|||||||
msg = {
|
msg = {
|
||||||
'library': "Bibliotheks-Modul ist deaktiviert.",
|
'library': "Bibliotheks-Modul ist deaktiviert.",
|
||||||
'inventory': "Inventar-Modul ist deaktiviert.",
|
'inventory': "Inventar-Modul ist deaktiviert.",
|
||||||
'student_cards': "Schülerausweis-Modul ist deaktiviert."
|
'student_cards': "Schülerausweis-Modul ist deaktiviert.",
|
||||||
|
'terminplaner': "Termin-Modul ist deaktiviert."
|
||||||
}.get(name, f"{name.capitalize()}-Modul ist deaktiviert.")
|
}.get(name, f"{name.capitalize()}-Modul ist deaktiviert.")
|
||||||
|
|
||||||
if request.path.startswith('/api/') or request.is_json:
|
if request.path.startswith('/api/') or request.is_json:
|
||||||
@@ -554,6 +555,8 @@ def _enforce_module_access():
|
|||||||
return redirect(url_for('home_admin'))
|
return redirect(url_for('home_admin'))
|
||||||
elif name != 'library' and cfg.MODULES.is_enabled('library'):
|
elif name != 'library' and cfg.MODULES.is_enabled('library'):
|
||||||
return redirect('/library')
|
return redirect('/library')
|
||||||
|
elif name != 'terminplaner' and cfg.MODULES.is_enabled('terminplaner'):
|
||||||
|
return redirect('/terminplaner')
|
||||||
|
|
||||||
return redirect(url_for('my_borrowed_items'))
|
return redirect(url_for('my_borrowed_items'))
|
||||||
|
|
||||||
@@ -706,7 +709,7 @@ def _action_access_allowed(permissions, action_key):
|
|||||||
def _permission_denied_fallback_endpoint(permissions, current_endpoint=None):
|
def _permission_denied_fallback_endpoint(permissions, current_endpoint=None):
|
||||||
username = session.get('username')
|
username = session.get('username')
|
||||||
|
|
||||||
for candidate in ('home_admin', 'my_borrowed_items', 'tutorial_page', 'notifications_view', 'impressum'):
|
for candidate in ('home_admin', 'library_view', 'terminplaner', 'my_borrowed_items', 'tutorial_page', 'notifications_view', 'impressum'):
|
||||||
if current_endpoint and candidate == current_endpoint:
|
if current_endpoint and candidate == current_endpoint:
|
||||||
continue
|
continue
|
||||||
if _page_access_allowed(permissions, candidate):
|
if _page_access_allowed(permissions, candidate):
|
||||||
|
|||||||
+18
-6
@@ -821,14 +821,26 @@ case "$COMMAND" in
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PORT_ARG="${3:-}"
|
ARG3="${3:-}"
|
||||||
PASSWORD_ARG="${4:-admin123}" # Optional 4th parameter; defaults to 'admin123' if omitted
|
ARG4="${4:-}"
|
||||||
|
|
||||||
|
PORT_ARG=""
|
||||||
|
PASSWORD_ARG="admin123"
|
||||||
|
|
||||||
|
# Check if the 3rd argument is numeric (Port) or text (Password)
|
||||||
|
if [ -n "$ARG3" ]; then
|
||||||
|
if printf '%s\n' "$ARG3" | grep -qE '^[0-9]+$'; then
|
||||||
|
PORT_ARG="$ARG3"
|
||||||
|
if [ -n "$ARG4" ]; then
|
||||||
|
PASSWORD_ARG="$ARG4"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# If ARG3 is not numeric, treat it as the password without setting a port
|
||||||
|
PASSWORD_ARG="$ARG3"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$PORT_ARG" ]; then
|
if [ -n "$PORT_ARG" ]; then
|
||||||
if ! printf '%s\n' "$PORT_ARG" | grep -qE '^[0-9]+$'; then
|
|
||||||
echo "Error: Port must be a numeric value."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
register_tenant_port "$TENANT_ID" "$PORT_ARG"
|
register_tenant_port "$TENANT_ID" "$PORT_ARG"
|
||||||
update_runtime_ports "$PORT_ARG"
|
update_runtime_ports "$PORT_ARG"
|
||||||
sync_tenant_port_map
|
sync_tenant_port_map
|
||||||
|
|||||||
Reference in New Issue
Block a user