Testpanel klasörüne güncel dosyalar eklendi

This commit is contained in:
2026-04-20 22:28:31 +03:00
commit eb7e1a2b0f
107 changed files with 16317 additions and 0 deletions

44
testpanel/api/index.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
ini_set('display_errors', 1);
include(__DIR__ . '/../includes/functions.php');
$res = $db->select('dns', '*', '', '');
$portal = [];
$accounts = 0;
function formatMac($mac, $doubleDecode = false, $removeSubstr = null) {
if ($doubleDecode) {
$mac = base64_decode(base64_decode($mac));
} else {
$mac = base64_decode($mac);
}
if ($removeSubstr) {
$mac = str_replace($removeSubstr, "", $mac);
}
return strtoupper(preg_replace('/..(?!$)/', '$0:', $mac));
}
$mac = $_GET['mac'];
$macAddress = formatMac($mac, true, "afea");
$result = $db->select('playlist', '*', 'mac_address = :mac_address', '', [':mac_address' => $macAddress]);
if (!empty($result)) {
foreach ($result as $row) {
if (!empty($row['username'])) {
$accounts = 1;
break; // Exit the loop as we found a matching account
}
}
}
foreach ($res as $row) {
if (!empty($res)) {
$portal[] = ['name' => $row['title'], 'url' => $row['url'], 'id' => $row['id']];
}
}
$data = ['portals' => $portal, "accounts" => $accounts];
echo Encryption::run(json_encode($data), "IBO_38");
?>