release 1.2.7
This commit is contained in:
400
other/config.php
400
other/config.php
@@ -1,198 +1,204 @@
|
||||
<?PHP
|
||||
require_once('dbconfig.php');
|
||||
if(isset($db['type']) === false) {
|
||||
$db['type']="mysql";
|
||||
}
|
||||
$dbname = $db['dbname'];
|
||||
$dbtype = $db['type'];
|
||||
if($db['type'] != "type") {
|
||||
$dbserver = $db['type'].':host='.$db['host'].';dbname='.$db['dbname'].';charset=utf8mb4';
|
||||
if ($db['type'] == 'mysql') {
|
||||
$dboptions = array(
|
||||
PDO::ATTR_PERSISTENT => true
|
||||
);
|
||||
} else {
|
||||
$dboptions = array();
|
||||
}
|
||||
try {
|
||||
$mysqlcon = new PDO($dbserver, $db['user'], $db['pass'], $dboptions);
|
||||
} catch (PDOException $e) {
|
||||
echo "Database Connection failed: ".$e->getMessage()."\n"; $err_lvl = 3;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$rspathhex = 'rs_'.dechex(crc32(__DIR__)).'_';
|
||||
function rem_session_ts3($rspathhex) {
|
||||
unset($_SESSION[$rspathhex.'admin']);
|
||||
unset($_SESSION[$rspathhex.'clientip']);
|
||||
unset($_SESSION[$rspathhex.'connected']);
|
||||
unset($_SESSION[$rspathhex.'inactivefilter']);
|
||||
unset($_SESSION[$rspathhex.'language']);
|
||||
unset($_SESSION[$rspathhex.'logfilter']);
|
||||
unset($_SESSION[$rspathhex.'logfilter2']);
|
||||
unset($_SESSION[$rspathhex.'multiple']);
|
||||
unset($_SESSION[$rspathhex.'newversion']);
|
||||
unset($_SESSION[$rspathhex.'number_lines']);
|
||||
unset($_SESSION[$rspathhex.'password']);
|
||||
unset($_SESSION[$rspathhex.'serverport']);
|
||||
unset($_SESSION[$rspathhex.'tsavatar']);
|
||||
unset($_SESSION[$rspathhex.'tscldbid']);
|
||||
unset($_SESSION[$rspathhex.'tsconnections']);
|
||||
unset($_SESSION[$rspathhex.'tscreated']);
|
||||
unset($_SESSION[$rspathhex.'tsname']);
|
||||
unset($_SESSION[$rspathhex.'tsuid']);
|
||||
unset($_SESSION[$rspathhex.'upinfomsg']);
|
||||
unset($_SESSION[$rspathhex.'username']);
|
||||
unset($_SESSION[$rspathhex.'uuid_verified']);
|
||||
}
|
||||
|
||||
if (isset($mysqlcon) && ($config = $mysqlcon->query("SELECT * FROM config")->fetch())) {
|
||||
if(count($config) != 0) {
|
||||
$ts['host'] = $config['tshost'];
|
||||
$ts['query'] = $config['tsquery'];
|
||||
$ts['voice'] = $config['tsvoice'];
|
||||
$ts['user'] = $config['tsuser'];
|
||||
$ts['pass'] = $config['tspass'];
|
||||
$webuser = $config['webuser'];
|
||||
$webpass = $config['webpass'];
|
||||
if(!isset($_GET["lang"])) {
|
||||
if(isset($_SESSION[$rspathhex.'language'])) {
|
||||
$language = $_SESSION[$rspathhex.'language'];
|
||||
} else {
|
||||
$language = $config['language'];
|
||||
}
|
||||
} elseif($_GET["lang"] == "ar") {
|
||||
$language = "ar";
|
||||
$_SESSION[$rspathhex.'language'] = "ar";
|
||||
} elseif($_GET["lang"] == "cz") {
|
||||
$language = "cz";
|
||||
$_SESSION[$rspathhex.'language'] = "cz";
|
||||
} elseif($_GET["lang"] == "de") {
|
||||
$language = "de";
|
||||
$_SESSION[$rspathhex.'language'] = "de";
|
||||
} elseif($_GET["lang"] == "fr") {
|
||||
$language = "fr";
|
||||
$_SESSION[$rspathhex.'language'] = "fr";
|
||||
} elseif($_GET["lang"] == "it") {
|
||||
$language = "it";
|
||||
$_SESSION[$rspathhex.'language'] = "it";
|
||||
} elseif($_GET["lang"] == "nl") {
|
||||
$language = "nl";
|
||||
$_SESSION[$rspathhex.'language'] = "nl";
|
||||
} elseif($_GET["lang"] == "ro") {
|
||||
$language = "ro";
|
||||
$_SESSION[$rspathhex.'language'] = "ro";
|
||||
} elseif($_GET["lang"] == "ru") {
|
||||
$language = "ru";
|
||||
$_SESSION[$rspathhex.'language'] = "ru";
|
||||
} elseif($_GET["lang"] == "pt") {
|
||||
$language = "pt";
|
||||
$_SESSION[$rspathhex.'language'] = "pt";
|
||||
} elseif($_GET["lang"] == "pl") {
|
||||
$language = "pl";
|
||||
$_SESSION[$rspathhex.'language'] = "pl";
|
||||
} else {
|
||||
$language = "en";
|
||||
$_SESSION[$rspathhex.'language'] = "en";
|
||||
}
|
||||
$queryname = $config['queryname'];
|
||||
$queryname2 = $config['queryname2'];
|
||||
$slowmode = $config['slowmode'];
|
||||
if(empty($config['grouptime'])) {
|
||||
$grouptime = null;
|
||||
} else {
|
||||
$grouptimearr = explode(',', $config['grouptime']);
|
||||
foreach ($grouptimearr as $entry) {
|
||||
list($key, $value) = explode('=>', $entry);
|
||||
$grouptime[$key] = $value;
|
||||
}
|
||||
}
|
||||
if(empty($config['boost'])) {
|
||||
$boostarr = null;
|
||||
} else {
|
||||
$boostexp = explode(',', $config['boost']);
|
||||
foreach ($boostexp as $entry) {
|
||||
list($key, $value1, $value2) = explode('=>', $entry);
|
||||
$boostarr[$key] = array("group"=>$key,"factor"=>$value1,"time"=>$value2);
|
||||
}
|
||||
}
|
||||
$resetbydbchange = $config['resetbydbchange'];
|
||||
$msgtouser = $config['msgtouser'];
|
||||
$currvers = $config['currvers'];
|
||||
$substridle = $config['substridle'];
|
||||
$exceptuuid = array_flip(explode(',', $config['exceptuuid']));
|
||||
$exceptgroup = array_flip(explode(',', $config['exceptgroup']));
|
||||
$exceptcid = array_flip(explode(',', $config['exceptcid']));
|
||||
$timeformat = $config['dateformat'];
|
||||
$showexcld = $config['showexcld'];
|
||||
$showhighest = $config['showhighest'];
|
||||
$showcolrg = $config['showcolrg'];
|
||||
$showcolcld = $config['showcolcld'];
|
||||
$showcoluuid = $config['showcoluuid'];
|
||||
$showcoldbid = $config['showcoldbid'];
|
||||
$showcolls = $config['showcolls'];
|
||||
$showcolot = $config['showcolot'];
|
||||
$showcolit = $config['showcolit'];
|
||||
$showcolat = $config['showcolat'];
|
||||
$showcolas = $config['showcolas'];
|
||||
$showcolnx = $config['showcolnx'];
|
||||
$showcolsg = $config['showcolsg'];
|
||||
$cleanclients = $config['cleanclients'];
|
||||
$cleanperiod = $config['cleanperiod'];
|
||||
$defchid = $config['defchid'];
|
||||
$logpath = $config['logpath'];
|
||||
if ($config['timezone'] == NULL) {
|
||||
$timezone = "Europe/Berlin";
|
||||
} else {
|
||||
$timezone = $config['timezone'];
|
||||
}
|
||||
date_default_timezone_set($timezone);
|
||||
$advancemode = $config['advancemode'];
|
||||
$count_access = $config['count_access'];
|
||||
$last_access = $config['last_access'];
|
||||
$ignoreidle = $config['ignoreidle'];
|
||||
$rankupmsg = $config['rankupmsg'];
|
||||
$newversion = $config['newversion'];
|
||||
$servernews = $config['servernews'];
|
||||
if(empty($config['adminuuid'])) {
|
||||
$adminuuid = NULL;
|
||||
} else {
|
||||
$adminuuid = explode(',', $config['adminuuid']);
|
||||
}
|
||||
$nextupinfo = $config['nextupinfo'];
|
||||
$nextupinfomsg1 = $config['nextupinfomsg1'];
|
||||
$nextupinfomsg2 = $config['nextupinfomsg2'];
|
||||
$nextupinfomsg3 = $config['nextupinfomsg3'];
|
||||
$shownav = $config['shownav'];
|
||||
$showgrpsince = $config['showgrpsince'];
|
||||
$resetexcept = $config['resetexcept'];
|
||||
$upchannel = $config['upchannel'];
|
||||
$avatar_delay = $config['avatar_delay'];
|
||||
$registercid = $config['registercid'];
|
||||
}
|
||||
}
|
||||
if(!isset($language) || $language == "en") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_en.php');
|
||||
} elseif($language == "ar") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_ar.php');
|
||||
} elseif($language == "cz") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_cz.php');
|
||||
} elseif($language == "de") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_de.php');
|
||||
} elseif($language == "fr") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_fr.php');
|
||||
} elseif($language == "it") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_it.php');
|
||||
} elseif($language == "nl") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_nl.php');
|
||||
} elseif($language == "ro") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_ro.php');
|
||||
} elseif($language == "ru") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_ru.php');
|
||||
} elseif($language == "pt") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_pt.php');
|
||||
} elseif($language == "pl") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_pl.php');
|
||||
}
|
||||
<?PHP
|
||||
require_once('dbconfig.php');
|
||||
if(isset($db['type']) === false) {
|
||||
$db['type']="mysql";
|
||||
}
|
||||
$dbname = $db['dbname'];
|
||||
$dbtype = $db['type'];
|
||||
if($db['type'] != "type") {
|
||||
$dbserver = $db['type'].':host='.$db['host'].';dbname='.$dbname.';charset=utf8mb4';
|
||||
if ($db['type'] == 'mysql') {
|
||||
$dboptions = array(
|
||||
PDO::ATTR_PERSISTENT => true
|
||||
);
|
||||
} else {
|
||||
$dboptions = array();
|
||||
}
|
||||
try {
|
||||
$mysqlcon = new PDO($dbserver, $db['user'], $db['pass'], $dboptions);
|
||||
} catch (PDOException $e) {
|
||||
echo "Database Connection failed: ".$e->getMessage()."\n"; $err_lvl = 3;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$rspathhex = 'rs_'.dechex(crc32(__DIR__)).'_';
|
||||
function rem_session_ts3($rspathhex) {
|
||||
unset($_SESSION[$rspathhex.'admin']);
|
||||
unset($_SESSION[$rspathhex.'clientip']);
|
||||
unset($_SESSION[$rspathhex.'connected']);
|
||||
unset($_SESSION[$rspathhex.'csrf_token']);
|
||||
unset($_SESSION[$rspathhex.'inactivefilter']);
|
||||
unset($_SESSION[$rspathhex.'language']);
|
||||
unset($_SESSION[$rspathhex.'logfilter']);
|
||||
unset($_SESSION[$rspathhex.'logfilter2']);
|
||||
unset($_SESSION[$rspathhex.'multiple']);
|
||||
unset($_SESSION[$rspathhex.'newversion']);
|
||||
unset($_SESSION[$rspathhex.'number_lines']);
|
||||
unset($_SESSION[$rspathhex.'password']);
|
||||
unset($_SESSION[$rspathhex.'serverport']);
|
||||
unset($_SESSION[$rspathhex.'temp_cldbid']);
|
||||
unset($_SESSION[$rspathhex.'temp_name']);
|
||||
unset($_SESSION[$rspathhex.'temp_uuid']);
|
||||
unset($_SESSION[$rspathhex.'token']);
|
||||
unset($_SESSION[$rspathhex.'tsavatar']);
|
||||
unset($_SESSION[$rspathhex.'tscldbid']);
|
||||
unset($_SESSION[$rspathhex.'tsconnections']);
|
||||
unset($_SESSION[$rspathhex.'tscreated']);
|
||||
unset($_SESSION[$rspathhex.'tsname']);
|
||||
unset($_SESSION[$rspathhex.'tsuid']);
|
||||
unset($_SESSION[$rspathhex.'upinfomsg']);
|
||||
unset($_SESSION[$rspathhex.'username']);
|
||||
unset($_SESSION[$rspathhex.'uuid_verified']);
|
||||
}
|
||||
|
||||
if (isset($mysqlcon) && ($config = $mysqlcon->query("SELECT * FROM `$dbname`.`config`")->fetch())) {
|
||||
if(count($config) != 0) {
|
||||
$ts['host'] = $config['tshost'];
|
||||
$ts['query'] = $config['tsquery'];
|
||||
$ts['voice'] = $config['tsvoice'];
|
||||
$ts['user'] = $config['tsuser'];
|
||||
$ts['pass'] = $config['tspass'];
|
||||
$webuser = $config['webuser'];
|
||||
$webpass = $config['webpass'];
|
||||
if(!isset($_GET["lang"])) {
|
||||
if(isset($_SESSION[$rspathhex.'language'])) {
|
||||
$language = $_SESSION[$rspathhex.'language'];
|
||||
} else {
|
||||
$language = $config['language'];
|
||||
}
|
||||
} elseif($_GET["lang"] == "ar") {
|
||||
$language = "ar";
|
||||
$_SESSION[$rspathhex.'language'] = "ar";
|
||||
} elseif($_GET["lang"] == "cz") {
|
||||
$language = "cz";
|
||||
$_SESSION[$rspathhex.'language'] = "cz";
|
||||
} elseif($_GET["lang"] == "de") {
|
||||
$language = "de";
|
||||
$_SESSION[$rspathhex.'language'] = "de";
|
||||
} elseif($_GET["lang"] == "fr") {
|
||||
$language = "fr";
|
||||
$_SESSION[$rspathhex.'language'] = "fr";
|
||||
} elseif($_GET["lang"] == "it") {
|
||||
$language = "it";
|
||||
$_SESSION[$rspathhex.'language'] = "it";
|
||||
} elseif($_GET["lang"] == "nl") {
|
||||
$language = "nl";
|
||||
$_SESSION[$rspathhex.'language'] = "nl";
|
||||
} elseif($_GET["lang"] == "pl") {
|
||||
$language = "pl";
|
||||
$_SESSION[$rspathhex.'language'] = "pl";
|
||||
} elseif($_GET["lang"] == "ro") {
|
||||
$language = "ro";
|
||||
$_SESSION[$rspathhex.'language'] = "ro";
|
||||
} elseif($_GET["lang"] == "ru") {
|
||||
$language = "ru";
|
||||
$_SESSION[$rspathhex.'language'] = "ru";
|
||||
} elseif($_GET["lang"] == "pt") {
|
||||
$language = "pt";
|
||||
$_SESSION[$rspathhex.'language'] = "pt";
|
||||
} else {
|
||||
$language = "en";
|
||||
$_SESSION[$rspathhex.'language'] = "en";
|
||||
}
|
||||
$queryname = $config['queryname'];
|
||||
$queryname2 = $config['queryname2'];
|
||||
$slowmode = $config['slowmode'];
|
||||
if(empty($config['grouptime'])) {
|
||||
$grouptime = null;
|
||||
} else {
|
||||
$grouptimearr = explode(',', $config['grouptime']);
|
||||
foreach ($grouptimearr as $entry) {
|
||||
list($key, $value) = explode('=>', $entry);
|
||||
$grouptime[$key] = $value;
|
||||
}
|
||||
}
|
||||
if(empty($config['boost'])) {
|
||||
$boostarr = null;
|
||||
} else {
|
||||
$boostexp = explode(',', $config['boost']);
|
||||
foreach ($boostexp as $entry) {
|
||||
list($key, $value1, $value2) = explode('=>', $entry);
|
||||
$boostarr[$key] = array("group"=>$key,"factor"=>$value1,"time"=>$value2);
|
||||
}
|
||||
}
|
||||
$resetbydbchange = $config['resetbydbchange'];
|
||||
$msgtouser = $config['msgtouser'];
|
||||
$currvers = $config['currvers'];
|
||||
$substridle = $config['substridle'];
|
||||
$exceptuuid = array_flip(explode(',', $config['exceptuuid']));
|
||||
$exceptgroup = array_flip(explode(',', $config['exceptgroup']));
|
||||
$exceptcid = array_flip(explode(',', $config['exceptcid']));
|
||||
$timeformat = $config['dateformat'];
|
||||
$showexcld = $config['showexcld'];
|
||||
$showhighest = $config['showhighest'];
|
||||
$showcolrg = $config['showcolrg'];
|
||||
$showcolcld = $config['showcolcld'];
|
||||
$showcoluuid = $config['showcoluuid'];
|
||||
$showcoldbid = $config['showcoldbid'];
|
||||
$showcolls = $config['showcolls'];
|
||||
$showcolot = $config['showcolot'];
|
||||
$showcolit = $config['showcolit'];
|
||||
$showcolat = $config['showcolat'];
|
||||
$showcolas = $config['showcolas'];
|
||||
$showcolnx = $config['showcolnx'];
|
||||
$showcolsg = $config['showcolsg'];
|
||||
$cleanclients = $config['cleanclients'];
|
||||
$cleanperiod = $config['cleanperiod'];
|
||||
$defchid = $config['defchid'];
|
||||
$logpath = $config['logpath'];
|
||||
if ($config['timezone'] == NULL) {
|
||||
$timezone = "Europe/Berlin";
|
||||
} else {
|
||||
$timezone = $config['timezone'];
|
||||
}
|
||||
date_default_timezone_set($timezone);
|
||||
$advancemode = $config['advancemode'];
|
||||
$count_access = $config['count_access'];
|
||||
$last_access = $config['last_access'];
|
||||
$ignoreidle = $config['ignoreidle'];
|
||||
$rankupmsg = $config['rankupmsg'];
|
||||
$newversion = $config['newversion'];
|
||||
$servernews = $config['servernews'];
|
||||
if(empty($config['adminuuid'])) {
|
||||
$adminuuid = NULL;
|
||||
} else {
|
||||
$adminuuid = explode(',', $config['adminuuid']);
|
||||
}
|
||||
$nextupinfo = $config['nextupinfo'];
|
||||
$nextupinfomsg1 = $config['nextupinfomsg1'];
|
||||
$nextupinfomsg2 = $config['nextupinfomsg2'];
|
||||
$nextupinfomsg3 = $config['nextupinfomsg3'];
|
||||
$shownav = $config['shownav'];
|
||||
$showgrpsince = $config['showgrpsince'];
|
||||
$resetexcept = $config['resetexcept'];
|
||||
$upchannel = $config['upchannel'];
|
||||
$avatar_delay = $config['avatar_delay'];
|
||||
$registercid = $config['registercid'];
|
||||
$iphash = $config['iphash'];
|
||||
}
|
||||
}
|
||||
if(!isset($language) || $language == "en") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_en.php');
|
||||
} elseif($language == "ar") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_ar.php');
|
||||
} elseif($language == "cz") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_cz.php');
|
||||
} elseif($language == "de") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_de.php');
|
||||
} elseif($language == "fr") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_fr.php');
|
||||
} elseif($language == "it") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_it.php');
|
||||
} elseif($language == "nl") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_nl.php');
|
||||
} elseif($language == "pl") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_pl.php');
|
||||
} elseif($language == "ro") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_ro.php');
|
||||
} elseif($language == "ru") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_ru.php');
|
||||
} elseif($language == "pt") {
|
||||
require_once(substr(dirname(__FILE__),0,-5).'languages/core_pt.php');
|
||||
}
|
||||
?>
|
||||
@@ -1,14 +1,14 @@
|
||||
<?PHP
|
||||
function load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath) {
|
||||
if(!isset($mysqlcon) || $mysqlcon == NULL || ($addons_config = $mysqlcon->query("SELECT * FROM $dbname.addons_config")) === false) {
|
||||
if(function_exists('enter_logfile')) {
|
||||
enter_logfile($logpath,$timezone,2,"Error on loading addons config.. Database down, not reachable, corrupt or empty?");
|
||||
} else {
|
||||
echo "Error on loading addons config.. Database down, not reachable, corrupt or empty?";
|
||||
}
|
||||
} else {
|
||||
return $addons_config->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
}
|
||||
//$addons_config['assign_groups_groupids']['value'];
|
||||
}
|
||||
<?PHP
|
||||
function load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath) {
|
||||
if(!isset($mysqlcon) || $mysqlcon == NULL || ($addons_config = $mysqlcon->query("SELECT * FROM `$dbname`.`addons_config`")) === false) {
|
||||
if(function_exists('enter_logfile')) {
|
||||
enter_logfile($logpath,$timezone,2,"Error on loading addons config.. Database down, not reachable, corrupt or empty?");
|
||||
} else {
|
||||
echo "Error on loading addons config.. Database down, not reachable, corrupt or empty?";
|
||||
}
|
||||
} else {
|
||||
return $addons_config->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
}
|
||||
//$addons_config['assign_groups_groupids']['value'];
|
||||
}
|
||||
?>
|
||||
@@ -1,15 +1,15 @@
|
||||
<?PHP
|
||||
## Uncomment the command you need to run PHP
|
||||
## This are only examples
|
||||
## If you miss one, feel free to add it
|
||||
## Only one command should be active at the same time!
|
||||
$phpcommand = "php";
|
||||
#$phpcommand = "php56";
|
||||
#$phpcommand = "php70";
|
||||
#$phpcommand = "/usr/bin/php5";
|
||||
#$phpcommand = "/usr/bin/php";
|
||||
#$phpcommand = "C:\PHP5\php.exe";
|
||||
#$phpcommand = "C:\PHP7\php.exe";
|
||||
#$phpcommand = "\"C:\Program Files (x86)\PHP\php.exe\""; // on blanks you need special marks \"
|
||||
#$phpcommand = "c:\wamp\bin\php\php.exe";
|
||||
<?PHP
|
||||
## Uncomment the command you need to run PHP
|
||||
## This are only examples
|
||||
## If you miss one, feel free to add it
|
||||
## Only one command should be active at the same time!
|
||||
$phpcommand = "php";
|
||||
#$phpcommand = "php56";
|
||||
#$phpcommand = "php70";
|
||||
#$phpcommand = "/usr/bin/php5";
|
||||
#$phpcommand = "/usr/bin/php7.2";
|
||||
#$phpcommand = "C:\PHP5\php.exe";
|
||||
#$phpcommand = "C:\PHP7\php.exe";
|
||||
#$phpcommand = "\"C:\Program Files (x86)\PHP\php.exe\""; // on blanks you need special marks \"
|
||||
#$phpcommand = "c:\wamp\bin\php\php.exe";
|
||||
?>
|
||||
@@ -1,76 +1,89 @@
|
||||
<?PHP
|
||||
if (isset($_POST['refresh'])) {
|
||||
$rspathhex = 'rs_'.dechex(crc32(__DIR__)).'_';
|
||||
rem_session_ts3($rspathhex);
|
||||
}
|
||||
function set_session_ts3($voiceport, $mysqlcon, $dbname, $language, $adminuuid) {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
$hpclientip = $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
$hpclientip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
$hpclientip = $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
$hpclientip = $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
$hpclientip = $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
$hpclientip = $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
$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[$rspathhex.'connected'] = 0;
|
||||
$_SESSION[$rspathhex.'tsname'] = "verification needed!";
|
||||
$_SESSION[$rspathhex.'serverport'] = $voiceport;
|
||||
foreach ($allclients as $client) {
|
||||
if ($hpclientip == $client['ip']) {
|
||||
if(isset($_SESSION[$rspathhex.'uuid_verified']) && $_SESSION[$rspathhex.'uuid_verified'] != $client['uuid']) {
|
||||
continue;
|
||||
}
|
||||
$_SESSION[$rspathhex.'tsname'] = htmlspecialchars($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[$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[$rspathhex.'tscreated'] = "unkown";
|
||||
} else {
|
||||
$_SESSION[$rspathhex.'tscreated'] = date('d-m-Y', $client['firstcon']);
|
||||
}
|
||||
if ($client['total_connections'] != NULL) {
|
||||
$_SESSION[$rspathhex.'tsconnections'] = $client['total_connections'];
|
||||
} else {
|
||||
$_SESSION[$rspathhex.'tsconnections'] = 0;
|
||||
}
|
||||
$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[$rspathhex.'tsuid']), $i, 1));
|
||||
$uuidasbase16 .= $convert[($char & 0xF0) >> 4];
|
||||
$uuidasbase16 .= $convert[$char & 0x0F];
|
||||
}
|
||||
if (is_file('../avatars/' . $uuidasbase16 . '.png')) {
|
||||
$_SESSION[$rspathhex.'tsavatar'] = $uuidasbase16 . '.png';
|
||||
} else {
|
||||
$_SESSION[$rspathhex.'tsavatar'] = "none";
|
||||
}
|
||||
$_SESSION[$rspathhex.'connected'] = 1;
|
||||
$_SESSION[$rspathhex.'language'] = $language;
|
||||
}
|
||||
}
|
||||
}
|
||||
<?PHP
|
||||
if (isset($_POST['refresh'])) {
|
||||
$rspathhex = 'rs_'.dechex(crc32(__DIR__)).'_';
|
||||
rem_session_ts3($rspathhex);
|
||||
}
|
||||
function set_session_ts3($voiceport, $mysqlcon, $dbname, $language, $adminuuid) {
|
||||
global $iphash;
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
$hpclientip = $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
$hpclientip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
$hpclientip = $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
$hpclientip = $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
$hpclientip = $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
$hpclientip = $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
$hpclientip = 0;
|
||||
|
||||
$rspathhex = 'rs_'.dechex(crc32(__DIR__)).'_';
|
||||
|
||||
$allclients = $mysqlcon->query("SELECT `u`.`uuid`,`u`.`cldbid`,`u`.`name`,`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();
|
||||
$iptable = $mysqlcon->query("SELECT `uuid`,`iphash`,`ip` FROM `$dbname`.`user_iphash`")->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE);
|
||||
$_SESSION[$rspathhex.'connected'] = 0;
|
||||
$_SESSION[$rspathhex.'tsname'] = "verification needed!";
|
||||
$_SESSION[$rspathhex.'serverport'] = $voiceport;
|
||||
$_SESSION[$rspathhex.'csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
|
||||
foreach ($allclients as $client) {
|
||||
if(isset($_SESSION[$rspathhex.'uuid_verified']) && $_SESSION[$rspathhex.'uuid_verified'] != $client['uuid']) {
|
||||
continue;
|
||||
}
|
||||
$verify = FALSE;
|
||||
if($iphash == 1) {
|
||||
if (isset($iptable[$client['uuid']]['iphash']) && password_verify($hpclientip, $iptable[$client['uuid']]['iphash'])) {
|
||||
$verify = TRUE;
|
||||
}
|
||||
} else {
|
||||
if (isset($iptable[$client['uuid']]['ip']) && $hpclientip == $iptable[$client['uuid']]['ip']) {
|
||||
$verify = TRUE;
|
||||
}
|
||||
}
|
||||
if ($verify == TRUE) {
|
||||
$_SESSION[$rspathhex.'tsname'] = htmlspecialchars($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 (multiple)!";
|
||||
unset($_SESSION[$rspathhex.'admin']);
|
||||
} elseif (!isset($_SESSION[$rspathhex.'tsuid'])) {
|
||||
$_SESSION[$rspathhex.'multiple'] = htmlspecialchars($client['uuid']).'=>'.htmlspecialchars($client['name']).',';
|
||||
}
|
||||
$_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[$rspathhex.'tscreated'] = "unkown";
|
||||
} else {
|
||||
$_SESSION[$rspathhex.'tscreated'] = date('d-m-Y', $client['firstcon']);
|
||||
}
|
||||
if ($client['total_connections'] != NULL) {
|
||||
$_SESSION[$rspathhex.'tsconnections'] = $client['total_connections'];
|
||||
} else {
|
||||
$_SESSION[$rspathhex.'tsconnections'] = 0;
|
||||
}
|
||||
$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[$rspathhex.'tsuid']), $i, 1));
|
||||
$uuidasbase16 .= $convert[($char & 0xF0) >> 4];
|
||||
$uuidasbase16 .= $convert[$char & 0x0F];
|
||||
}
|
||||
if (is_file('../avatars/' . $uuidasbase16 . '.png')) {
|
||||
$_SESSION[$rspathhex.'tsavatar'] = $uuidasbase16 . '.png';
|
||||
} else {
|
||||
$_SESSION[$rspathhex.'tsavatar'] = "none";
|
||||
}
|
||||
$_SESSION[$rspathhex.'connected'] = 1;
|
||||
$_SESSION[$rspathhex.'language'] = $language;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user