access bot

Ibo

Member
Joined
Oct 20, 2015
Messages
94
Reaction score
39
Points
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
 

xator

Member
Joined
May 3, 2016
Messages
58
Reaction score
30
Points
53
bookmark maybe someone can provide this, this is great idea :D
 

Alligatoras

Administrator
Joined
Mar 31, 2016
Messages
2,570
Solutions
12
Reaction score
2,857
Points
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
Joined
May 3, 2016
Messages
58
Reaction score
30
Points
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:

Norvik

Retired Staff
Contributor
Joined
Jul 18, 2015
Messages
635
Reaction score
588
Points
157
That is actually pretty easy. I'm gonna work on it and I'll let you know how it works asap :)
 

xator

Member
Joined
May 3, 2016
Messages
58
Reaction score
30
Points
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
Joined
Oct 28, 2015
Messages
411
Reaction score
253
Points
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
Joined
Jul 18, 2015
Messages
635
Reaction score
588
Points
157
Lol forgot to post my results. I'm gonna post some example code in the following hours.
 

Norvik

Retired Staff
Contributor
Joined
Jul 18, 2015
Messages
635
Reaction score
588
Points
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
Joined
Oct 20, 2015
Messages
94
Reaction score
39
Points
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
Joined
Oct 20, 2015
Messages
94
Reaction score
39
Points
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
Joined
May 3, 2016
Messages
58
Reaction score
30
Points
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";
    }
    ?>
 

Umar

Member
Joined
Jun 18, 2016
Messages
65
Reaction score
8
Points
40
how can i run this on my website? please can anyone help me ?
 

FarisDev

L oryh brx
Contributor
Joined
Jun 9, 2016
Messages
277
Reaction score
111
Points
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
Joined
May 3, 2016
Messages
58
Reaction score
30
Points
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
Joined
Dec 2, 2015
Messages
38
Reaction score
4
Points
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();"
 

mfclm

Member
Joined
Jul 8, 2016
Messages
4
Reaction score
0
Points
33
It always show me that Im not vip .... can someone help me ??
 

aliscript

Member
Joined
Jul 3, 2016
Messages
14
Reaction score
0
Points
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