diff --git a/Web/app.py b/Web/app.py index e2e8d93..e5993c8 100755 --- a/Web/app.py +++ b/Web/app.py @@ -542,7 +542,8 @@ def _enforce_module_access(): msg = { 'library': "Bibliotheks-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.") if request.path.startswith('/api/') or request.is_json: @@ -554,6 +555,8 @@ def _enforce_module_access(): return redirect(url_for('home_admin')) elif name != 'library' and cfg.MODULES.is_enabled('library'): return redirect('/library') + elif name != 'terminplaner' and cfg.MODULES.is_enabled('terminplaner'): + return redirect('/terminplaner') 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): 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: continue if _page_access_allowed(permissions, candidate): diff --git a/manage-tenant.sh b/manage-tenant.sh index 601af5e..225ea02 100755 --- a/manage-tenant.sh +++ b/manage-tenant.sh @@ -821,14 +821,26 @@ case "$COMMAND" in exit 1 fi - PORT_ARG="${3:-}" - PASSWORD_ARG="${4:-admin123}" # Optional 4th parameter; defaults to 'admin123' if omitted + ARG3="${3:-}" + 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 ! 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" update_runtime_ports "$PORT_ARG" sync_tenant_port_map