release 1.3.11
This commit is contained in:
@@ -63,6 +63,7 @@ if(count($_SESSION[$rspathhex.'multiple']) > 1 and !isset($_SESSION[$rspathhex.'
|
||||
}
|
||||
|
||||
$allowed_groups_arr = explode(',', $addons_config['assign_groups_groupids']['value']);
|
||||
$excepted_groups_arr = explode(',', $addons_config['assign_groups_excepted_groupids']['value']);
|
||||
|
||||
if(isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) {
|
||||
if(($sumentries = $mysqlcon->query("SELECT COUNT(*) FROM `$dbname`.`addon_assign_groups` WHERE `uuid`='$uuid'")->fetch(PDO::FETCH_NUM)) === false) {
|
||||
@@ -72,7 +73,16 @@ if(count($_SESSION[$rspathhex.'multiple']) > 1 and !isset($_SESSION[$rspathhex.'
|
||||
$err_msg = $lang['stag0007']; $err_lvl = 3;
|
||||
} else {
|
||||
$set_groups = '';
|
||||
$count_limit = 0;
|
||||
$count_limit = $excepted = 0;
|
||||
if(isset($excepted_groups_arr) && $excepted_groups_arr != '') {
|
||||
foreach($excepted_groups_arr as $excepted_group) {
|
||||
if(in_array($excepted_group, $cld_groups)) {
|
||||
$excepted++;
|
||||
$err_msg = sprintf($lang['stag0019'], $sqlhisgroup[$excepted_group]['sgidname'], $excepted_group);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach($allowed_groups_arr as $allowed_group) {
|
||||
if(in_array($allowed_group, $cld_groups)) {
|
||||
$count_limit++;
|
||||
@@ -90,7 +100,7 @@ if(count($_SESSION[$rspathhex.'multiple']) > 1 and !isset($_SESSION[$rspathhex.'
|
||||
}
|
||||
}
|
||||
$set_groups = substr($set_groups, 0, -1);
|
||||
if($set_groups != '' && $count_limit <= $addons_config['assign_groups_limit']['value']) {
|
||||
if($set_groups != '' && $count_limit <= $addons_config['assign_groups_limit']['value'] && $excepted == 0) {
|
||||
if ($mysqlcon->exec("INSERT INTO `$dbname`.`addon_assign_groups` SET `uuid`='$uuid',`grpids`='$set_groups'") === false) {
|
||||
$err_msg = $lang['isntwidbmsg'].print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
} elseif($mysqlcon->exec("UPDATE `$dbname`.`job_check` SET `timestamp`=1 WHERE `job_name`='reload_trigger'; ") === false) {
|
||||
@@ -100,6 +110,8 @@ if(count($_SESSION[$rspathhex.'multiple']) > 1 and !isset($_SESSION[$rspathhex.'
|
||||
}
|
||||
} elseif($count_limit > $addons_config['assign_groups_limit']['value']) {
|
||||
$err_msg = sprintf($lang['stag0009'], $addons_config['assign_groups_limit']['value']); $err_lvl = 3;
|
||||
} elseif($excepted > 0) {
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['stag0010']; $err_lvl = 3;
|
||||
}
|
||||
|
||||
@@ -496,6 +496,6 @@ if (isset($nation[$sql_res['country_nation_name_5']])) {
|
||||
<input type="hidden" id="tsn32" value="<?PHP echo $sql_res['platform_5']; ?>">
|
||||
<input type="hidden" id="tsn33" value="<?PHP echo $sql_res['platform_other']; ?>">
|
||||
<input type="hidden" id="tsn34" value="<?PHP echo ($sql_res['server_used_slots'] + $sql_res['server_free_slots']); ?>">
|
||||
<input type="hidden" id="tsn35" value="<?PHP if($cfg['stats_show_maxclientsline_switch']==1) { echo "on"; } ?>">
|
||||
<input type="hidden" id="tsn35" value="<?PHP echo $cfg['stats_show_maxclientsline_switch']; ?>">
|
||||
</body>
|
||||
</html>
|
||||
@@ -22,37 +22,56 @@ if(!isset($_SESSION[$rspathhex.'tsuid'])) {
|
||||
set_session_ts3($mysqlcon,$cfg,$lang,$dbname);
|
||||
}
|
||||
|
||||
$notinuuid = '';
|
||||
if($cfg['rankup_excepted_unique_client_id_list'] != NULL) {
|
||||
foreach($cfg['rankup_excepted_unique_client_id_list'] as $uuid => $value) {
|
||||
$notinuuid .= "'".$uuid."',";
|
||||
}
|
||||
$notinuuid = substr($notinuuid, 0, -1);
|
||||
} else {
|
||||
$notinuuid = "'0'";
|
||||
}
|
||||
|
||||
$notingroup = '';
|
||||
$andnotgroup = '';
|
||||
if($cfg['rankup_excepted_group_id_list'] != NULL) {
|
||||
foreach($cfg['rankup_excepted_group_id_list'] as $group => $value) {
|
||||
$notingroup .= "'".$group."',";
|
||||
$andnotgroup .= " AND `u`.`cldgroup` NOT LIKE ('".$group.",%') AND `u`.`cldgroup` NOT LIKE ('%,".$group.",%')";
|
||||
}
|
||||
$notingroup = substr($notingroup, 0, -1);
|
||||
} else {
|
||||
$notingroup = '0';
|
||||
}
|
||||
|
||||
if ($cfg['rankup_time_assess_mode'] == 1) {
|
||||
$db_arr = $mysqlcon->query("SELECT `uuid`,`name`,`count`,`idle`,`cldgroup`,`online` FROM `$dbname`.`user` ORDER BY (`count` - `idle`) DESC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
$order = "(`count` - `idle`)";
|
||||
$texttime = $lang['sttw0013'];
|
||||
} else {
|
||||
$db_arr = $mysqlcon->query("SELECT `uuid`,`name`,`count`,`idle`,`cldgroup`,`online` FROM `$dbname`.`user` ORDER BY `count` DESC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
$order = "`count`";
|
||||
$texttime = $lang['sttw0003'];
|
||||
}
|
||||
$sumentries = count($db_arr) - 10;
|
||||
|
||||
$db_arr = $mysqlcon->query("SELECT `u`.`uuid`,`u`.`name`,`u`.`count`,`u`.`idle`,`u`.`cldgroup`,`u`.`online` FROM (SELECT `uuid`,`removed` FROM `$dbname`.`stats_user` WHERE `removed`!=1) `s` INNER JOIN `$dbname`.`user` `u` ON `u`.`uuid`=`s`.`uuid` WHERE `u`.`uuid` NOT IN ($notinuuid) AND `u`.`cldgroup` NOT IN ($notingroup) $andnotgroup ORDER BY $order DESC LIMIT 10")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
|
||||
$count10 = 0;
|
||||
$top10_sum = 0;
|
||||
$top10_idle_sum = 0;
|
||||
|
||||
|
||||
foreach ($db_arr as $uuid => $client) {
|
||||
$sgroups = array_flip(explode(",", $client['cldgroup']));
|
||||
if (!isset($cfg['rankup_excepted_unique_client_id_list'][$uuid]) && (!isset($cfg['rankup_excepted_group_id_list']) || !array_intersect_key($sgroups, $cfg['rankup_excepted_group_id_list']))) {
|
||||
if ($count10 == 10) break;
|
||||
if ($cfg['rankup_time_assess_mode'] == 1) {
|
||||
$hours = $client['count'] - $client['idle'];
|
||||
} else {
|
||||
$hours = $client['count'];
|
||||
}
|
||||
$top10_sum = round(($client['count']/3600)) + $top10_sum;
|
||||
$top10_idle_sum = round(($client['idle']/3600)) + $top10_idle_sum;
|
||||
$client_data[$count10] = array(
|
||||
'name' => $client['name'],
|
||||
'count' => $hours,
|
||||
'online' => $client['online']
|
||||
);
|
||||
$count10++;
|
||||
if ($cfg['rankup_time_assess_mode'] == 1) {
|
||||
$hours = $client['count'] - $client['idle'];
|
||||
} else {
|
||||
$hours = $client['count'];
|
||||
}
|
||||
$top10_sum = round(($client['count']/3600)) + $top10_sum;
|
||||
$top10_idle_sum = round(($client['idle']/3600)) + $top10_idle_sum;
|
||||
$client_data[$count10] = array(
|
||||
'name' => $client['name'],
|
||||
'count' => $hours,
|
||||
'online' => $client['online']
|
||||
);
|
||||
$count10++;
|
||||
}
|
||||
|
||||
for($count10 = $count10; $count10 <= 10; $count10++) {
|
||||
@@ -63,9 +82,10 @@ for($count10 = $count10; $count10 <= 10; $count10++) {
|
||||
);
|
||||
}
|
||||
|
||||
$sum = $mysqlcon->query("SELECT SUM(`count`) AS `count`, SUM(`idle`) AS `idle` FROM `$dbname`.`user`")->fetch();
|
||||
$sum = $mysqlcon->query("SELECT SUM(`count`) AS `count`, SUM(`idle`) AS `idle`, COUNT(*) AS `user` FROM `$dbname`.`user`")->fetch();
|
||||
$others_sum = round(($sum['count']/3600)) - $top10_sum;
|
||||
$others_idle_sum = round(($sum['idle']/3600)) - $top10_idle_sum;
|
||||
$sumentries = $sum['user'] - 10;
|
||||
|
||||
function get_percentage($max_value, $value) {
|
||||
return (round(($value/$max_value)*100));
|
||||
|
||||
@@ -22,39 +22,58 @@ if(!isset($_SESSION[$rspathhex.'tsuid'])) {
|
||||
set_session_ts3($mysqlcon,$cfg,$lang,$dbname);
|
||||
}
|
||||
|
||||
$notinuuid = '';
|
||||
if($cfg['rankup_excepted_unique_client_id_list'] != NULL) {
|
||||
foreach($cfg['rankup_excepted_unique_client_id_list'] as $uuid => $value) {
|
||||
$notinuuid .= "'".$uuid."',";
|
||||
}
|
||||
$notinuuid = substr($notinuuid, 0, -1);
|
||||
} else {
|
||||
$notinuuid = "'0'";
|
||||
}
|
||||
|
||||
$notingroup = '';
|
||||
$andnotgroup = '';
|
||||
if($cfg['rankup_excepted_group_id_list'] != NULL) {
|
||||
foreach($cfg['rankup_excepted_group_id_list'] as $group => $value) {
|
||||
$notingroup .= "'".$group."',";
|
||||
$andnotgroup .= " AND `u`.`cldgroup` NOT LIKE ('".$group.",%') AND `u`.`cldgroup` NOT LIKE ('%,".$group.",%')";
|
||||
}
|
||||
$notingroup = substr($notingroup, 0, -1);
|
||||
} else {
|
||||
$notingroup = '0';
|
||||
}
|
||||
|
||||
if ($cfg['rankup_time_assess_mode'] == 1) {
|
||||
$db_arr = $mysqlcon->query("SELECT `s`.`uuid`,`s`.`count_month`,`s`.`idle_month`,`u`.`name`,`u`.`online`,`u`.`cldgroup` FROM `$dbname`.`stats_user` AS `s` INNER JOIN `$dbname`.`user` AS `u` ON `s`.`uuid`=`u`.`uuid` WHERE `s`.`removed`='0' ORDER BY (`s`.`count_month` - `s`.`idle_month`) DESC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
$order = "(`s`.`count_month` - `s`.`idle_month`)";
|
||||
$texttime = $lang['sttw0013'];
|
||||
} else {
|
||||
$db_arr = $mysqlcon->query("SELECT `s`.`uuid`,`s`.`count_month`,`s`.`idle_month`,`u`.`name`,`u`.`online`,`u`.`cldgroup` FROM `$dbname`.`stats_user` AS `s` INNER JOIN `$dbname`.`user` AS `u` ON `s`.`uuid`=`u`.`uuid` WHERE `s`.`removed`='0' ORDER BY `s`.`count_month` DESC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
$order = "`s`.`count_month`";
|
||||
$texttime = $lang['sttw0003'];
|
||||
}
|
||||
|
||||
$db_arr = $mysqlcon->query("SELECT `s`.`uuid`,`s`.`count_month`,`s`.`idle_month`,`u`.`name`,`u`.`online`,`u`.`cldgroup` FROM (SELECT `uuid`,`removed`,`count_month`,`idle_month` FROM `$dbname`.`stats_user` WHERE `removed`!=1) `s` INNER JOIN `$dbname`.`user` `u` ON `u`.`uuid`=`s`.`uuid` WHERE `u`.`uuid` NOT IN ($notinuuid) AND `u`.`cldgroup` NOT IN ($notingroup) $andnotgroup ORDER BY $order DESC LIMIT 10")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
|
||||
$count_ids = $mysqlcon->query("SELECT COUNT(DISTINCT(`id`)) AS `count` from `$dbname`.`user_snapshot`")->fetch();
|
||||
|
||||
$sumentries = count($db_arr) - 10;
|
||||
$count10 = 0;
|
||||
$top10_sum = 0;
|
||||
$top10_idle_sum = 0;
|
||||
|
||||
foreach ($db_arr as $uuid => $client) {
|
||||
$sgroups = array_flip(explode(",", $client['cldgroup']));
|
||||
if (!isset($cfg['rankup_excepted_unique_client_id_list'][$uuid]) && (!isset($cfg['rankup_excepted_group_id_list']) || !array_intersect_key($sgroups, $cfg['rankup_excepted_group_id_list']))) {
|
||||
if ($count10 == 10) break;
|
||||
if ($cfg['rankup_time_assess_mode'] == 1) {
|
||||
$hours = $client['count_month'] - $client['idle_month'];
|
||||
} else {
|
||||
$hours = $client['count_month'];
|
||||
}
|
||||
$top10_sum = round(($client['count_month']/3600)) + $top10_sum;
|
||||
$top10_idle_sum = round(($client['idle_month']/3600)) + $top10_idle_sum;
|
||||
$client_data[$count10] = array(
|
||||
'name' => $client['name'],
|
||||
'count' => $hours,
|
||||
'online' => $client['online']
|
||||
);
|
||||
$count10++;
|
||||
if ($cfg['rankup_time_assess_mode'] == 1) {
|
||||
$hours = $client['count_month'] - $client['idle_month'];
|
||||
} else {
|
||||
$hours = $client['count_month'];
|
||||
}
|
||||
$top10_sum = round(($client['count_month']/3600)) + $top10_sum;
|
||||
$top10_idle_sum = round(($client['idle_month']/3600)) + $top10_idle_sum;
|
||||
$client_data[$count10] = array(
|
||||
'name' => $client['name'],
|
||||
'count' => $hours,
|
||||
'online' => $client['online']
|
||||
);
|
||||
$count10++;
|
||||
}
|
||||
|
||||
for($count10 = $count10; $count10 <= 10; $count10++) {
|
||||
@@ -65,9 +84,10 @@ for($count10 = $count10; $count10 <= 10; $count10++) {
|
||||
);
|
||||
}
|
||||
|
||||
$sum = $mysqlcon->query("SELECT SUM(`count_month`) AS `count`, SUM(`idle_month`) AS `idle` FROM `$dbname`.`stats_user`")->fetch();
|
||||
$sum = $mysqlcon->query("SELECT SUM(`count`) AS `count`, SUM(`idle`) AS `idle`, COUNT(*) AS `user` FROM `$dbname`.`user`")->fetch();
|
||||
$others_sum = round(($sum['count']/3600)) - $top10_sum;
|
||||
$others_idle_sum = round(($sum['idle']/3600)) - $top10_idle_sum;
|
||||
$sumentries = $sum['user'] - 10;
|
||||
|
||||
function get_percentage($max_value, $value) {
|
||||
return (round(($value/$max_value)*100));
|
||||
|
||||
@@ -22,39 +22,58 @@ if(!isset($_SESSION[$rspathhex.'tsuid'])) {
|
||||
set_session_ts3($mysqlcon,$cfg,$lang,$dbname);
|
||||
}
|
||||
|
||||
$notinuuid = '';
|
||||
if($cfg['rankup_excepted_unique_client_id_list'] != NULL) {
|
||||
foreach($cfg['rankup_excepted_unique_client_id_list'] as $uuid => $value) {
|
||||
$notinuuid .= "'".$uuid."',";
|
||||
}
|
||||
$notinuuid = substr($notinuuid, 0, -1);
|
||||
} else {
|
||||
$notinuuid = "'0'";
|
||||
}
|
||||
|
||||
$notingroup = '';
|
||||
$andnotgroup = '';
|
||||
if($cfg['rankup_excepted_group_id_list'] != NULL) {
|
||||
foreach($cfg['rankup_excepted_group_id_list'] as $group => $value) {
|
||||
$notingroup .= "'".$group."',";
|
||||
$andnotgroup .= " AND `u`.`cldgroup` NOT LIKE ('".$group.",%') AND `u`.`cldgroup` NOT LIKE ('%,".$group.",%')";
|
||||
}
|
||||
$notingroup = substr($notingroup, 0, -1);
|
||||
} else {
|
||||
$notingroup = "'0'";
|
||||
}
|
||||
|
||||
if ($cfg['rankup_time_assess_mode'] == 1) {
|
||||
$db_arr = $mysqlcon->query("SELECT `s`.`uuid`,`s`.`count_week`,`s`.`idle_week`,`u`.`name`,`u`.`online`,`u`.`cldgroup` FROM `$dbname`.`stats_user` AS `s` INNER JOIN `$dbname`.`user` AS `u` ON `s`.`uuid`=`u`.`uuid` WHERE `s`.`removed`='0' ORDER BY (`s`.`count_week` - `s`.`idle_week`) DESC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
$order = "(`s`.`count_week` - `s`.`idle_week`)";
|
||||
$texttime = $lang['sttw0013'];
|
||||
} else {
|
||||
$db_arr = $mysqlcon->query("SELECT `s`.`uuid`,`s`.`count_week`,`s`.`idle_week`,`u`.`name`,`u`.`online`,`u`.`cldgroup` FROM `$dbname`.`stats_user` AS `s` INNER JOIN `$dbname`.`user` AS `u` ON `s`.`uuid`=`u`.`uuid` WHERE `s`.`removed`='0' ORDER BY `s`.`count_week` DESC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
$order = "`s`.`count_week`";
|
||||
$texttime = $lang['sttw0003'];
|
||||
}
|
||||
|
||||
$db_arr = $mysqlcon->query("SELECT `s`.`uuid`,`s`.`count_week`,`s`.`idle_week`,`u`.`name`,`u`.`online`,`u`.`cldgroup` FROM (SELECT `uuid`,`removed`,`count_week`,`idle_week` FROM `$dbname`.`stats_user` WHERE `removed`!=1) `s` INNER JOIN `$dbname`.`user` `u` ON `u`.`uuid`=`s`.`uuid` WHERE `u`.`uuid` NOT IN ($notinuuid) AND `u`.`cldgroup` NOT IN ($notingroup) $andnotgroup ORDER BY $order DESC LIMIT 10")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
|
||||
$count_ids = $mysqlcon->query("SELECT COUNT(DISTINCT(`id`)) AS `count` from `$dbname`.`user_snapshot`")->fetch();
|
||||
|
||||
$sumentries = count($db_arr) - 10;
|
||||
$count10 = 0;
|
||||
$top10_sum = 0;
|
||||
$top10_idle_sum = 0;
|
||||
|
||||
foreach ($db_arr as $uuid => $client) {
|
||||
$sgroups = array_flip(explode(",", $client['cldgroup']));
|
||||
if (!isset($cfg['rankup_excepted_unique_client_id_list'][$uuid]) && (!isset($cfg['rankup_excepted_group_id_list']) || !array_intersect_key($sgroups, $cfg['rankup_excepted_group_id_list']))) {
|
||||
if ($count10 == 10) break;
|
||||
if ($cfg['rankup_time_assess_mode'] == 1) {
|
||||
$hours = $client['count_week'] - $client['idle_week'];
|
||||
} else {
|
||||
$hours = $client['count_week'];
|
||||
}
|
||||
$top10_sum = round(($client['count_week']/3600)) + $top10_sum;
|
||||
$top10_idle_sum = round(($client['idle_week']/3600)) + $top10_idle_sum;
|
||||
$client_data[$count10] = array(
|
||||
'name' => $client['name'],
|
||||
'count' => $hours,
|
||||
'online' => $client['online']
|
||||
);
|
||||
$count10++;
|
||||
if ($cfg['rankup_time_assess_mode'] == 1) {
|
||||
$hours = $client['count_week'] - $client['idle_week'];
|
||||
} else {
|
||||
$hours = $client['count_week'];
|
||||
}
|
||||
$top10_sum = round(($client['count_week']/3600)) + $top10_sum;
|
||||
$top10_idle_sum = round(($client['idle_week']/3600)) + $top10_idle_sum;
|
||||
$client_data[$count10] = array(
|
||||
'name' => $client['name'],
|
||||
'count' => $hours,
|
||||
'online' => $client['online']
|
||||
);
|
||||
$count10++;
|
||||
}
|
||||
|
||||
for($count = $count10; $count10 < 10; $count10++) {
|
||||
@@ -65,9 +84,10 @@ for($count = $count10; $count10 < 10; $count10++) {
|
||||
);
|
||||
}
|
||||
|
||||
$sum = $mysqlcon->query("SELECT SUM(`count_week`) AS `count`, SUM(`idle_week`) AS `idle` FROM `$dbname`.`stats_user`")->fetch();
|
||||
$sum = $mysqlcon->query("SELECT SUM(`count`) AS `count`, SUM(`idle`) AS `idle`, COUNT(*) AS `user` FROM `$dbname`.`user`")->fetch();
|
||||
$others_sum = round(($sum['count']/3600)) - $top10_sum;
|
||||
$others_idle_sum = round(($sum['idle']/3600)) - $top10_idle_sum;
|
||||
$sumentries = $sum['user'] - 10;
|
||||
|
||||
function get_percentage($max_value, $value) {
|
||||
return (round(($value/$max_value)*100));
|
||||
|
||||
Reference in New Issue
Block a user