20 lines
626 B
Python
20 lines
626 B
Python
#!/usr/bin/env python3
|
|
# V96: Fix test session endpoint to set BOTH session keys used by weval_check_auth
|
|
path = "/var/www/html/api/opus-test-session-v94.php"
|
|
with open(path, "rb") as f:
|
|
raw = f.read()
|
|
|
|
if b"weval_authenticated" in raw:
|
|
print("ALREADY")
|
|
exit(0)
|
|
|
|
# Add weval_authenticated (what weval_check_auth actually checks)
|
|
old = b"$_SESSION['weval_auth'] = true;"
|
|
new = b"""$_SESSION['weval_auth'] = true;
|
|
$_SESSION['weval_authenticated'] = true; // V96 fix: actual key used by weval_check_auth"""
|
|
|
|
raw = raw.replace(old, new, 1)
|
|
with open(path, "wb") as f:
|
|
f.write(raw)
|
|
print(f"Fixed: size {len(raw)}")
|