Compare commits
2 Commits
cdcf2f50c6
...
b1f525c714
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1f525c714 | ||
|
|
f8c0d7d72c |
7
app.py
7
app.py
@@ -25,6 +25,8 @@ from functools import wraps
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
|
|
||||||
from flask import (
|
from flask import (
|
||||||
Flask, jsonify, render_template,
|
Flask, jsonify, render_template,
|
||||||
send_from_directory, redirect,
|
send_from_directory, redirect,
|
||||||
@@ -53,6 +55,7 @@ UPLOAD_EXTENSIONS = {".jpg", ".jpeg", ".png", ".mp4"}
|
|||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.secret_key = "CHANGE_THIS_SECRET!!!"
|
app.secret_key = "CHANGE_THIS_SECRET!!!"
|
||||||
|
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1)
|
||||||
|
|
||||||
@app.context_processor
|
@app.context_processor
|
||||||
def inject_globals():
|
def inject_globals():
|
||||||
@@ -769,6 +772,7 @@ def add_customer():
|
|||||||
|
|
||||||
|
|
||||||
@app.route("/api/customer", methods=["POST"])
|
@app.route("/api/customer", methods=["POST"])
|
||||||
|
@login_required
|
||||||
def api_add_customer():
|
def api_add_customer():
|
||||||
"""
|
"""
|
||||||
API-Endpunkt für die Willkommensseite (JSON).
|
API-Endpunkt für die Willkommensseite (JSON).
|
||||||
@@ -792,6 +796,9 @@ def api_add_customer():
|
|||||||
if not site:
|
if not site:
|
||||||
return jsonify({"error": "No site configured"}), 400
|
return jsonify({"error": "No site configured"}), 400
|
||||||
|
|
||||||
|
if not current_user.can_access_site(site):
|
||||||
|
return jsonify({"error": "Access denied"}), 403
|
||||||
|
|
||||||
logo_url = generate_welcome_page.search_customer_logo(customer_name)
|
logo_url = generate_welcome_page.search_customer_logo(customer_name)
|
||||||
|
|
||||||
if not logo_url:
|
if not logo_url:
|
||||||
|
|||||||
3085
session-ses_1e96.md
3085
session-ses_1e96.md
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user