access bot

Ibo

Member
Oct 20, 2015
94
39
53
Not using the script request template/ sample.
hello


is there a way to create php script that can't open some pages in your website without some groups for example


what ever.com/vip.php
if u don't have vip group in the teamspeak server and trying to open the vip access in the website there is a massage say u dont have the access or what ever


but if u have the access u can open it
 

Alligatoras

Administrator
Mar 31, 2016
2,570
12
2,857
381
That means the website will read the teamspeak 3 client's information....
Too much work, but yea...it will worth i believe!
I gave a try, but still doesn't work!
 

xator

Member
May 3, 2016
58
30
53
That means the website will read the teamspeak 3 client's information....
Too much work, but yea...it will worth i believe!
I gave a try, but still doesn't work!
more than worth:cool:, its gonna be awesome release:D, cause people will donate for features that just for the vip:rolleyes:.
come on Alligatoras we know you can make it ;)
 
Last edited:

xator

Member
May 3, 2016
58
30
53
anyone can solve this ? i have been tried many times, and i have no idea what must i do, my script that i tried to create always say error 1538 invalid parameter.
 

kalle

high minded
Contributor
Oct 28, 2015
411
253
178
I have no time but I have idea in my head lol. Create script ex. vip-check.php and that script would read user info more precise user groups. If vip is given (header(location: /youcanseemevip.php) and session check in this file, if not it gives error message.
 
  • Like
Reactions: Ibo

Norvik

Retired Staff
Contributor
Jul 18, 2015
635
588
157
I didn't test it but it should work.
PHP:
require('inc/ts3admin.class.php');
function getIP()
{
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key)
    {
        if (array_key_exists($key, $_SERVER) === true)
        {
            foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip)
            {
                if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)
                {
                    return $ip;
                }
            }
        }
    }
}

    $tsAdmin = new ts3admin($ts3['ip'], $ts3['queryport']);
    $tsAdmin->login($ts3['user'], $ts3['pass']);
    $tsAdmin->selectServer($ts3['port']);
  
    $clients = $tsAdmin->clientList("-ip -groups");
                  
        foreach($clients['data'] as $client) {
            if($client['connection_client_ip'] == getIP()) {
                $username = $client['client_nickname'];
                $servergroups = $client['client_servergroups'];
            }
        }
      
        if(!empty($username)) {
            echo "Please join our Teamspeak";
        } else {
            if(strpos($servergroups, 10)) { //The 10 is the servergroup
                $isMember = true;
            }
        }
      
        if ($isMember) {
            //do whatever you wanna do if the user is in the group
        } else {
            //do whatever you wanna do if the user is not in the group
        }
 

Ibo

Member
Oct 20, 2015
94
39
53
I didn't test it but it should work.
PHP:
require('inc/ts3admin.class.php');
function getIP()
{
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key)
    {
        if (array_key_exists($key, $_SERVER) === true)
        {
            foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip)
            {
                if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)
                {
                    return $ip;
                }
            }
        }
    }
}

    $tsAdmin = new ts3admin($ts3['ip'], $ts3['queryport']);
    $tsAdmin->login($ts3['user'], $ts3['pass']);
    $tsAdmin->selectServer($ts3['port']);
 
    $clients = $tsAdmin->clientList("-ip -groups");
                 
        foreach($clients['data'] as $client) {
            if($client['connection_client_ip'] == getIP()) {
                $username = $client['client_nickname'];
                $servergroups = $client['client_servergroups'];
            }
        }
     
        if(!empty($username)) {
            echo "Please join our Teamspeak";
        } else {
            if(strpos($servergroups, 10)) { //The 10 is the servergroup
                $isMember = true;
            }
        }
     
        if ($isMember) {
            //do whatever you wanna do if the user is in the group
        } else {
            //do whatever you wanna do if the user is not in the group
        }
make it more simple because i am not good with php stuff
 

Ibo

