29 lines
1019 B
Python
29 lines
1019 B
Python
#!/usr/bin/env python3
|
|
path = "/var/www/html/wevia-ia/wevia-admin.php"
|
|
with open(path, "rb") as f:
|
|
raw = f.read()
|
|
|
|
if b"wevia-admin-crm-v68.php" in raw:
|
|
print("ALREADY_PATCHED")
|
|
exit(0)
|
|
|
|
# Find current CRM Bridge V67 tag (inserted in V67)
|
|
needle = b"wevia-admin-crm.php"
|
|
idx = raw.find(needle)
|
|
if idx == -1:
|
|
print("V67_TAB_NOT_FOUND")
|
|
exit(1)
|
|
|
|
# Find the end of that div </div> after the V67 tab
|
|
start = raw.rfind(b'<div class="tab"', 0, idx)
|
|
end = raw.find(b'</div>', start) + len(b'</div>')
|
|
v67_tab = raw[start:end]
|
|
print("V67 tab found:", v67_tab[:120])
|
|
|
|
v68_tab = b'<div class="tab" onclick="window.location.href=\\\'wevia-admin-crm-v68.php\\\'" style="background:linear-gradient(90deg,rgba(139,92,246,.15),rgba(236,72,153,.15));color:#a78bfa;border:1px solid rgba(139,92,246,.3);font-weight:700">\xe2\x9c\xa8 V68 Premium</div>'
|
|
|
|
new_raw = raw.replace(v67_tab, v67_tab + b"\n" + v68_tab, 1)
|
|
with open(path, "wb") as f:
|
|
f.write(new_raw)
|
|
print(f"PATCHED - size {len(raw)} → {len(new_raw)}")
|