Add latest changes

Dieser Commit ist enthalten in:
2025-07-03 20:38:33 +00:00
Ursprung 63f3d92724
Commit 6f6cde65db
129 geänderte Dateien mit 3998 neuen und 1199 gelöschten Zeilen

Datei anzeigen

@@ -118,13 +118,14 @@ def edit_license(license_id):
'valid_from': request.form['valid_from'],
'valid_until': request.form['valid_until'],
'is_active': 'is_active' in request.form,
'device_limit': int(request.form.get('device_limit', 3))
'max_devices': int(request.form.get('device_limit', 3)), # Form still uses device_limit
'max_concurrent_sessions': int(request.form.get('max_concurrent_sessions', 1))
}
cur.execute("""
UPDATE licenses
SET license_key = %s, license_type = %s, valid_from = %s,
valid_until = %s, is_active = %s, device_limit = %s
valid_until = %s, is_active = %s, max_devices = %s, max_concurrent_sessions = %s
WHERE id = %s
""", (
new_values['license_key'],
@@ -132,7 +133,8 @@ def edit_license(license_id):
new_values['valid_from'],
new_values['valid_until'],
new_values['is_active'],
new_values['device_limit'],
new_values['max_devices'],
new_values['max_concurrent_sessions'],
license_id
))
@@ -146,7 +148,8 @@ def edit_license(license_id):
'valid_from': str(current_license.get('valid_from', '')),
'valid_until': str(current_license.get('valid_until', '')),
'is_active': current_license.get('is_active'),
'device_limit': current_license.get('device_limit', 3)
'max_devices': current_license.get('max_devices', 3),
'max_concurrent_sessions': current_license.get('max_concurrent_sessions', 1)
},
new_values=new_values)
@@ -313,6 +316,7 @@ def create_license():
ipv4_count = int(request.form.get("ipv4_count", 1))
phone_count = int(request.form.get("phone_count", 1))
device_limit = int(request.form.get("device_limit", 3))
max_concurrent_sessions = int(request.form.get("max_concurrent_sessions", 1))
conn = get_connection()
cur = conn.cursor()
@@ -365,11 +369,11 @@ def create_license():
# Lizenz hinzufügen
cur.execute("""
INSERT INTO licenses (license_key, customer_id, license_type, valid_from, valid_until, is_active,
domain_count, ipv4_count, phone_count, device_limit, is_fake)
VALUES (%s, %s, %s, %s, %s, TRUE, %s, %s, %s, %s, %s)
domain_count, ipv4_count, phone_count, device_limit, max_devices, max_concurrent_sessions, is_fake)
VALUES (%s, %s, %s, %s, %s, TRUE, %s, %s, %s, %s, %s, %s, %s)
RETURNING id
""", (license_key, customer_id, license_type, valid_from, valid_until,
domain_count, ipv4_count, phone_count, device_limit, is_fake))
domain_count, ipv4_count, phone_count, device_limit, device_limit, max_concurrent_sessions, is_fake))
license_id = cur.fetchone()[0]
# Ressourcen zuweisen