Member
Oct 20, 2015
94
39
53
I didn't test it but it should work.
PHP:
require('inc/ts3admin.class.php');
function getIP()
{
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key)
    {
        if (array_key_exists($key, $_SERVER) === true)
        {
            foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip)
            {
                if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)
                {
                    return $ip;
                }
            }
        }
    }
}

    $tsAdmin = new ts3admin($ts3['ip'], $ts3['queryport']);
    $tsAdmin->login($ts3['user'], $ts3['pass']);
    $tsAdmin->selectServer($ts3['port']);
 
    $clients = $tsAdmin->clientList("-ip -groups");
                 
        foreach($clients['data'] as $client) {
            if($client['connection_client_ip'] == getIP()) {
                $username = $client['client_nickname'];
                $servergroups = $client['client_servergroups'];
            }
        }
     
        if(!empty($username)) {
            echo "Please join our Teamspeak";
        } else {
            if(strpos($servergroups, 10)) { //The 10 is the servergroup
                $isMember = true;
            }
        }
     
        if ($isMember) {
            //do whatever you wanna do if the user is in the group
        } else {
            //do whatever you wanna do if the user is not in the group
        }
but thx anyway for your interest
 

xator

Member
May 3, 2016
58
30
53
i dont know whats wrong with this one, anyone can explain ? this script always say "you are not vip"
PHP:
<?php defined('BASEPATH') OR exit('No direct script access allowed');
require('../ts3/inc/config.php');
require('../ts3/inc/ts3admin.class.php');
ini_set("register_globals","On");
function getIP()
{
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key)
    {
        if (array_key_exists($key, $_SERVER) === true)
        {
            foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip)
            {
                if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)
                {
                    return $ip;
                }
            }
        }
    }
}

        $tsAdmin = new ts3admin($ts3['ip'], $ts3['queryport']);
    if($tsAdmin->getElement('success', $tsAdmin->connect())) {
        $tsAdmin->login($ts3['user'], $ts3['pass']);
        $tsAdmin->selectServer($ts3['port']);
        $tsAdmin->setName($ts3['displayname']);
        $clients = $tsAdmin->clientList("-ip -uid -groups");
                   
        foreach($clients['data'] as $client) {
                if($client['connection_client_ip'] == getIP()) {
                $userid = $client['client_database_id'];
                $username = $client['client_nickname'];
                $servergroups = $client['client_servergroups'];           
            }
        }
       
        if(!empty($userid)) {
            echo "Please join our Teamspeak";
        } else {
            global $servergroups;
            if(strpos($servergroups, 24607) ) {    //The 10 is the servergroup
                $isMember = true;
            }
        }
     
            global $isMember;
        if ($isMember) {
           echo " you are vip";//do whatever you wanna do if the user is in the group
        } else {
            echo "you are not vip";//do whatever you wanna do if the user is not in the group
    }
    }else {
        echo "Cant connect ts";
    }
    ?>
 

FarisDev

L oryh brx
Contributor
Jun 9, 2016
277
111
107
I didn't test it but it should work.
PHP:
require('inc/ts3admin.class.php');
function getIP()
{
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key)
    {
        if (array_key_exists($key, $_SERVER) === true)
        {
            foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip)
            {
                if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)
                {
                    return $ip;
                }
            }
        }
    }
}

    $tsAdmin = new ts3admin($ts3['ip'], $ts3['queryport']);
    $tsAdmin->login($ts3['user'], $ts3['pass']);
    $tsAdmin->selectServer($ts3['port']);
 
    $clients = $tsAdmin->clientList("-ip -groups");
                 
        foreach($clients['data'] as $client) {
            if($client['connection_client_ip'] == getIP()) {
                $username = $client['client_nickname'];
                $servergroups = $client['client_servergroups'];
            }
        }
     
        if(!empty($username)) {
            echo "Please join our Teamspeak";
        } else {
            if(strpos($servergroups, 10)) { //The 10 is the servergroup
                $isMember = true;
            }
        }
     
        if ($isMember) {
            //do whatever you wanna do if the user is in the group
        } else {
            //do whatever you wanna do if the user is not in the group
        }
i have with php framework the script but they have some error's u can fix it ::


<?php
//framework
require_once("libraries/TeamSpeak3/TeamSpeak3.php");

$rand= rand(1000,6000);

$ts3_VirtualServer = TeamSpeak3::factory("serverquery://serveradmin:******@******:10011/?server_port=9987&nickname=bot[$rand]");

$ClientList = $ts3_VirtualServer->clientList();
foreach($ClientList as $Client) {
$ggids = explode(",", $Client["client_servergroups"]);
}
if(!in_array(6,$ggids)) {
// You don't have permission access
}
?>
 

xator

