release 1.2.2
This commit is contained in:
146
stats/assign_groups.php
Normal file
146
stats/assign_groups.php
Normal file
@@ -0,0 +1,146 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
if($addons_config['assign_groups_active']['value'] != '1') {
|
||||
echo "addon is disabled";
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!isset($_SESSION['tsuid']) || isset($_SESSION['uuid_verified'])) {
|
||||
set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid);
|
||||
}
|
||||
|
||||
$uuid = $_SESSION['tsuid'];
|
||||
$dbdata = $mysqlcon->query("SELECT * FROM $dbname.user WHERE uuid='$uuid'");
|
||||
$dbdata_fetched = $dbdata->fetchAll();
|
||||
$cld_groups = explode(',', $dbdata_fetched[0]['cldgroup']);
|
||||
$multiple_uuid = explode(',', substr($_SESSION['multiple'], 0, -1));
|
||||
$disabled = '';
|
||||
$allowed_groups_arr = array();
|
||||
|
||||
if(count($multiple_uuid) > 1 and !isset($_SESSION['uuid_verified'])) {
|
||||
$disabled = 1;
|
||||
$err_msg = sprintf($lang['stag0006'], '<a href="verify.php">', '</a>'); $err_lvl = 3;
|
||||
} else {
|
||||
$dbgroups = $mysqlcon->query("SELECT * FROM $dbname.groups");
|
||||
$servergroups = $dbgroups->fetchAll(PDO::FETCH_ASSOC);
|
||||
foreach($servergroups as $servergroup) {
|
||||
$sqlhisgroup[$servergroup['sgid']] = $servergroup['sgidname'];
|
||||
if(file_exists('../icons/'.$servergroup['sgid'].'.png')) {
|
||||
$sqlhisgroup_file[$servergroup['sgid']] = true;
|
||||
} else {
|
||||
$sqlhisgroup_file[$servergroup['sgid']] = false;
|
||||
}
|
||||
}
|
||||
|
||||
$allowed_groups_arr = explode(',', $addons_config['assign_groups_groupids']['value']);
|
||||
|
||||
if(isset($_POST['update'])) {
|
||||
if(($sumentries = $mysqlcon->query("SELECT COUNT(*) FROM $dbname.addon_assign_groups WHERE uuid='$uuid'")->fetch(PDO::FETCH_NUM)) === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
} else {
|
||||
if($sumentries[0] > 0) {
|
||||
$err_msg = $lang['stag0007']; $err_lvl = 3;
|
||||
} else {
|
||||
$set_groups = '';
|
||||
$count_limit = 0;
|
||||
foreach($allowed_groups_arr as $allowed_group) {
|
||||
if(in_array($allowed_group, $cld_groups)) {
|
||||
$count_limit++;
|
||||
}
|
||||
if(isset($_POST[$allowed_group]) && $_POST[$allowed_group] == 1 && !in_array($allowed_group, $cld_groups)) {
|
||||
$set_groups .= $allowed_group.',';
|
||||
array_push($cld_groups, $allowed_group);
|
||||
$count_limit++;
|
||||
}
|
||||
if(!isset($_POST[$allowed_group]) && in_array($allowed_group, $cld_groups)) {
|
||||
$set_groups .= '-'.$allowed_group.',';
|
||||
$position = array_search($allowed_group, $cld_groups);
|
||||
array_splice($cld_groups, $position, 1);
|
||||
$count_limit--;
|
||||
}
|
||||
}
|
||||
$set_groups = substr($set_groups, 0, -1);
|
||||
if($set_groups != '' && $count_limit <= $addons_config['assign_groups_limit']['value']) {
|
||||
if ($mysqlcon->exec("INSERT INTO $dbname.addon_assign_groups SET uuid='$uuid', grpids='$set_groups'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['stag0008']; $err_lvl = NULL;
|
||||
}
|
||||
} elseif($count_limit > $addons_config['assign_groups_limit']['value']) {
|
||||
$err_msg = sprintf($lang['stag0009'], $addons_config['assign_groups_limit']['value']); $err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['stag0010']; $err_lvl = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?PHP echo $lang['stag0001']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" name="update" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<p class="text-right"><strong><?PHP echo $lang['stag0011'].$addons_config['assign_groups_limit']['value']; ?></strong></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<?PHP foreach($allowed_groups_arr as $allowed_group) { ?>
|
||||
<div class="form-group">
|
||||
<?PHP if (isset($sqlhisgroup_file[$allowed_group]) && $sqlhisgroup_file[$allowed_group]===true) { ?>
|
||||
<label class="col-sm-5 control-label"><?php echo $sqlhisgroup[$allowed_group]; ?></label>
|
||||
<label class="col-sm-1 control-label"><img src="../icons/<?PHP echo $allowed_group; ?>.png" alt="groupicon"></label>
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<?PHP } else { ?>
|
||||
<label class="col-sm-5 control-label"><?php echo $sqlhisgroup[$allowed_group]; ?></label>
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<?PHP } ?>
|
||||
<div class="col-sm-2">
|
||||
<?PHP if(in_array($allowed_group, $cld_groups)) {
|
||||
echo '<input id="switch-animate" type="checkbox" checked data-size="mini" name="',$allowed_group,'" value="',$msgtouser,'">';
|
||||
} else {
|
||||
echo '<input id="switch-animate" type="checkbox" data-size="mini" name="',$allowed_group,'" value="',$msgtouser,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<?PHP } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" name="update" class="btn btn-primary"<?PHP if($disabled == 1) echo " disabled"; ?>><?PHP echo $lang['stag0012']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,6 +2,9 @@
|
||||
session_start();
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if($language == "ar") {
|
||||
require_once('../languages/nations_en.php');
|
||||
@@ -9,6 +12,8 @@ if($language == "ar") {
|
||||
require_once('../languages/nations_de.php');
|
||||
} elseif($language == "en") {
|
||||
require_once('../languages/nations_en.php');
|
||||
} elseif($language == "fr") {
|
||||
require_once('../languages/nations_fr.php');
|
||||
} elseif($language == "it") {
|
||||
require_once('../languages/nations_it.php');
|
||||
} elseif($language == "ro") {
|
||||
@@ -274,13 +279,13 @@ require_once('nav.php');
|
||||
</div>
|
||||
<div class="col-xs-9 text-right">
|
||||
<div class="huge"><?PHP echo $sql_res[0]['user_week']; ?></div>
|
||||
<div><?PHP echo $lang['stix0060'],' ',$lang['stix0056']; ?></div>
|
||||
<div><?PHP echo $lang['stix0060'],' ',sprintf($lang['stix0056'], '7'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="list_rankup.php?sort=lastseen&order=desc&search=filter:lastseen:>:<?PHP echo time()-604800; ?>:">
|
||||
<div class="panel-footer">
|
||||
<span class="pull-left"><?PHP echo $lang['stix0059'],' (',$lang['stix0056'],')'; ?></span>
|
||||
<span class="pull-left"><?PHP echo $lang['stix0059'],' (',sprintf($lang['stix0056'], '7'),')'; ?></span>
|
||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
@@ -296,13 +301,13 @@ require_once('nav.php');
|
||||
</div>
|
||||
<div class="col-xs-9 text-right">
|
||||
<div class="huge"><?PHP echo $sql_res[0]['user_month']; ?></div>
|
||||
<div><?PHP echo $lang['stix0060'],' ',$lang['stix0057']; ?></div>
|
||||
<div><?PHP echo $lang['stix0060'],' ',sprintf($lang['stix0056'], '30'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="list_rankup.php?sort=lastseen&order=desc&search=filter:lastseen:>:<?PHP echo time()-2592000; ?>:">
|
||||
<div class="panel-footer">
|
||||
<span class="pull-left"><?PHP echo $lang['stix0059'],' (',$lang['stix0057'],')'; ?></span>
|
||||
<span class="pull-left"><?PHP echo $lang['stix0059'],' (',sprintf($lang['stix0056'], '30'),')'; ?></span>
|
||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
@@ -318,13 +323,13 @@ require_once('nav.php');
|
||||
</div>
|
||||
<div class="col-xs-9 text-right">
|
||||
<div class="huge"><?PHP echo $sql_res[0]['user_quarter']; ?></div>
|
||||
<div><?PHP echo $lang['stix0060'],' ',$lang['stix0058']; ?></div>
|
||||
<div><?PHP echo $lang['stix0060'],' ',sprintf($lang['stix0056'], '90'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="list_rankup.php?sort=lastseen&order=desc&search=filter:lastseen:>:<?PHP echo time()-7776000; ?>:">
|
||||
<div class="panel-footer">
|
||||
<span class="pull-left"><?PHP echo $lang['stix0059'],' (',$lang['stix0058'],')'; ?></span>
|
||||
<span class="pull-left"><?PHP echo $lang['stix0059'],' (',sprintf($lang['stix0056'], '90'),')'; ?></span>
|
||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
@@ -381,7 +386,10 @@ require_once('nav.php');
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?PHP echo $lang['stix0036']; ?></td>
|
||||
<td><?PHP if(file_exists("../icons/servericon.png")) { echo $sql_res[0]['server_name'] .'<div class="pull-right"><img src="../icons/servericon.png" alt="servericon"></div>'; } else { echo $sql_res[0]['server_name']; } ?></td>
|
||||
<td><?PHP if(file_exists("../icons/servericon.png")) {
|
||||
$img_content = file_get_contents("../icons/servericon.png");
|
||||
echo $sql_res[0]['server_name'] .'<div class="pull-right"><img src="data:image/',mime_content_type("../icons/servericon.png"),';base64,'.base64_encode($img_content).'" alt="servericon"></div>';
|
||||
} else { echo $sql_res[0]['server_name']; } ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?PHP echo $lang['stix0037']; ?></td>
|
||||
|
||||
@@ -4,6 +4,9 @@ $starttime = microtime(true);
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if(!isset($_SESSION['tsuid'])) {
|
||||
set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid);
|
||||
@@ -30,7 +33,7 @@ require_once('nav.php');
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h4><strong><span class="text-success"><?PHP echo $lang['stri0004']; ?></span></strong></h4>
|
||||
<p>The <a href="//ts-n.net/ranksystem.php" target="_blank">Ranksystem</a> was coded by <strong>Newcomer1989</strong> Copyright © 2009-2016 <a href="//ts-n.net/" target="_blank">TeamSpeak Sponsoring TS-N.NET</a>. All rights reserved.</p>
|
||||
<p>The <a href="//ts-n.net/ranksystem.php" target="_blank">Ranksystem</a> was coded by <strong>Newcomer1989</strong> Copyright © 2009-2017 <a href="//ts-n.net/" target="_blank">TeamSpeak Sponsoring TS-N.NET</a></p>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
@@ -73,6 +76,7 @@ require_once('nav.php');
|
||||
<p><?PHP echo $lang['stri0016']; ?></p>
|
||||
<p><?PHP echo $lang['stri0017']; ?></p>
|
||||
<p><?PHP echo $lang['stri0018']; ?></p>
|
||||
<p><?PHP echo $lang['stri0019']; ?></p>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,9 @@ $starttime = microtime(true);
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
session_start();
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
if(!isset($_SESSION['tsuid'])) {
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if(!isset($_SESSION['tsuid']) || isset($_SESSION['uuid_verified'])) {
|
||||
set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid);
|
||||
}
|
||||
|
||||
@@ -21,9 +24,11 @@ if ($substridle == 1) {
|
||||
} else {
|
||||
$activetime = $dbdata_fetched[0]['count'];
|
||||
}
|
||||
$active_count = $dbdata_fetched[0]['count'] - $dbdata_fetched[0]['idle'];
|
||||
|
||||
krsort($grouptime);
|
||||
$grpcount = 0;
|
||||
$nextgrp = '';
|
||||
|
||||
foreach ($grouptime as $time => $groupid) {
|
||||
$grpcount++;
|
||||
@@ -51,10 +56,15 @@ $stats_user = $stats_user->fetchAll();
|
||||
|
||||
if (isset($stats_user[0]['count_week'])) $count_week = $stats_user[0]['count_week']; else $count_week = 0;
|
||||
$dtF = new DateTime("@0"); $dtT = new DateTime("@$count_week"); $count_week = $dtF->diff($dtT)->format($timeformat);
|
||||
if (isset($stats_user[0]['active_week'])) $active_week = $stats_user[0]['active_week']; else $active_week = 0;
|
||||
$dtF = new DateTime("@0"); $dtT = new DateTime("@$active_week"); $active_week = $dtF->diff($dtT)->format($timeformat);
|
||||
if (isset($stats_user[0]['count_month'])) $count_month = $stats_user[0]['count_month']; else $count_month = 0;
|
||||
$dtF = new DateTime("@0"); $dtT = new DateTime("@$count_month"); $count_month = $dtF->diff($dtT)->format($timeformat);
|
||||
if (isset($stats_user[0]['active_month'])) $active_month = $stats_user[0]['active_month']; else $active_month = 0;
|
||||
$dtF = new DateTime("@0"); $dtT = new DateTime("@$active_month"); $active_month = $dtF->diff($dtT)->format($timeformat);
|
||||
if (isset($dbdata_fetched[0]['count'])) $count_total = $dbdata_fetched[0]['count']; else $count_total = 0;
|
||||
$dtF = new DateTime("@0"); $dtT = new DateTime("@$count_total"); $count_total = $dtF->diff($dtT)->format($timeformat);
|
||||
$dtF = new DateTime("@0"); $dtT = new DateTime("@$active_count"); $active_count = $dtF->diff($dtT)->format($timeformat);
|
||||
|
||||
$time_for_bronze = 50;
|
||||
$time_for_silver = 100;
|
||||
@@ -136,8 +146,11 @@ require_once('nav.php');
|
||||
<p><strong><?PHP echo $lang['stmy0005']; ?></strong></p>
|
||||
<p><strong><?PHP echo $lang['stmy0006']; ?></strong></p>
|
||||
<p><strong><?PHP echo $lang['stmy0007']; ?></strong></p>
|
||||
<p><strong><?PHP echo $lang['stmy0008']; ?></strong></p>
|
||||
<p><strong><?PHP echo $lang['stmy0009']; ?></strong></p>
|
||||
<p><strong><?PHP echo $lang['stmy0031']; ?></strong></p>
|
||||
<p><strong><?PHP echo sprintf($lang['stmy0008'], '7'); ?></strong></p>
|
||||
<p><strong><?PHP echo sprintf($lang['stmy0009'], '7'); ?></strong></p>
|
||||
<p><strong><?PHP echo sprintf($lang['stmy0008'], '30'); ?></strong></p>
|
||||
<p><strong><?PHP echo sprintf($lang['stmy0009'], '30'); ?></strong></p>
|
||||
<p><strong><?PHP echo $lang['stmy0010']; ?></strong></p>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
@@ -146,8 +159,11 @@ require_once('nav.php');
|
||||
<p class="text-right"><?PHP echo $_SESSION['tsconnections']; ?></p>
|
||||
<p class="text-right"><?PHP echo $_SESSION['tscreated']; ?></p>
|
||||
<p class="text-right"><?PHP echo $count_total; ?></p>
|
||||
<p class="text-right"><?PHP echo $active_count; ?></p>
|
||||
<p class="text-right"><?PHP echo $count_week; ?></p>
|
||||
<p class="text-right"><?PHP echo $active_week; ?></p>
|
||||
<p class="text-right"><?PHP echo $count_month; ?></p>
|
||||
<p class="text-right"><?PHP echo $active_month; ?></p>
|
||||
<p class="text-right"><?PHP echo $achievements_done .' / 8'; ?></p>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
session_start();
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if($language == "ar") {
|
||||
require_once('../languages/nations_en.php');
|
||||
|
||||
@@ -7,16 +7,8 @@
|
||||
<meta name="version" content="<?PHP echo $currvers; ?>">
|
||||
<link rel="icon" href="../icons/rs.png">
|
||||
<title>TS-N.NET Ranksystem</title>
|
||||
<link href="../libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="../libs/bootstrap/addons/sb-admin.css" rel="stylesheet">
|
||||
<link href="../libs/bootstrap/addons/morris/morris.css" rel="stylesheet">
|
||||
<link href="../libs/bootstrap/addons/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="../libs/bootstrap/flag_icon/css/flag-icon.min.css" rel="stylesheet">
|
||||
<link href="../libs/bootstrap/css/custom.css" rel="stylesheet">
|
||||
<script src="../libs/jquery/jquery.min.js"></script>
|
||||
<script src="../libs/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="../libs/bootstrap/addons/morris/raphael.min.js"></script>
|
||||
<script src="../libs/bootstrap/addons/morris/morris.min.js"></script>
|
||||
<link href="../libs/combined_stats.css?v=<?PHP echo $currvers; ?>" rel="stylesheet">
|
||||
<script src="../libs/combined_stats.js?v=<?PHP echo $currvers; ?>"></script>
|
||||
<?PHP
|
||||
if(isset($shownav) && $shownav == 0) { ?>
|
||||
<style>
|
||||
@@ -254,6 +246,9 @@
|
||||
<li>
|
||||
<a href="?lang=en"><span class="flag-icon flag-icon-gb"></span> EN - english</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=fr"><span class="flag-icon flag-icon-fr"></span> FR - français</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=it"><span class="flag-icon flag-icon-it"></span> IT - italiano</a>
|
||||
</li>
|
||||
@@ -281,6 +276,16 @@
|
||||
echo '<a href="my_stats.php"><i class="fa fa-fw fa-bar-chart-o"></i> ',$lang['stmy0001'],'</a>';
|
||||
}?>
|
||||
</li>
|
||||
<?PHP if($addons_config['assign_groups_active']['value'] == '1') {
|
||||
echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "assign_groups.php" ? ' class="active">' : '>'); ?>
|
||||
<?PHP if($_SESSION['connected'] == 0) {
|
||||
echo '<a href="#myStatsModal" data-toggle="modal"><i class="fa fa-fw fa-address-card-o"></i> *',$lang['stag0001'],'</a>';
|
||||
} else {
|
||||
echo '<a href="assign_groups.php"><i class="fa fa-fw fa-address-card-o"></i> ',$lang['stag0001'],'</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "top_all.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-trophy"></i> <?PHP echo $lang['sttw0001']; ?> <i class="fa fa-fw fa-caret-down"></i></a>
|
||||
<ul id="demo" class="collapse">
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
session_start();
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if($language == "ar") {
|
||||
require_once('../languages/nations_en.php');
|
||||
|
||||
@@ -4,6 +4,9 @@ $starttime = microtime(true);
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if(!isset($_SESSION['tsuid'])) {
|
||||
set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid);
|
||||
|
||||
@@ -4,6 +4,9 @@ $starttime = microtime(true);
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if(!isset($_SESSION['tsuid'])) {
|
||||
set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid);
|
||||
|
||||
@@ -4,6 +4,9 @@ $starttime = microtime(true);
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if(!isset($_SESSION['tsuid'])) {
|
||||
set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid);
|
||||
|
||||
123
stats/verify.php
Normal file
123
stats/verify.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/phpcommand.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if(!isset($_SESSION['tsuid']) || isset($_SESSION['uuid_verified'])) {
|
||||
set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid);
|
||||
}
|
||||
|
||||
$multi_uuid = explode(',', substr($_SESSION['multiple'], 0, -1));
|
||||
foreach ($multi_uuid as $entry) {
|
||||
list($key, $value) = explode('=>', $entry);
|
||||
$multiple_uuid[$key] = $value;
|
||||
}
|
||||
|
||||
if(isset($_POST['uuid']) && !isset($_SESSION['temp_uuid'])) {
|
||||
require_once('../libs/ts3_lib/TeamSpeak3.php');
|
||||
try {
|
||||
$ts3 = TeamSpeak3::factory("serverquery://".$ts['user'].":".$ts['pass']."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']."&blocking=0");
|
||||
|
||||
try {
|
||||
usleep($slowmode);
|
||||
$ts3->selfUpdate(array('client_nickname' => "Ranksystem - Verification"));
|
||||
} catch (Exception $e) {
|
||||
$err_msg = 'TeamSpeak '.$lang['error'].$e->getCode().': '.$e->getMessage(); $err_lvl = 3;
|
||||
}
|
||||
|
||||
try {
|
||||
usleep($slowmode);
|
||||
$allclients = $ts3->clientList();
|
||||
} catch (Exception $e) {
|
||||
$err_msg = 'TeamSpeak '.$lang['error'].$e->getCode().': '.$e->getMessage(); $err_lvl = 3;
|
||||
}
|
||||
|
||||
foreach ($allclients as $client) {
|
||||
if($client['client_unique_identifier'] == $_POST['uuid']) {
|
||||
$cldbid = $client['client_database_id'];
|
||||
$nickname = htmlspecialchars($client['client_nickname'], ENT_QUOTES);
|
||||
$_SESSION['temp_uuid'] = htmlspecialchars($client['client_unique_identifier'], ENT_QUOTES);
|
||||
$pwd = substr(str_shuffle("abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"),0,6);
|
||||
$_SESSION['token'] = $pwd;
|
||||
try {
|
||||
$ts3->clientGetByUid($_SESSION['temp_uuid'])->message(sprintf($lang['stve0001'], $nickname, $pwd));
|
||||
$err_msg = $lang['stve0002']; $err_lvl = 1;
|
||||
} catch (Exception $e) {
|
||||
$err_msg = 'TeamSpeak '.$lang['error'].$e->getCode().': '.$e->getMessage(); $err_lvl = 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$err_msg = 'TeamSpeak '.$lang['error'].$e->getCode().': '.$e->getMessage(); $err_lvl = 3;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['token']) && isset($_SESSION['temp_uuid'])) {
|
||||
if($_POST['token'] == NULL) {
|
||||
$err_msg = $lang['stve0003']; $err_lvl = 1;
|
||||
} elseif($_POST['token'] != $_SESSION['token']) {
|
||||
$err_msg = $lang['stve0004']; $err_lvl = 3;
|
||||
} elseif($_POST['token'] == $_SESSION['token']) {
|
||||
$err_msg = $lang['stve0005']; $err_lvl = NULL;
|
||||
$_SESSION['uuid_verified'] = $_SESSION['temp_uuid'];
|
||||
$_SESSION['multiple'] = '';
|
||||
} else {
|
||||
$err_msg = $lang['stve0006']; $err_lvl = 3;
|
||||
}
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div id="login-overlay" class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel"><?PHP echo $lang['stve0007']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form name="verify" method="POST">
|
||||
<p><?PHP echo $lang['stve0008']; ?></p>
|
||||
<div class="form-group">
|
||||
<div class="input-group col-sm-12">
|
||||
<select class="selectpicker show-tick form-control" name="uuid" id="uuid" onchange="this.form.submit();">
|
||||
<option disabled value=""<?PHP if(!isset($_SESSION['temp_uuid'])) echo ' selected','>',$lang['stve0009']; ?></option>
|
||||
<?PHP
|
||||
foreach($multiple_uuid as $uuid => $nickname) {
|
||||
echo '<option data-subtext="',$uuid,'" value="',$uuid,'"'; if(isset($_SESSION['temp_uuid']) && $_SESSION['temp_uuid'] == $uuid) echo ' selected'; echo '>',$nickname,'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<p><?PHP echo $lang['stve0010']; ?></p>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><?PHP echo $lang['stve0011']; ?></span>
|
||||
<input type="text" class="form-control" name="token" placeholder="" maxlength="64">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success btn-block" name="verify"><?PHP echo $lang['stve0012']; ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,6 +2,9 @@
|
||||
session_start();
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/session.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
if($language == "ar") {
|
||||
require_once('../languages/nations_en.php');
|
||||
|
||||
Reference in New Issue
Block a user