release 1.2.4

This commit is contained in:
Newcomer1989
2018-02-12 06:31:19 +01:00
parent c7fb3673df
commit 28aeb8ec6f
53 changed files with 2092 additions and 1647 deletions

View File

@@ -1,7 +1,7 @@
<?PHP
if (isset($_POST['refresh'])) {
$_SESSION = array();
session_destroy();
$rspathhex = 'rs_'.dechex(crc32(__DIR__)).'_';
rem_session_ts3($rspathhex);
}
function set_session_ts3($voiceport, $mysqlcon, $dbname, $language, $adminuuid) {
if (!empty($_SERVER['HTTP_CLIENT_IP']))
@@ -20,67 +20,56 @@ function set_session_ts3($voiceport, $mysqlcon, $dbname, $language, $adminuuid)
$hpclientip = 0;
$hpclientip = inet_pton($hpclientip);
$rspathhex = 'rs_'.dechex(crc32(__DIR__)).'_';
$allclients = $mysqlcon->query("SELECT u.uuid,u.cldbid,u.name,u.ip,u.firstcon,s.total_connections FROM $dbname.user as u LEFT JOIN $dbname.stats_user as s ON u.uuid=s.uuid WHERE online='1';")->fetchAll();
$_SESSION['connected'] = 0;
$_SESSION['serverport'] = $voiceport;
$_SESSION[$rspathhex.'connected'] = 0;
$_SESSION[$rspathhex.'tsname'] = "verification needed!";
$_SESSION[$rspathhex.'serverport'] = $voiceport;
foreach ($allclients as $client) {
if ($hpclientip == $client['ip']) {
if(isset($_SESSION['uuid_verified']) && $_SESSION['uuid_verified'] != $client['uuid']) {
if(isset($_SESSION[$rspathhex.'uuid_verified']) && $_SESSION[$rspathhex.'uuid_verified'] != $client['uuid']) {
continue;
}
if(isset($_SESSION['tsuid']) && $_SESSION['tsuid'] != $client['uuid']) {
$_SESSION['multiple'] .= htmlspecialchars($client['uuid']).'=>'.htmlspecialchars($client['name']).',';
} elseif (!isset($_SESSION['tsuid'])) {
$_SESSION['multiple'] = htmlspecialchars($client['uuid']).'=>'.htmlspecialchars($client['name']).',';
$_SESSION[$rspathhex.'tsname'] = $client['name'];
if(isset($_SESSION[$rspathhex.'tsuid']) && $_SESSION[$rspathhex.'tsuid'] != $client['uuid']) {
$_SESSION[$rspathhex.'multiple'] .= htmlspecialchars($client['uuid']).'=>'.htmlspecialchars($client['name']).',';
$_SESSION[$rspathhex.'tsname'] = "verification needed!";
unset($_SESSION[$rspathhex.'admin']);
} elseif (!isset($_SESSION[$rspathhex.'tsuid'])) {
$_SESSION[$rspathhex.'multiple'] = htmlspecialchars($client['uuid']).'=>'.htmlspecialchars($client['name']).',';
}
$_SESSION['tsuid'] = $client['uuid'];
$_SESSION['tscldbid'] = $client['cldbid'];
$_SESSION['tsname'] = $client['name'];
if ($_SESSION['tsuid'] == $adminuuid) {
$_SESSION['admin'] = TRUE;
$_SESSION[$rspathhex.'tsuid'] = $client['uuid'];
foreach ($adminuuid as $auuid) {
if ($_SESSION[$rspathhex.'tsuid'] == $auuid) {
$_SESSION[$rspathhex.'admin'] = TRUE;
}
}
$_SESSION[$rspathhex.'tscldbid'] = $client['cldbid'];
if ($client['firstcon'] == 0) {
$_SESSION['tscreated'] = "unkown";
$_SESSION[$rspathhex.'tscreated'] = "unkown";
} else {
$_SESSION['tscreated'] = date('d-m-Y', $client['firstcon']);
$_SESSION[$rspathhex.'tscreated'] = date('d-m-Y', $client['firstcon']);
}
if ($client['total_connections'] != NULL) {
$_SESSION['tsconnections'] = $client['total_connections'];
$_SESSION[$rspathhex.'tsconnections'] = $client['total_connections'];
} else {
$_SESSION['tsconnections'] = 0;
$_SESSION[$rspathhex.'tsconnections'] = 0;
}
$convert = array(
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p'
);
$convert = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p');
$uuidasbase16 = '';
for ($i = 0; $i < 20; $i++) {
$char = ord(substr(base64_decode($_SESSION['tsuid']), $i, 1));
$char = ord(substr(base64_decode($_SESSION[$rspathhex.'tsuid']), $i, 1));
$uuidasbase16 .= $convert[($char & 0xF0) >> 4];
$uuidasbase16 .= $convert[$char & 0x0F];
}
if (is_file('../avatars/' . $uuidasbase16 . '.png')) {
$_SESSION['tsavatar'] = $uuidasbase16 . '.png';
$_SESSION[$rspathhex.'tsavatar'] = $uuidasbase16 . '.png';
} else {
$_SESSION['tsavatar'] = "none";
$_SESSION[$rspathhex.'tsavatar'] = "none";
}
$_SESSION['connected'] = 1;
$_SESSION['language'] = $language;
$_SESSION[$rspathhex.'connected'] = 1;
$_SESSION[$rspathhex.'language'] = $language;
}
}
}