Cannot redeclare serverGroupClientList()

zbalh

New Member
Mar 4, 2017
6
0
16
hello r4p3
i've got this problem
Fatal error: Cannot redeclare serverGroupClientList() (previously declared in /var/www/html/myself/unknowncl.php:7) in /var/www/html/myself/unknowncl.php on line 7



the full code

<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
require_once("config.php");
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://$queryname:$querypass@$serverip:$queryport/?server_port=$voiceport&nickname=$unick");
foreach ($ts3_VirtualServer->clientList() as $ts3_Client) {
if ($ts3_Client["client_type"] == 0 and $ts3_Client["connection_client_ip"] == getIp()) {
function serverGroupClientList($groupIDs) {

global $ts3_VirtualServer;

$clientList = array();

foreach ($ts3_VirtualServer->clientList() as $ts3_Client) {
if ($ts3_Client["client_type"] == 0 and $ts3_Client["connection_client_ip"] == getIp()) {
$clientGroups = explode(',', $ts3_Client['client_servergroups']);

foreach($clientGroups as $cG) {

if(in_array($cG, $groupIDs)) $clientList[$ts3_Client->getId()] = $ts3_Client;

}

}
}

return $clientList;

}

if ($ts3_Client["client_type"] == 0 and $ts3_Client["connection_client_ip"] == getIp()) {
$serverGroups = array($group);

$clientList = serverGroupClientList($serverGroups);

foreach($clientList as $client) {
header("Location: error.php");
}
}

}}
?>
 

Qraktzyl

Retired Staff
Contributor
Nov 2, 2015
997
723
161
Fatal error: Cannot redeclare serverGroupClientList() (previously declared in /var/www/html/myself/unknowncl.php:7) in /var/www/html/myself/unknowncl.php on line 7

The function serverGroupClientList() is declared somewhere else, probably from one of the

require_once("libraries/TeamSpeak3/TeamSpeak3.php");
require_once("config.php");

Check those files.
 

zbalh

New Member
Mar 4, 2017
6
0
16
Fatal error: Cannot redeclare serverGroupClientList() (previously declared in /var/www/html/myself/unknowncl.php:7) in /var/www/html/myself/unknowncl.php on line 7

The function serverGroupClientList() is declared somewhere else, probably from one of the

require_once("libraries/TeamSpeak3/TeamSpeak3.php");
require_once("config.php");

Check those files.
oh!! yes i think i got it.
i forget to add $config['groups'] = array(11);
i'm sooo dumb
thanks!
 
Top