isExpired()) {
$cacheutils->setValue([getServerGroups(), date('d.m.Y H:i:s')], 300);
}
$grouplist = $cacheutils->getValue();
try {
$tsAdmin = getTeamspeakConnection("#no_query_clients");
} catch (Exception $e){
if ($e->getCode() == 1281) {
echo '';
} else {
echo '
' . translate($lang["general"]["scripterror"], [$e->getCode(), $e->getMessage()]) . '
';
exit;
}
}
if(isset($_POST["absenden"])){
$uid = htmlspecialchars($_POST['uid']);
if(in_array(htmlspecialchars($_POST['group']), $config["groups"]["allowgroups"])){
try {
$tsAdmin->clientGetByUid($uid)->addServerGroup(htmlspecialchars($_POST['group']));
setCookie("tsuid", $uid);
$success = "success";
} catch(Exception $e) {
if(strpos($e, "invalid clientID") == true){
$error = "offline";
}elseif(strpos($e, "duplicate entry") == true){
$error = "duplicate";
}
}
}else{
$error = "notallowed";
}
}
?>
getCode() == 1281) {
return '';
} else {
return '' . translate($lang["general"]["scripterror"], [$e->getCode(), $e->getMessage()]) . '
';
}
}
}
require_once __DIR__ . "/include/footer.php";
?>