Hallo ich nutze in meinem ucp diesen TS3 Framework doch ich habe das Problem das wenn jemand seine UID eingibt kriegt er die rechte nicht.
Die Beschreibung des Spielers wird aber geändert.
Es war eine extra Anfertigung und deswegen ist es ein bissen kompliziert ich habe die Gruppen ids selbst geändert sollte jetzt richtig geordnet sein aber der spieler krigt seine rechte nicht zbs wenn er Donator ist oder wenn er gebannt ist.
Die UID wird auch in der Datenbank eingespeichert
<?php
$startzeit = explode(" ", microtime());
$startzeit = $startzeit[0]+$startzeit[1];
error_reporting(0);
require_once("../class/config/config.class.php");
require_once("../class/framework.class.php");
$framework = new UCP_Framework();
$lang = UCP_Framework::getLang();
$config = UCP_Framework::getConfig();
include("../class/ts3admin.class.php");
$adminranks = array(
-1 => 41,
1 => 40,
2 => 39,
3 => 37,
4 => 36,
5 => 36,
1338 => 35,
2000 => 34
);
$frakchannel = array(
1 => 208, //
2 => , //
3 => 212, //
4 => 153, //
5 => 213, //
6 => 214, //
7 => 145, //
8 => 169, //
9 => 185, //
10 => 177, //
11 => 194, //
12 => 121,
13 => 161,
14 => 129, //
15 => 209,
16 => 137, //
17 => 211,
18 => 210,
19 => 219,
20 => 206,
21 => ,
22 => 215,
23 => 216, //
24 => 207,
25 => 217,
26 => 218
);
$bmodchannel = array(
-1 => 318
);
/*-------SETTINGS-------*/
$ts3_ip = '127.0.0.1';
$ts3_queryport = 10011;
$ts3_user = 'serveradmin';
$ts3_pass = 'nÖÖ Krigste net';
$ts3_port = 9987;
/*----------------------*/
#build a new ts3admin object
$tsAdmin = new ts3admin($ts3_ip, $ts3_queryport);
if($tsAdmin->getElement('success', $tsAdmin->connect())) {
#login as serveradmin
$tsAdmin->login($ts3_user, $ts3_pass);
#select teamspeakserver
$tsAdmin->selectServer($ts3_port);
$tsAdmin->setName("GOR Teamspeak Bot");
$onlineClients = $tsAdmin->clientList();
echo "[TS3] Erfolgreich Verbunden<br />\n";
foreach($onlineClients['data'] as $client) {
$qR = mysql_query("SELECT * FROM users WHERE TeamspeakDBID = '".$client['client_database_id']."' LIMIT 1");
if(mysql_num_rows($qR) >= 1) {
## Server Gruppen ##
$row = mysql_fetch_assoc($qR);
#echo '<pre>', print_r($row,true) ,'</pre>';
#exit;
$hR = mysql_query("SELECT * FROM hwdban WHERE Spieler = '".$row['Name']."' LIMIT 1");
$bR = mysql_query("SELECT * FROM bannedplayers WHERE Name = '".$row['Name']."' LIMIT 1");
if(mysql_num_rows($hR)) {
$hban = mysql_fetch_assoc($hR);
if($hban['SQLid'] >= 1) {
$tsAdmin->serverGroupDeleteClient(43,$row['TeamspeakDBID']);
$tsAdmin->serverGroupDeleteClient(44,$row['TeamspeakDBID']);
$tsAdmin->serverGroupAddClient(45,$row['TeamspeakDBID']);
} else {
$tsAdmin->serverGroupDeleteClient(45,$row['TeamspeakDBID']);
$tsAdmin->serverGroupAddClient(43,$row['TeamspeakDBID']);
$rights = $tsAdmin->serverGroupsByClientID($row['TeamspeakDBID']);
foreach($rights['data'] as $key) {
if($key['sgid'] == 43 || $key['sgid'] == 44 || $key['sgid'] == 2 || $key['sgid'] == 25 || $key['sgid'] == 94) continue;
if($key['sgid'] == $adminranks[$row['AdminLevel']]) continue;
$tsAdmin->serverGroupDeleteClient($key['sgid'],$row['TeamspeakDBID']);
}
$tsAdmin->serverGroupAddClient($adminranks[$row['AdminLevel']],$row['TeamspeakDBID']);
if($row['AdminLevel'] >= 1 || $row['AdminLevel'] == -1)
{
$tsAdmin->serverGroupAddClient(42, $row['TeamspeakDBID']);
} else {
$tsAdmin->serverGroupDeleteClient(42, $row['TeamspeakDBID']);
}
if($row['DonateRank'] == 2) {
$tsAdmin->serverGroupAddClient(44,$row['TeamspeakDBID']);
} else {
$tsAdmin->serverGroupDeleteClient(44,$row['TeamspeakDBID']);
}
}
} else if(mysql_num_rows($bR)) {
$ban = mysql_fetch_assoc($bR);
if($ban['Time'] == -1 || time() < $ban['Time']) {
$tsAdmin->serverGroupDeleteClient(43,$row['TeamspeakDBID']);
$tsAdmin->serverGroupDeleteClient(42,$row['TeamspeakDBID']);
$tsAdmin->serverGroupAddClient(45,$row['TeamspeakDBID']);
} else {
$tsAdmin->serverGroupDeleteClient(45,$row['TeamspeakDBID']);
$tsAdmin->serverGroupAddClient(43,$row['TeamspeakDBID']);
$rights = $tsAdmin->serverGroupsByClientID($row['TeamspeakDBID']);
foreach($rights['data'] as $key) {
if($key['sgid'] == 7 || $key['sgid'] == 93 || $key['sgid'] == 2 || $key['sgid'] == 25 || $key['sgid'] == 94) continue;
if($key['sgid'] == $adminranks[$row['AdminLevel']]) continue;
$tsAdmin->serverGroupDeleteClient($key['sgid'],$row['TeamspeakDBID']);
}
$tsAdmin->serverGroupAddClient($adminranks[$row['AdminLevel']],$row['TeamspeakDBID']);
if($row['AdminLevel'] >= 1 || $row['AdminLevel'] == -1)
{
$tsAdmin->serverGroupAddClient(42, $row['TeamspeakDBID']);
#echo "[TS3] ".$row['Name'].": GOR Gruppe Zugewiesen<br />\n";
} else {
$tsAdmin->serverGroupDeleteClient(42, $row['TeamspeakDBID']);
#echo "[TS3] ".$row['Name'].": GOR Gruppe Entzogen<br />\n";
}
if($row['DonateRank'] == 2) {
$tsAdmin->serverGroupAddClient(44,$row['TeamspeakDBID']);
echo "[TS3] ".$row['Name'].": Donator Gruppe Zugewiesen<br />\n";
} else {
$tsAdmin->serverGroupDeleteClient(44,$row['TeamspeakDBID']);
echo "[TS3] ".$row['Name'].": Donator Gruppe Entzogen<br />\n";
}
}
} else {
$tsAdmin->serverGroupDeleteClient(45,$row['TeamspeakDBID']);
$tsAdmin->serverGroupAddClient(43,$row['TeamspeakDBID']);
$rights = $tsAdmin->serverGroupsByClientID($row['TeamspeakDBID']);
foreach($rights['data'] as $key) {
if($key['sgid'] == 43 || $key['sgid'] == 44 || $key['sgid'] == 2 || $key['sgid'] == 25 || $key['sgid'] == 42) continue;
if($key['sgid'] == $adminranks[$row['AdminLevel']]) continue;
$tsAdmin->serverGroupDeleteClient($key['sgid'],$row['TeamspeakDBID']);
#echo "[TS3] ".$row['Name'].": Admin Rechte Zugewiesen/Entzogen<br />\n";
}
$tsAdmin->serverGroupAddClient($adminranks[$row['AdminLevel']],$row['TeamspeakDBID']);
if($row['AdminLevel'] >= 1 || $row['AdminLevel'] == -1)
{
$tsAdmin->serverGroupAddClient(42, $row['TeamspeakDBID']);
} else {
$tsAdmin->serverGroupDeleteClient(42, $row['TeamspeakDBID']);
}
if($row['DonateRank'] == 2) {
$tsAdmin->serverGroupAddClient(44,$row['TeamspeakDBID']);
#echo "[TS3] ".$row['Name'].": Donator Gruppe Zugewiesen<br />\n";
} else {
$tsAdmin->serverGroupDeleteClient(44,$row['TeamspeakDBID']);
#echo "[TS3] ".$row['Name'].": Donator Gruppe Entzogen<br />\n";
}
}
$conf = array();
$conf['client_description'] = "Ingame-Name: ".$row['Name'];
$tsAdmin->clientDbEdit($row['TeamspeakDBID'],$conf);
#echo "[TS3] ".$row['Name'].": Beschreibung Geändert<br />\n";
## Channel Gruppen ##
$leader = $row['Leader'];
$member = $row['Member'];
$rights = false;
foreach($frakchannel as $frak => $cID) {
$rLeader = $tsAdmin->channelGroupClientList($cID,$row['TeamspeakDBID'],5);
$rMember = $tsAdmin->channelGroupClientList($cID,$row['TeamspeakDBID'],6);
#echo '<pre>',print_r($rights['data'],true),'</pre><br/><br/>';
foreach($rLeader['data'] as $right) {
if($right['cldbid'] == $row['TeamspeakDBID']) {
if($leader == $frak) {
$rights = true;
break;
} else {
$tsAdmin->setClientChannelGroup(8,$cID,$row['TeamspeakDBID']);
echo "[TS3] ".$row['Name'].": Leader Rechte Entzogen<br />\n";
}
}
}
foreach($rMember['data'] as $right) {
if($right['cldbid'] == $row['TeamspeakDBID']) {
if($member == $frak) {
$rights = true;
break;
} else {
$tsAdmin->setClientChannelGroup(8,$cID,$row['TeamspeakDBID']);
echo "[TS3] ".$row['Name'].": Member Rechte Entzogen<br />\n";
}
}
}
if($leader == -1 && $member == -1) continue;
if(!$rights) {
#echo "Hit: DBID: ".$row['TeamspeakDBID'].'<br/>';
if($leader == $frak) {
$tsAdmin->setClientChannelGroup(17,$cID,$row['TeamspeakDBID']);
echo "[TS3] ".$row['Name'].": Fraktions Leader Rechte Zugewiesen<br />\n";
} else if($member == $frak) {
$tsAdmin->setClientChannelGroup(18,$cID,$row['TeamspeakDBID']);
echo "[TS3] ".$row['Name'].": Fraktions Mitglieder Rechte Zugewiesen<br />\n";
}
}
}
$bmod = $row['AdminLevel'];
$mod = -1;
$rights = false;
foreach($bmodchannel as $mod => $cID) {
$rBmod = $tsAdmin->channelGroupClientList($cID,$row['TeamspeakDBID'],45);
#echo '<pre>',print_r($rights['data'],true),'</pre><br/><br/>';
foreach($rBmod['data'] as $right) {
if($right['cldbid'] == $row['TeamspeakDBID']) {
if($bmod == -1) {
$rights = true;
break;
} else {
$tsAdmin->setClientChannelGroup(16,$cID,$row['TeamspeakDBID']);
echo "[TS3] ".$row['Name'].": Bmod Rechte Entzogen<br />\n";
}
}
}
if(!$rights) {
#echo "Hit: DBID: ".$row['TeamspeakDBID'].'<br/>';
if($bmod == -1) {
$tsAdmin->setClientChannelGroup(18,$cID,$row['TeamspeakDBID']);
echo "[TS3] ".$row['Name'].": Bmod Rechte Zugewiesen<br />\n";
}
}
}
}
}
$tsAdmin->logout();
echo "[TS3] Durchlauf Erfolgreich<br />\n";
} else {
echo "[TS3] Verbindungsaufbau Fehlgeschlagen<br />\n";
}
$endzeit=explode(" ", microtime());
$endzeit=$endzeit[0]+$endzeit[1];
echo "Ausführungszeit: ".round($endzeit - $startzeit,6)." Sekunden";
?>
Alles anzeigen
//EDIT also ich sag mal so nur die spieler Beschreibung wird geändert mehr geht nicht kann sein das ich die channel ids oder Server gruppen ids auch falsch eingegeben habe weiß halt net was wo hin muss aber das sollte eigentlich gehen das ich Projektleiter rechte krige weil es wird ja abgefrag ob der spieler admin rank 2000 hat und das habe ich