Member
May 3, 2016
58
30
53
i have with php framework the script but they have some error's u can fix it ::


<?php
//framework
require_once("libraries/TeamSpeak3/TeamSpeak3.php");

$rand= rand(1000,6000);

$ts3_VirtualServer = TeamSpeak3::factory("serverquery://serveradmin:******@******:10011/?server_port=9987&nickname=bot[$rand]");

$ClientList = $ts3_VirtualServer->clientList();
foreach($ClientList as $Client) {
$ggids = explode(",", $Client["client_servergroups"]);
}
if(!in_array(6,$ggids)) {
// You don't have permission access
}
?>
can you explain how this one work ?
 

anjesh

Member
Dec 2, 2015
38
4
40
i dont know whats wrong with this one, anyone can explain ? this script always say "you are not vip"
PHP:
<?php defined('BASEPATH') OR exit('No direct script access allowed');
require('../ts3/inc/config.php');
require('../ts3/inc/ts3admin.class.php');
ini_set("register_globals","On");
function getIP()
{
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key)
    {
        if (array_key_exists($key, $_SERVER) === true)
        {
            foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip)
            {
                if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)
                {
                    return $ip;
                }
            }
        }
    }
}

        $tsAdmin = new ts3admin($ts3['ip'], $ts3['queryport']);
    if($tsAdmin->getElement('success', $tsAdmin->connect())) {
        $tsAdmin->login($ts3['user'], $ts3['pass']);
        $tsAdmin->selectServer($ts3['port']);
        $tsAdmin->setName($ts3['displayname']);
        $clients = $tsAdmin->clientList("-ip -uid -groups");
                  
        foreach($clients['data'] as $client) {
                if($client['connection_client_ip'] == getIP()) {
                $userid = $client['client_database_id'];
                $username = $client['client_nickname'];
                $servergroups = $client['client_servergroups'];          
            }
        }
      
        if(!empty($userid)) {
            echo "Please join our Teamspeak";
        } else {
            global $servergroups;
            if(strpos($servergroups, 24607) ) {    //The 10 is the servergroup
                $isMember = true;
            }
        }
    
            global $isMember;
        if ($isMember) {
           echo " you are vip";//do whatever you wanna do if the user is in the group
        } else {
            echo "you are not vip";//do whatever you wanna do if the user is not in the group
    }
    }else {
        echo "Cant connect ts";
    }
    ?>
i am getting the same error as well, i get "Array" when I "echo $tsAdmin->connect();"
 

aliscript

Member
Jul 3, 2016
14
0
38
i dont know whats wrong with this one, anyone can explain ? this script always say "you are not vip"
PHP:
<?php defined('BASEPATH') OR exit('No direct script access allowed');
require('../ts3/inc/config.php');
require('../ts3/inc/ts3admin.class.php');
ini_set("register_globals","On");
function getIP()
{
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key)
    {
        if (array_key_exists($key, $_SERVER) === true)
        {
            foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip)
            {
                if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)
                {
                    return $ip;
                }
            }
        }
    }
}

        $tsAdmin = new ts3admin($ts3['ip'], $ts3['queryport']);
    if($tsAdmin->getElement('success', $tsAdmin->connect())) {
        $tsAdmin->login($ts3['user'], $ts3['pass']);
        $tsAdmin->selectServer($ts3['port']);
        $tsAdmin->setName($ts3['displayname']);
        $clients = $tsAdmin->clientList("-ip -uid -groups");
                  
        foreach($clients['data'] as $client) {
                if($client['connection_client_ip'] == getIP()) {
                $userid = $client['client_database_id'];
                $username = $client['client_nickname'];
                $servergroups = $client['client_servergroups'];          
            }
        }
      
        if(!empty($userid)) {
            echo "Please join our Teamspeak";
        } else {
            global $servergroups;
            if(strpos($servergroups, 24607) ) {    //The 10 is the servergroup
                $isMember = true;
            }
        }
    
            global $isMember;
        if ($isMember) {
           echo " you are vip";//do whatever you wanna do if the user is in the group
        } else {
            echo "you are not vip";//do whatever you wanna do if the user is not in the group
    }
    }else {
        echo "Cant connect ts";
    }
    ?>
can you give me the file
ts3/inc/config.php
and
ts3/inc/ts3admin.class.php
 
Top