Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. if ($_SESSION['step']['client'] == 'client_selection') {
  2. if (empty($ts3)) $ts3 = ts3connect();
  3. if (is_string($ts3)) {
  4. $error[] = array('danger', 'Can not Connect to Server! '.$ts3);
  5. } else {
  6. $detected_clients = $ts3->clientList(array('client_type' => '0', 'connection_client_ip' => getClientIp()));
  7. if (!empty($_POST['uid'])) {
  8. if (strlen($_POST['uid']) != 28 || substr($_POST['uid'], -1, 1) != '=') {
  9. $error[] = array('danger', 'Invalid UID Format!');
  10. } else {
  11. $skip = false;
  12. try {
  13. $client = $ts3->clientGetByUid($_POST['uid']);
  14. } catch (TeamSpeak3_Exception $e) {
  15. $skip = true;
  16. if ($e->getMessage() == 'invalid clientID') {
  17. $error[] = array('danger', 'No Client with this UID online found!');
  18. } else {
  19. $error[] = array('danger', 'Error happened :/ ('.$e.')');
  20. }
  21. }
  22. if (!$skip) {
  23. $disallow = false;
  24. foreach (json_decode(GROUPSDISALLOW,1) as $grp) {
  25. if (in_array($grp, explode(',', $client->client_servergroups))) {
  26. $disallow = true;
  27. break;
  28. }
  29. }
  30. if (!$disallow) {
  31. $_SESSION['dbid'] = $client->client_database_id;
  32. $_SESSION['clid'] = $client->clid;
  33. $_SESSION['step']['client'] = 'verify';
  34. } else{
  35. $error[] = array('danger', 'You are in a Server Group wich dont allows you to use this Assigner Tool');
  36. }
  37. }
  38. }
  39. } else if (!empty($_POST['clid'])) {
  40. $found = false;
  41. foreach ($detected_clients as $client) {
  42. if ($client->clid == $_POST['clid']) {
  43. $disallow = false;
  44. foreach (json_decode(GROUPSDISALLOW,1) as $grp) {
  45. if (in_array($grp, explode(',', $client->client_servergroups))) {
  46. $disallow = true;
  47. break;
  48. }
  49. }
  50. if (!$disallow) {
  51. $_SESSION['dbid'] = $client->client_database_id;
  52. $_SESSION['clid'] = $client->clid;
  53. $_SESSION['step']['client'] = 'verify';
  54. $found = true;
  55. } else{
  56. $error[] = array('danger', 'You are in a Server Group wich dont allows you to use this Assigner Tool');
  57. $found = true;
  58. }
  59. break;
  60. }
  61. }
  62. if (!$found) {
  63. $error[] = array('danger', 'Was not able to find selected Client!');
  64. }
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement