Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($_SESSION['step']['client'] == 'client_selection') {
- if (empty($ts3)) $ts3 = ts3connect();
- if (is_string($ts3)) {
- $error[] = array('danger', 'Can not Connect to Server! '.$ts3);
- } else {
- $detected_clients = $ts3->clientList(array('client_type' => '0', 'connection_client_ip' => getClientIp()));
- if (!empty($_POST['uid'])) {
- if (strlen($_POST['uid']) != 28 || substr($_POST['uid'], -1, 1) != '=') {
- $error[] = array('danger', 'Invalid UID Format!');
- } else {
- $skip = false;
- try {
- $client = $ts3->clientGetByUid($_POST['uid']);
- } catch (TeamSpeak3_Exception $e) {
- $skip = true;
- if ($e->getMessage() == 'invalid clientID') {
- $error[] = array('danger', 'No Client with this UID online found!');
- } else {
- $error[] = array('danger', 'Error happened :/ ('.$e.')');
- }
- }
- if (!$skip) {
- $disallow = false;
- foreach (json_decode(GROUPSDISALLOW,1) as $grp) {
- if (in_array($grp, explode(',', $client->client_servergroups))) {
- $disallow = true;
- break;
- }
- }
- if (!$disallow) {
- $_SESSION['dbid'] = $client->client_database_id;
- $_SESSION['clid'] = $client->clid;
- $_SESSION['step']['client'] = 'verify';
- } else{
- $error[] = array('danger', 'You are in a Server Group wich dont allows you to use this Assigner Tool');
- }
- }
- }
- } else if (!empty($_POST['clid'])) {
- $found = false;
- foreach ($detected_clients as $client) {
- if ($client->clid == $_POST['clid']) {
- $disallow = false;
- foreach (json_decode(GROUPSDISALLOW,1) as $grp) {
- if (in_array($grp, explode(',', $client->client_servergroups))) {
- $disallow = true;
- break;
- }
- }
- if (!$disallow) {
- $_SESSION['dbid'] = $client->client_database_id;
- $_SESSION['clid'] = $client->clid;
- $_SESSION['step']['client'] = 'verify';
- $found = true;
- } else{
- $error[] = array('danger', 'You are in a Server Group wich dont allows you to use this Assigner Tool');
- $found = true;
- }
- break;
- }
- }
- if (!$found) {
- $error[] = array('danger', 'Was not able to find selected Client!');
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement