Beispiel #1
0
    if (isset($_GET['steamid']) && $helpers->IsValidSteamID($_GET['steamid'])) {
        $trackerID = $dbi->escape_string($_GET['steamid']);
    }
    // Access query
    $access_query = '(SELECT SUM(`accessBit`) FROM `' . $table . '_Access` WHERE serverKey IN (' . $helpers->keyToServerKeys($access_keys, $_GET['key']) . '))';
    $insertresult = $dbi->query("INSERT IGNORE INTO `" . $table . "_Trackers`\n\t\t\t\t\t\t(trackerIP, trackerID, lastView, accessID)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t('{$trackerIP}', '{$trackerID}', UNIX_TIMESTAMP(), {$access_query})\n\t\t\t\t\tON DUPLICATE KEY\n\t\t\t\t\t\tUPDATE lastView = UNIX_TIMESTAMP(), trackerID = '{$trackerID}', accessID = {$access_query}");
    // Insert failed
    if ($insertresult === FALSE) {
        $dbi->close();
        $helpers->printXmlError("DB_UPDATE_FAILURE", "CallAdmin_Notice");
    }
}
$dbi->close();
$xml = new SimpleXMLElement("<CallAdmin/>");
$counter = 0;
while ($row = $fetchresult->fetch_assoc()) {
    $child = $xml->addChild("singleReport");
    foreach ($row as $key => $value) {
        $key = $helpers->_xmlentities($key);
        $value = $helpers->_xmlentities($value);
        // This shouldn't happen, but is used for the client
        if (strlen($value) < 1) {
            $value = "NULL";
        }
        $child->addChild($key, $value);
    }
    $counter++;
}
$child = $xml->addChild("foundRows", $counter);
echo $xml->asXML();
// End of file: notice.php
Beispiel #2
0
require_once "include/TeamSpeak3/TeamSpeak3.php";
$helpers = new CallAdmin_Helpers();
// Key set and no key given or key is wrong
if (!isset($_GET['key']) || !$helpers->keyToServerKeys($access_keys, $_GET['key'])) {
    $helpers->printXmlError("APP_AUTH_FAILURE", "CallAdmin_Ts3");
}
$ts3 = new TeamSpeak3();
$xml = new SimpleXMLElement("<CallAdmin_Ts3/>");
try {
    $ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $user . ":" . $password . "@" . $host . ":" . $queryport . "/?server_port=" . $port);
    $usersChild = $xml->addChild("userList");
    $count = 0;
    $uid = "";
    $name = "";
    foreach ($ts3_VirtualServer->clientList() as $ts3_Client) {
        $uid = $helpers->_xmlentities((string) $ts3_Client['client_unique_identifier']);
        $name = $helpers->_xmlentities((string) $ts3_Client['client_nickname']);
        if ($uid == "ServerQuery") {
            continue;
        }
        $child = $usersChild->addChild("singleUser");
        $child->addChild("name", $name);
        $child->addChild("uid", $uid);
    }
} catch (TeamSpeak3_Adapter_ServerQuery_Exception $e) {
    // Nope
    $helpers->printXmlError($e->getMessage(), "CallAdmin_Ts3");
}
$xml->addChild("success", "true");
echo $xml->asXML();
// End of file: ts3call.php