diff --git a/api/index.php b/api/index.php index 3853b42..2cabe45 100644 --- a/api/index.php +++ b/api/index.php @@ -1,20 +1,15 @@ '.$e->getMessage().''; - exit; - } -} +start_session($cfg); + +error_reporting(E_ALL); +ini_set("log_errors", 1); +set_error_handler("php_error_handling"); +ini_set("error_log", $cfg['logs_path'].'ranksystem.log'); + +header("Content-Type: application/json; charset=UTF-8"); if (isset($_GET['apikey'])) { $matchkey = 0; @@ -167,24 +162,38 @@ $dbdata->execute(); $json = $dbdata->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE); } elseif (isset($_GET['user'])) { - $uuid = $name = '----------_none_selected_----------'; - $filter = ''; - $part = $cldbid = $all = 0; + $filter = ' WHERE'; + if(isset($_GET['cldbid'])) { + $cldbid = htmlspecialchars_decode($_GET['cldbid']); + if($filter != ' WHERE') $filter .= " AND"; + $filter .= ' `cldbid` LIKE :cldbid'; + } + if(isset($_GET['groupid'])) { + $groupid = htmlspecialchars_decode($_GET['groupid']); + if($filter != ' WHERE') $filter .= " AND"; + $filter .= " (`cldgroup` = :groupid OR `cldgroup` LIKE (:groupid0) OR `cldgroup` LIKE (:groupid1) OR `cldgroup` LIKE (:groupid2))"; + } + if(isset($_GET['name'])) { + $name = htmlspecialchars_decode($_GET['name']); + if($filter != ' WHERE') $filter .= " AND"; + $filter .= ' `name` LIKE :name'; + } if(!isset($_GET['sort'])) $sort = '`rank`'; - if(isset($_GET['all'])) $all = 1; - if(isset($_GET['uuid'])) $uuid = htmlspecialchars_decode($_GET['uuid']); - if(isset($_GET['cldbid'])) $cldbid = htmlspecialchars_decode($_GET['cldbid']); - if(isset($_GET['name'])) $name = htmlspecialchars_decode($_GET['name']); - if(isset($_GET['part'])) $part = (htmlspecialchars_decode($_GET['part']) - 1) * 100; - if(isset($_GET['online']) && $uuid == '----------_none_selected_----------' && $name == '----------_none_selected_----------' && $cldbid == 0) { - $filter = '`online`=1'; - } elseif(isset($_GET['online'])) { - $filter = '(`uuid` LIKE :uuid OR `cldbid` LIKE :cldbid OR `name` LIKE :name) AND `online`=1'; - } elseif($uuid != '----------_none_selected_----------' || $name != '----------_none_selected_----------' || $cldbid != 0) { - $filter = '(`uuid` LIKE :uuid OR `cldbid` LIKE :cldbid OR `name` LIKE :name)'; + if(isset($_GET['status']) && $_GET['status'] == strtolower('online')) { + if($filter != ' WHERE') $filter .= " AND"; + $filter .= " `online`=1"; + } elseif(isset($_GET['status']) && $_GET['status'] == strtolower('offline')) { + if($filter != ' WHERE') $filter .= " AND"; + $filter .= " `online`=0"; + } + if(isset($_GET['uuid'])) { + $uuid = htmlspecialchars_decode($_GET['uuid']); + if($filter != ' WHERE') $filter .= " AND"; + $filter .= ' `uuid` LIKE :uuid'; } - - if($uuid == '----------_none_selected_----------' && $name == '----------_none_selected_----------' && $filter == '' && $cldbid == 0 && $all == 0) { + if($filter == ' WHERE') $filter = ''; + + if($filter == '' && !isset($_GET['all']) && !isset($_GET['cldbid']) && !isset($_GET['name']) && !isset($_GET['uuid'])) { $json = array( "usage" => array( "all" => array( @@ -197,6 +206,11 @@ "usage" => "Use \$_GET parameter 'cldbid' and add as value a single client TS-database ID", "example" => "/api/?user&cldbid=7775" ), + "groupid" => array( + "desc" => "Get only user, which are in the given servergroup database ID", + "usage" => "Use \$_GET parameter 'groupid' and add as value a database ID of a servergroup", + "example" => "/api/?user&groupid=6" + ), "limit" => array( "desc" => "Define a number that limits the number of results. Maximum value is 1000. Default is 100.", "usage" => "Use \$_GET parameter 'limit' and add as value a number above 1", @@ -216,11 +230,6 @@ ) ) ), - "online" => array( - "desc" => "Get the online TeamSpeak user", - "usage" => "Use \$_GET parameter 'online' without any value", - "example" => "/api/?user&online" - ), "order" => array( "desc" => "Define a sorting order.", "usage" => "Use \$_GET parameter 'order' and add as value 'asc' for ascending or 'desc' for descending", @@ -249,6 +258,11 @@ ) ) ), + "status" => array( + "desc" => "List only clients, which status is online or offline.", + "usage" => "Use \$_GET parameter 'status' and add as value 'online' or 'offline'", + "example" => "/api/?userstats&status=online" + ), "uuid" => array( "desc" => "Get details about TeamSpeak user by unique client ID", "usage" => "Use \$_GET parameter 'uuid' and add as value one unique client ID or a part of it", @@ -257,33 +271,53 @@ ) ); } else { - if ($all == 1) { - $dbdata = $mysqlcon->prepare("SELECT * FROM `$dbname`.`user` ORDER BY {$sort} {$order} LIMIT :start, :limit"); - } else { - $dbdata = $mysqlcon->prepare("SELECT * FROM `$dbname`.`user` WHERE {$filter} ORDER BY {$sort} {$order} LIMIT :start, :limit"); - } - if($filter != '`online`=1' && $all == 0) { - $dbdata->bindValue(':uuid', '%'.$uuid.'%', PDO::PARAM_STR); - $dbdata->bindValue(':cldbid', (int) $cldbid, PDO::PARAM_INT); - $dbdata->bindValue(':name', '%'.$name.'%', PDO::PARAM_STR); - } + $dbdata = $mysqlcon->prepare("SELECT * FROM `$dbname`.`user` {$filter} ORDER BY {$sort} {$order} LIMIT :start, :limit"); + if(isset($_GET['cldbid'])) $dbdata->bindValue(':cldbid', (int) $cldbid, PDO::PARAM_INT); + if(isset($_GET['groupid'])) $dbdata->bindValue(':groupid', $groupid, PDO::PARAM_STR); + if(isset($_GET['groupid'])) $dbdata->bindValue(':groupid0', $groupid.'%', PDO::PARAM_STR); + if(isset($_GET['groupid'])) $dbdata->bindValue(':groupid1', '%'.$groupid.'%', PDO::PARAM_STR); + if(isset($_GET['groupid'])) $dbdata->bindValue(':groupid2', '%'.$groupid, PDO::PARAM_STR); + if(isset($_GET['name'])) $dbdata->bindValue(':name', '%'.$name.'%', PDO::PARAM_STR); + if(isset($_GET['uuid'])) $dbdata->bindValue(':uuid', '%'.$uuid.'%', PDO::PARAM_STR); + $dbdata->bindValue(':start', (int) $part, PDO::PARAM_INT); $dbdata->bindValue(':limit', (int) $limit, PDO::PARAM_INT); $dbdata->execute(); $json = $dbdata->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE); } } elseif (isset($_GET['userstats'])) { - $uuid = '----------_none_selected_----------'; - $filter = ''; - $part = $all = 0; - if(isset($_GET['all'])) $all = 1; + $filter = ' WHERE'; + if(isset($_GET['cldbid'])) { + $cldbid = htmlspecialchars_decode($_GET['cldbid']); + if($filter != ' WHERE') $filter .= " AND"; + $filter .= ' `cldbid` LIKE :cldbid'; + } + if(isset($_GET['groupid'])) { + $groupid = htmlspecialchars_decode($_GET['groupid']); + if($filter != ' WHERE') $filter .= " AND"; + $filter .= " (`user`.`cldgroup` = :groupid OR `user`.`cldgroup` LIKE (:groupid0) OR `user`.`cldgroup` LIKE (:groupid1) OR `user`.`cldgroup` LIKE (:groupid2))"; + } + if(isset($_GET['name'])) { + $name = htmlspecialchars_decode($_GET['name']); + if($filter != ' WHERE') $filter .= " AND"; + $filter .= ' `user`.`name` LIKE :name'; + } if(!isset($_GET['sort'])) $sort = '`count_week`'; + if(isset($_GET['status']) && $_GET['status'] == strtolower('online')) { + if($filter != ' WHERE') $filter .= " AND"; + $filter .= " `user`.`online`=1"; + } elseif(isset($_GET['status']) && $_GET['status'] == strtolower('offline')) { + if($filter != ' WHERE') $filter .= " AND"; + $filter .= " `user`.`online`=0"; + } if(isset($_GET['uuid'])) { $uuid = htmlspecialchars_decode($_GET['uuid']); - $filter = '`stats_user`.`uuid` LIKE :uuid'; + if($filter != ' WHERE') $filter .= " AND"; + $filter .= ' `user`.`uuid` LIKE :uuid'; } + if($filter == ' WHERE') $filter = ''; - if($uuid == '----------_none_selected_----------' && $all == 0 && $filter == '') { + if($filter == '' && !isset($_GET['all']) && !isset($_GET['cldbid']) && !isset($_GET['name']) && !isset($_GET['uuid'])) { $json = array( "usage" => array( "all" => array( @@ -291,11 +325,35 @@ "usage" => "Use \$_GET parameter 'all' without any value", "example" => "/api/?userstats&all" ), + "cldbid" => array( + "desc" => "Get details about TeamSpeak user by client TS-database ID", + "usage" => "Use \$_GET parameter 'cldbid' and add as value a single client TS-database ID", + "example" => "/api/?userstats&cldbid=7775" + ), + "groupid" => array( + "desc" => "Get only user, which are in the given servergroup database ID", + "usage" => "Use \$_GET parameter 'groupid' and add as value a database ID of a servergroup", + "example" => "/api/?userstats&groupid=6" + ), "limit" => array( "desc" => "Define a number that limits the number of results. Maximum value is 1000. Default is 100.", "usage" => "Use \$_GET parameter 'limit' and add as value a number above 1", "example" => "/api/?userstats&limit=10" ), + "name" => array( + "desc" => "Get details about TeamSpeak user by client nickname", + "usage" => "Use \$_GET parameter 'name' and add as value a name or a part of it", + "example" => array( + "1" => array( + "desc" => "Filter by client nickname", + "url" => "/api/?userstats&name=Newcomer1989" + ), + "2" => array( + "desc" => "Filter by client nickname with a percent sign as placeholder", + "url" => "/api/?userstats&name=%user%" + ) + ) + ), "order" => array( "desc" => "Define a sorting order.", "usage" => "Use \$_GET parameter 'order' and add as value 'asc' for ascending or 'desc' for descending", @@ -324,6 +382,11 @@ ) ) ), + "status" => array( + "desc" => "List only clients, which status is online or offline.", + "usage" => "Use \$_GET parameter 'status' and add as value 'online' or 'offline'", + "example" => "/api/?userstats&status=online" + ), "uuid" => array( "desc" => "Get additional statistics about TeamSpeak user by unique client ID", "usage" => "Use \$_GET parameter 'uuid' and add as value one unique client ID or a part of it", @@ -332,12 +395,15 @@ ) ); } else { - if ($all == 1) { - $dbdata = $mysqlcon->prepare("SELECT * FROM `$dbname`.`stats_user` INNER JOIN `user` ON `user`.`uuid` = `stats_user`.`uuid` ORDER BY {$sort} {$order} LIMIT :start, :limit"); - } else { - $dbdata = $mysqlcon->prepare("SELECT * FROM `$dbname`.`stats_user` INNER JOIN `user` ON `user`.`uuid` = `stats_user`.`uuid` WHERE {$filter} ORDER BY {$sort} {$order} LIMIT :start, :limit"); - $dbdata->bindValue(':uuid', '%'.$uuid.'%', PDO::PARAM_STR); - } + $dbdata = $mysqlcon->prepare("SELECT * FROM `$dbname`.`stats_user` INNER JOIN `$dbname`.`user` ON `user`.`uuid` = `stats_user`.`uuid` {$filter} ORDER BY {$sort} {$order} LIMIT :start, :limit"); + if(isset($_GET['cldbid'])) $dbdata->bindValue(':cldbid', (int) $cldbid, PDO::PARAM_INT); + if(isset($_GET['groupid'])) $dbdata->bindValue(':groupid', $groupid, PDO::PARAM_STR); + if(isset($_GET['groupid'])) $dbdata->bindValue(':groupid0', $groupid.'%', PDO::PARAM_STR); + if(isset($_GET['groupid'])) $dbdata->bindValue(':groupid1', '%'.$groupid.'%', PDO::PARAM_STR); + if(isset($_GET['groupid'])) $dbdata->bindValue(':groupid2', '%'.$groupid, PDO::PARAM_STR); + if(isset($_GET['name'])) $dbdata->bindValue(':name', '%'.$name.'%', PDO::PARAM_STR); + if(isset($_GET['uuid'])) $dbdata->bindValue(':uuid', '%'.$uuid.'%', PDO::PARAM_STR); + $dbdata->bindValue(':start', (int) $part, PDO::PARAM_INT); $dbdata->bindValue(':limit', (int) $limit, PDO::PARAM_INT); $dbdata->execute(); diff --git a/install.php b/install.php index bb8b28f..545e442 100644 --- a/install.php +++ b/install.php @@ -1,6 +1,10 @@  @@ -164,7 +168,7 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms $count++; } - if($mysqlcon->exec("INSERT INTO `$dbname`.`job_check` (`job_name`) VALUES ('calc_user_limit'),('calc_user_lastscan'),('check_update'),('get_version'),('clean_db'),('clean_clients'),('calc_donut_chars'),('calc_server_stats'),('get_avatars'),('last_snapshot_id'),('last_snapshot_time'),('last_update'),('reload_trigger'),('reset_user_time'),('reset_user_delete'),('reset_group_withdraw'),('reset_webspace_cache'),('reset_usage_graph'),('reset_stop_after'),('runtime_check'),('update_groups')") === false) { + if($mysqlcon->exec("INSERT INTO `$dbname`.`job_check` (`job_name`) VALUES ('calc_user_limit'),('calc_user_lastscan'),('check_update'),('database_export'),('get_version'),('clean_db'),('clean_clients'),('calc_donut_chars'),('calc_server_stats'),('get_avatars'),('last_snapshot_id'),('last_snapshot_time'),('last_update'),('reload_trigger'),('reset_user_time'),('reset_user_delete'),('reset_group_withdraw'),('reset_webspace_cache'),('reset_usage_graph'),('reset_stop_after'),('runtime_check'),('update_groups')") === false) { $err_msg .= $lang['isntwidbmsg'].$mysqlcon->errorCode()." ".print_r($mysqlcon->errorInfo(), true).'
'; $err_lvl = 2; $count++; } @@ -293,7 +297,7 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms $nextupinfomsg3 = $mysqlcon->quote("You are excepted from the Ranksystem. If you wish to rank contact an admin on the TS3 server."); $servernews = $mysqlcon->quote("Message
This is an example Message.
Change this Message inside the webinterface."); $rankupmsg = $mysqlcon->quote('Hey, you reached a higher rank, since you already connected for %1$s days, %2$s hours and %3$s minutes to our TS3 server.[B]Keep it up![/B] ;-) '); - if($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('default_date_format', $dateformat), ('default_language', 'en'), ('logs_path', '{$logpath}'), ('logs_timezone', 'Europe/Berlin'), ('logs_debug_level', '5'), ('logs_rotation_size', '5'), ('rankup_boost_definition', ''), ('rankup_clean_clients_period', '86400'), ('rankup_clean_clients_switch', '1'), ('rankup_client_database_id_change_switch', '0'), ('rankup_definition', '31536000=>7'), ('rankup_excepted_channel_id_list', ''), ('rankup_excepted_group_id_list', ''), ('rankup_excepted_mode', '0'), ('rankup_excepted_unique_client_id_list', ''), ('rankup_hash_ip_addresses_mode', '2'), ('rankup_ignore_idle_time', '600'), ('rankup_message_to_user', $rankupmsg), ('rankup_message_to_user_switch', '1'), ('rankup_next_message_1', $nextupinfomsg1), ('rankup_next_message_2', $nextupinfomsg2), ('rankup_next_message_3', $nextupinfomsg3), ('rankup_next_message_mode', '1'), ('rankup_time_assess_mode', '0'), ('stats_api_keys', ''), ('stats_column_active_time_switch', '0'), ('stats_column_current_group_since_switch', '1'), ('stats_column_current_server_group_switch', '1'), ('stats_column_client_db_id_switch', '0'), ('stats_column_client_name_switch', '1'), ('stats_column_idle_time_switch', '1'), ('stats_column_last_seen_switch', '1'), ('stats_column_next_rankup_switch', '1'), ('stats_column_next_server_group_switch', '1'), ('stats_column_online_time_switch', '1'), ('stats_column_rank_switch', '1'), ('stats_column_unique_id_switch', '0'), ('stats_column_default_sort', 'rank'), ('stats_column_default_order', 'asc'), ('stats_imprint_switch', '0'), ('stats_imprint_address', 'Max Mustermann
Musterstraße 13
05172 Musterhausen
Germany'), ('stats_imprint_address_url', 'https://site.url/imprint/'), ('stats_imprint_email', 'info@example.com'), ('stats_imprint_notes', NULL), ('stats_imprint_phone', '+49 171 1234567'), ('stats_imprint_privacypolicy', 'Add your own privacy policy here. (editable in the webinterface)'), ('stats_imprint_privacypolicy_url', 'https://site.url/privacy/'), ('stats_server_news', $servernews), ('stats_show_clients_in_highest_rank_switch', '1'), ('stats_show_excepted_clients_switch', '1'), ('stats_show_maxclientsline_switch', 0), ('stats_show_site_navigation_switch', '1'), ('stats_time_bronze','50'), ('stats_time_silver','100'), ('stats_time_gold','250'), ('stats_time_legend','500'), ('stats_connects_bronze','50'), ('stats_connects_silver','100'), ('stats_connects_gold','250'), ('stats_connects_legend','500'), ('teamspeak_avatar_download_delay', '0'), ('teamspeak_default_channel_id', '0'), ('teamspeak_host_address', '127.0.0.1'), ('teamspeak_query_command_delay', '0'), ('teamspeak_query_encrypt_switch', '0'), ('teamspeak_query_nickname', 'Ranksystem'), ('teamspeak_query_pass', ''), ('teamspeak_query_port', '10011'), ('teamspeak_query_user', 'serveradmin'), ('teamspeak_verification_channel_id', '0'), ('teamspeak_voice_port', '9987'), ('version_current_using', '{$rsversion}'), ('version_latest_available', '{$rsversion}'), ('version_update_channel', 'stable'), ('webinterface_access_count', '0'), ('webinterface_access_last', '0'), ('webinterface_admin_client_unique_id_list', ''), ('webinterface_advanced_mode', '0'), ('webinterface_fresh_installation', '1'), ('webinterface_pass', '{$pass}'), ('webinterface_user', '{$user}');") === false) { + if($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('default_date_format', $dateformat), ('default_language', 'en'), ('default_session_sametime', 'Strict'), ('default_header_origin', ''), ('default_header_xss', '1; mode=block'), ('default_header_contenttyp', '1'), ('default_header_frame', 'SAMEORIGIN'), ('logs_path', '{$logpath}'), ('logs_timezone', 'Europe/Berlin'), ('logs_debug_level', '5'), ('logs_rotation_size', '5'), ('rankup_boost_definition', ''), ('rankup_clean_clients_period', '86400'), ('rankup_clean_clients_switch', '1'), ('rankup_client_database_id_change_switch', '0'), ('rankup_definition', '31536000=>7=>0'), ('rankup_excepted_channel_id_list', ''), ('rankup_excepted_group_id_list', ''), ('rankup_excepted_mode', '0'), ('rankup_excepted_unique_client_id_list', ''), ('rankup_hash_ip_addresses_mode', '2'), ('rankup_ignore_idle_time', '600'), ('rankup_message_to_user', $rankupmsg), ('rankup_message_to_user_switch', '1'), ('rankup_next_message_1', $nextupinfomsg1), ('rankup_next_message_2', $nextupinfomsg2), ('rankup_next_message_3', $nextupinfomsg3), ('rankup_next_message_mode', '1'), ('rankup_time_assess_mode', '0'), ('stats_api_keys', ''), ('stats_column_active_time_switch', '0'), ('stats_column_current_group_since_switch', '1'), ('stats_column_current_server_group_switch', '1'), ('stats_column_client_db_id_switch', '0'), ('stats_column_client_name_switch', '1'), ('stats_column_idle_time_switch', '1'), ('stats_column_last_seen_switch', '1'), ('stats_column_nation_switch', '0'), ('stats_column_next_rankup_switch', '1'), ('stats_column_next_server_group_switch', '1'), ('stats_column_online_time_switch', '1'), ('stats_column_platform_switch', '0'), ('stats_column_rank_switch', '1'), ('stats_column_unique_id_switch', '0'), ('stats_column_default_sort', 'rank'), ('stats_column_default_order', 'asc'), ('stats_column_version_switch', '0'), ('stats_imprint_switch', '0'), ('stats_imprint_address', 'Max Mustermann
Musterstraße 13
05172 Musterhausen
Germany'), ('stats_imprint_address_url', 'https://site.url/imprint/'), ('stats_imprint_email', 'info@example.com'), ('stats_imprint_notes', NULL), ('stats_imprint_phone', '+49 171 1234567'), ('stats_imprint_privacypolicy', 'Add your own privacy policy here. (editable in the webinterface)'), ('stats_imprint_privacypolicy_url', 'https://site.url/privacy/'), ('stats_server_news', $servernews), ('stats_show_clients_in_highest_rank_switch', '1'), ('stats_show_excepted_clients_switch', '1'), ('stats_show_maxclientsline_switch', 0), ('stats_show_site_navigation_switch', '1'), ('stats_time_bronze','50'), ('stats_time_silver','100'), ('stats_time_gold','250'), ('stats_time_legend','500'), ('stats_connects_bronze','50'), ('stats_connects_silver','100'), ('stats_connects_gold','250'), ('stats_connects_legend','500'), ('teamspeak_avatar_download_delay', '0'), ('teamspeak_default_channel_id', '0'), ('teamspeak_host_address', '127.0.0.1'), ('teamspeak_query_command_delay', '0'), ('teamspeak_query_encrypt_switch', '0'), ('teamspeak_query_nickname', 'Ranksystem'), ('teamspeak_query_pass', ''), ('teamspeak_query_port', '10011'), ('teamspeak_query_user', 'serveradmin'), ('teamspeak_verification_channel_id', '0'), ('teamspeak_voice_port', '9987'), ('version_current_using', '{$rsversion}'), ('version_latest_available', '{$rsversion}'), ('version_update_channel', 'stable'), ('webinterface_access_count', '0'), ('webinterface_access_last', '0'), ('webinterface_admin_client_unique_id_list', ''), ('webinterface_advanced_mode', '0'), ('webinterface_fresh_installation', '1'), ('webinterface_pass', '{$pass}'), ('webinterface_user', '{$user}');") === false) { $err_msg = $lang['isntwidbmsg'].$mysqlcon->errorCode()." ".print_r($mysqlcon->errorInfo(), true); $err_lvl = 2; } else { $err_msg = $lang['isntwiusr'].'

'; @@ -404,16 +408,6 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms } } -function error_handling($lang,$msg,$type = NULL) { - switch ($type) { - case NULL: echo '
'; break; - case 1: echo '
'; break; - case 2: echo '
'; break; - case 3: echo '
'; break; - } - echo '',$msg,'
'; -} - if ((!isset($_POST['install']) && !isset($_POST['confweb'])) || $err_lvl == 1 || $err_lvl == 2 || $err_lvl == 3) { if(isset($show_warning)) { $dbhost = $_POST['dbhost']; @@ -433,7 +427,7 @@ function error_handling($lang,$msg,$type = NULL) { } ?>
- +
@@ -629,7 +623,7 @@ function error_handling($lang,$msg,$type = NULL) { } elseif(isset($install_webuser)) { ?>
- +
@@ -691,7 +685,7 @@ function error_handling($lang,$msg,$type = NULL) { } elseif(isset($install_finished)) { ?>
- +
diff --git a/jobs/bot.php b/jobs/bot.php index e5418ae..eb5de43 100644 --- a/jobs/bot.php +++ b/jobs/bot.php @@ -13,57 +13,23 @@ $memory_limit = "{none set}"; } set_time_limit(0); +error_reporting(E_ALL); +ini_set("log_errors", 1); -function shutdown($mysqlcon = NULL,$cfg,$loglevel,$reason,$nodestroypid = TRUE) { - if($nodestroypid === TRUE) { - if (file_exists(substr(__DIR__,0,-4).'logs/pid')) { - unlink(substr(__DIR__,0,-4).'logs/pid'); - } - } - enter_logfile($cfg,$loglevel,$reason." Shutting down!"); - enter_logfile($cfg,9,"###################################################################"); - if(isset($mysqlcon)) { - $mysqlcon = null; - } - exit; -} +require_once(substr(__DIR__,0,-4).'other/_functions.php'); +require_once(substr(__DIR__,0,-4).'other/config.php'); +$lang = set_language(get_language($cfg)); -function enter_logfile($cfg,$loglevel,$logtext,$norotate = false) { - if($loglevel!=9 && $loglevel > $cfg['logs_debug_level']) return; - $file = $cfg['logs_path'].'ranksystem.log'; - switch ($loglevel) { - case 1: $loglevel = " CRITICAL "; break; - case 2: $loglevel = " ERROR "; break; - case 3: $loglevel = " WARNING "; break; - case 4: $loglevel = " NOTICE "; break; - case 5: $loglevel = " INFO "; break; - case 6: $loglevel = " DEBUG "; break; - default:$loglevel = " NONE "; - } - $loghandle = fopen($file, 'a'); - fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n"); - fclose($loghandle); - if($norotate == false && filesize($file) > ($cfg['logs_rotation_size'] * 1048576)) { - $loghandle = fopen($file, 'a'); - fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n"); - fclose($loghandle); - $file2 = "$file.old"; - if(file_exists($file2)) unlink($file2); - rename($file, $file2); - $loghandle = fopen($file, 'a'); - fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s.u ")." NOTICE Rotated logfile...\n"); - fclose($loghandle); - } -} +set_error_handler("php_error_handling"); +ini_set("error_log", $cfg['logs_path'].'ranksystem.log'); -require_once(substr(__DIR__,0,-4).'other/config.php'); require_once(substr(__DIR__,0,-4).'other/phpcommand.php'); if(isset($_SERVER['HTTP_HOST']) || isset($_SERVER['REMOTE_ADDR'])) { shutdown($mysqlcon,$cfg,1,"Request to start the Ranksystem from ".$_SERVER['REMOTE_ADDR'].". It seems the request came not from the command line!"); } -if(version_compare(phpversion(), '5.5.0', '<')) { - shutdown($mysqlcon,$cfg,1,"Your PHP version (".phpversion().") is below 5.5.0. Update of PHP is required!"); +if(version_compare(PHP_VERSION, '5.5.0', '<')) { + shutdown($mysqlcon,$cfg,1,"Your PHP version (".PHP_VERSION.") is below 5.5.0. Update of PHP is required!"); } if(!function_exists('simplexml_load_file')) { shutdown($mysqlcon,$cfg,1,sprintf($lang['errphp'],'PHP SimpleXML')); @@ -77,9 +43,7 @@ function enter_logfile($cfg,$loglevel,$logtext,$norotate = false) { if(!in_array('mbstring', get_loaded_extensions())) { shutdown($mysqlcon,$cfg,1,sprintf($lang['errphp'],'PHP mbstring')); } -if(!in_array('ssh2', get_loaded_extensions()) && $cfg['teamspeak_query_encrypt_switch'] == 1) { - shutdown($mysqlcon,$cfg,1,"PHP SSH2 is missed. Installation of PHP SSH2 is required, when using secured (SSH) connection to TeamSpeak! If you are not able to install PHP SSH2 (i.e. hosted webspace), you need to deactivate the TS3 Query encryption inside the Webinterface."); -} + enter_logfile($cfg,9,""); enter_logfile($cfg,9,"###################################################################"); @@ -98,27 +62,25 @@ function enter_logfile($cfg,$loglevel,$logtext,$norotate = false) { require_once(substr(__DIR__,0,-4).'jobs/event_userenter.php'); require_once(substr(__DIR__,0,-4).'jobs/update_rs.php'); require_once(substr(__DIR__,0,-4).'jobs/reset_rs.php'); +require_once(substr(__DIR__,0,-4).'jobs/db_ex_imp.php'); enter_logfile($cfg,9,"Running on OS: ".php_uname("s")." ".php_uname("r")); -enter_logfile($cfg,9,"Using PHP Version: ".phpversion()); +enter_logfile($cfg,9,"Using PHP Version: ".PHP_VERSION); +if(version_compare(PHP_VERSION, '7.2.0', '<')) { + enter_logfile($cfg,3,"Your PHP Version: (".PHP_VERSION.") is outdated and no longer supported. Please update it!"); +} enter_logfile($cfg,9,"Database Version: ".$mysqlcon->getAttribute(PDO::ATTR_SERVER_VERSION)); -$cfg = check_db($mysqlcon,$lang,$cfg,$dbname); +check_db($mysqlcon,$lang,$cfg,$dbname); $cfg['temp_db_version'] = $mysqlcon->getAttribute(PDO::ATTR_SERVER_VERSION); $cfg['temp_last_botstart'] = time(); $cfg['temp_reconnect_attempts'] = 0; +$cfg['temp_ts_no_reconnection'] = 0; enter_logfile($cfg,4,"Check Ranksystem files for updates..."); if(isset($cfg['version_current_using']) && isset($cfg['version_latest_available']) && $cfg['version_latest_available'] != NULL && version_compare($cfg['version_latest_available'], $cfg['version_current_using'], '>')) { update_rs($mysqlcon,$lang,$cfg,$dbname,$phpcommand); } enter_logfile($cfg,4,"Check Ranksystem files for updates [done]"); - -function check_shutdown($cfg) { - if(!file_exists(substr(__DIR__,0,-4).'logs/pid')) { - shutdown(NULL,$cfg,4,"Received signal to stop!"); - } -} - enter_logfile($cfg,9,"Ranksystem Version: ".$cfg['version_current_using']." (on Update-Channel: ".$cfg['version_update_channel'].")"); enter_logfile($cfg,4,"Loading addons..."); require_once(substr(__DIR__,0,-4).'other/load_addons_config.php'); @@ -133,291 +95,228 @@ function check_shutdown($cfg) { } enter_logfile($cfg,4,"Loading addons [done]"); -function sendmessage($ts3, $cfg, $uuid, $targetmode, $targetid=NULL, $msg, $erromsg=NULL, $loglevel=NULL, $successmsg=NULL, $nolog=NULL) { - try { - if(strlen($msg) > 1024) { - $fragarr = explode("##*##", wordwrap($msg, 1022, "##*##", TRUE), 1022); - foreach($fragarr as $frag) { - usleep($cfg['teamspeak_query_command_delay']); - if ($targetmode==2 && $targetid!=NULL) { - $ts3->serverGetSelected()->channelGetById($targetid)->message("\n".$frag); - if($nolog==NULL) enter_logfile($cfg,6,"sendmessage fragment to channel (ID: $targetid): ".$frag); - } elseif ($targetmode==3) { - $ts3->serverGetSelected()->message("\n".$frag); - if($nolog==NULL) enter_logfile($cfg,6,"sendmessage fragment to server: ".$frag); - } elseif ($targetmode==1 && $targetid!=NULL) { - $ts3->serverGetSelected()->clientGetById($targetid)->message("\n".$frag); - if($nolog==NULL) enter_logfile($cfg,6,"sendmessage fragment to connectionID $targetid (uuid $uuid): ".$frag); - } else { - $ts3->serverGetSelected()->clientGetByUid($uuid)->message("\n".$frag); - if($nolog==NULL) enter_logfile($cfg,6,"sendmessage fragment to uuid $uuid (connectionID $targetid): ".$frag); - } - } - } else { - usleep($cfg['teamspeak_query_command_delay']); - if ($targetmode==2 && $targetid!=NULL) { - $ts3->serverGetSelected()->channelGetById($targetid)->message($msg); - if($nolog==NULL) enter_logfile($cfg,6,"sendmessage to channel (ID: $targetid): ".$msg); - } elseif ($targetmode==3) { - $ts3->serverGetSelected()->message($msg); - if($nolog==NULL) enter_logfile($cfg,6,"sendmessage to server: ".$msg); - } elseif ($targetmode==1 && $targetid!=NULL) { - $ts3->serverGetSelected()->clientGetById($targetid)->message($msg); - if($nolog==NULL) enter_logfile($cfg,6,"sendmessage to connectionID $targetid (uuid $uuid): ".$msg); - } else { - $ts3->serverGetSelected()->clientGetByUid($uuid)->message($msg); - if($nolog==NULL) enter_logfile($cfg,6,"sendmessage to uuid $uuid (connectionID $targetid): ".$msg); - } - - } - if($successmsg!=NULL) { - enter_logfile($cfg,5,$successmsg); - } - } catch (Exception $e) { - if($loglevel!=NULL) { - enter_logfile($cfg,$loglevel,$erromsg." TS3: ".$e->getCode().': '.$e->getMessage()); - } else { - enter_logfile($cfg,3,"sendmessage: ".$e->getCode().': '.$e->getMessage().", targetmode: $targetmode, targetid: $targetid"); - } - } -} - -function mime2extension($mimetype) { - $mimearr = [ - 'image/bmp' => 'bmp', - 'image/x-bmp' => 'bmp', - 'image/x-bitmap' => 'bmp', - 'image/x-xbitmap' => 'bmp', - 'image/x-win-bitmap' => 'bmp', - 'image/x-windows-bmp' => 'bmp', - 'image/ms-bmp' => 'bmp', - 'image/x-ms-bmp' => 'bmp', - 'image/gif' => 'gif', - 'image/jpeg' => 'jpg', - 'image/pjpeg' => 'jpg', - 'image/x-portable-bitmap' => 'pbm', - 'image/x-portable-graymap' => 'pgm', - 'image/png' => 'png', - 'image/x-png' => 'png', - 'image/x-portable-pixmap' => 'ppm', - 'image/svg+xml' => 'svg', - 'image/x-xbitmap' => 'xbm', - 'image/x-xpixmap' => 'xpm' - ]; - return isset($mimearr[$mimetype]) ? $mimearr[$mimetype] : FALSE; -} - -function run_bot() { - global $cfg, $mysqlcon, $dbname, $dbtype, $lang, $phpcommand, $addons_config, $max_execution_time, $memory_limit; +function run_bot(&$cfg) { + global $mysqlcon, $db, $dbname, $dbtype, $lang, $phpcommand, $addons_config, $max_execution_time, $memory_limit, $ts3server; enter_logfile($cfg,9,"Connect to TS3 Server (Address: \"".$cfg['teamspeak_host_address']."\" Voice-Port: \"".$cfg['teamspeak_voice_port']."\" Query-Port: \"".$cfg['teamspeak_query_port']."\" SSH: \"".$cfg['teamspeak_query_encrypt_switch']."\" Query-Slowmode: \"".number_format(($cfg['teamspeak_query_command_delay']/1000000),1)."\")."); - + try { - if($cfg['teamspeak_query_encrypt_switch'] == 1) { - $ts3host = TeamSpeak3::factory("serverquery://".rawurlencode($cfg['teamspeak_query_user']).":".rawurlencode($cfg['teamspeak_query_pass'])."@".$cfg['teamspeak_host_address'].":".$cfg['teamspeak_query_port']."/?ssh=1"); - } else { - $ts3host = TeamSpeak3::factory("serverquery://".rawurlencode($cfg['teamspeak_query_user']).":".rawurlencode($cfg['teamspeak_query_pass'])."@".$cfg['teamspeak_host_address'].":".$cfg['teamspeak_query_port']."/?blocking=0"); + if($mysqlcon->exec("DROP INDEX `snapshot_id` ON `$dbname`.`user_snapshot` (`id`)") === false) { } else { + enter_logfile($cfg,4," [1.3.13] Dropped unneeded Index snapshot_id on table user_snapshot."); } - - enter_logfile($cfg,9,"Connection to TS3 Server established."); - try{ - $ts3version = $ts3host->version(); - enter_logfile($cfg,5," TS3 Server version: ".$ts3version['version']." on ".$ts3version['platform']." [Build: ".$ts3version['build']." from ".date("Y-m-d H:i:s",$ts3version['build'])."]"); - $cfg['temp_ts_version'] = $ts3version['version']; - } catch (Exception $e) { - enter_logfile($cfg,2," Error due getting TS3 server version - ".$e->getCode().': '.$e->getMessage()); - } - - if(version_compare($ts3version['version'],'3.11.9','<=')) { - enter_logfile($cfg,3," Your TS3 server is outdated, please update it!"); + if($mysqlcon->exec("DROP INDEX `snapshot_cldbid` ON `$dbname`.`user_snapshot` (`cldbid`)") === false) { } else { + enter_logfile($cfg,4," [1.3.13] Dropped unneeded Index snapshot_cldbid on table user_snapshot."); } + } catch (Exception $e) { } - enter_logfile($cfg,9," Select virtual server..."); - try { - if(version_compare($ts3version['version'],'3.4.0','>=')) { - usleep($cfg['teamspeak_query_command_delay']); - $ts3server = $ts3host->serverGetByPort($cfg['teamspeak_voice_port'], $cfg['teamspeak_query_nickname']); + try { + if($cfg['temp_ts_no_reconnection'] != 1) { + if($cfg['teamspeak_query_encrypt_switch'] == 1) { + $ts3host = TeamSpeak3::factory("serverquery://".rawurlencode($cfg['teamspeak_query_user']).":".rawurlencode($cfg['teamspeak_query_pass'])."@".$cfg['teamspeak_host_address'].":".$cfg['teamspeak_query_port']."/?ssh=1"); } else { - usleep($cfg['teamspeak_query_command_delay']); - $ts3server = $ts3host->serverGetByPort($cfg['teamspeak_voice_port']); - for ($updcld = 0; $updcld < 10; $updcld++) { - try { - usleep($cfg['teamspeak_query_command_delay']); - if($updcld == 0) { - $ts3server->selfUpdate(array('client_nickname' => $cfg['teamspeak_query_nickname'])); - } else { - $ts3server->selfUpdate(array('client_nickname' => $cfg['teamspeak_query_nickname'].$updcld)); + $ts3host = TeamSpeak3::factory("serverquery://".rawurlencode($cfg['teamspeak_query_user']).":".rawurlencode($cfg['teamspeak_query_pass'])."@".$cfg['teamspeak_host_address'].":".$cfg['teamspeak_query_port']."/?blocking=0"); + } + + enter_logfile($cfg,9,"Connection to TS3 Server established."); + try{ + $ts3version = $ts3host->version(); + enter_logfile($cfg,5," TS3 Server version: ".$ts3version['version']." on ".$ts3version['platform']." [Build: ".$ts3version['build']." from ".date("Y-m-d H:i:s",$ts3version['build'])."]"); + $cfg['temp_ts_version'] = $ts3version['version']; + } catch (Exception $e) { + enter_logfile($cfg,2," Error due getting TS3 server version - ".$e->getCode().': '.$e->getMessage()); + } + + if(version_compare($ts3version['version'],'3.12.9','<=') && version_compare($ts3version['version'],'3.0.0','>=')) { + enter_logfile($cfg,3," Your TS3 server is outdated, please update it!"); + } + + enter_logfile($cfg,9," Select virtual server..."); + try { + if(version_compare($ts3version['version'],'3.4.0','>=')) { + usleep($cfg['teamspeak_query_command_delay']); + $ts3server = $ts3host->serverGetByPort($cfg['teamspeak_voice_port'], $cfg['teamspeak_query_nickname']); + } else { + usleep($cfg['teamspeak_query_command_delay']); + $ts3server = $ts3host->serverGetByPort($cfg['teamspeak_voice_port']); + for ($updcld = 0; $updcld < 10; $updcld++) { + try { + usleep($cfg['teamspeak_query_command_delay']); + if($updcld == 0) { + $ts3server->selfUpdate(array('client_nickname' => $cfg['teamspeak_query_nickname'])); + } else { + $ts3server->selfUpdate(array('client_nickname' => $cfg['teamspeak_query_nickname'].$updcld)); + } + break; + } catch (Exception $e) { + enter_logfile($cfg,3,' '.$lang['errorts3'].$e->getCode().': '.$e->getMessage()); + shutdown($mysqlcon,$cfg,1,"Critical TS3 error on core function!"); } - break; - } catch (Exception $e) { - enter_logfile($cfg,3,' '.$lang['errorts3'].$e->getCode().': '.$e->getMessage()); - shutdown($mysqlcon,$cfg,1,"Critical TS3 error on core function!"); } } + enter_logfile($cfg,9," Select virtual server [done]"); + $cfg['temp_reconnect_attempts'] = 0; + } catch (Exception $e) { + enter_logfile($cfg,2," Error due selecting virtual server - ".$e->getCode().': '.$e->getMessage()." (bad Voice-Port or Bot name?)"); } - enter_logfile($cfg,9," Select virtual server [done]"); - $cfg['temp_reconnect_attempts'] = 0; - } catch (Exception $e) { - enter_logfile($cfg,2," Error due selecting virtual server - ".$e->getCode().': '.$e->getMessage()." (bad Voice-Port or Bot name?)"); - } - try { - usleep($cfg['teamspeak_query_command_delay']); - $ts3server->notifyRegister("server"); - $ts3server->notifyRegister("textprivate"); - $ts3server->notifyRegister("textchannel"); - $ts3server->notifyRegister("textserver"); - TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyTextmessage", "handle_messages"); - TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyCliententerview", "event_userenter"); - } catch (Exception $e) { - enter_logfile($cfg,2," Error due notifyRegister on TS3 server - ".$e->getCode().': '.$e->getMessage()); - } - - $whoami = $ts3server->whoami(); - if($cfg['teamspeak_default_channel_id'] != 0) { try { usleep($cfg['teamspeak_query_command_delay']); - $ts3server->clientMove($whoami['client_id'],$cfg['teamspeak_default_channel_id']); - enter_logfile($cfg,5," Joined to specified TS channel with channel-ID ".$cfg['teamspeak_default_channel_id']."."); + $ts3server->notifyRegister("server"); + $ts3server->notifyRegister("textprivate"); + $ts3server->notifyRegister("textchannel"); + $ts3server->notifyRegister("textserver"); + TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyTextmessage", "handle_messages"); + TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyCliententerview", "event_userenter"); } catch (Exception $e) { - if($e->getCode() != 770) { - enter_logfile($cfg,2," Could not join specified TS channel (channel-ID: ".$cfg['teamspeak_default_channel_id'].") - ".$e->getCode().': '.$e->getMessage()); - } else { - enter_logfile($cfg,5," Joined to specified TS channel with channel-ID ".$cfg['teamspeak_default_channel_id']." (already member of it)."); - } + enter_logfile($cfg,2," Error due notifyRegister on TS3 server - ".$e->getCode().': '.$e->getMessage()); } - } else { - enter_logfile($cfg,5," No channel defined where the Ranksystem Bot should be entered."); - } - - enter_logfile($cfg,9,"Config check started..."); - switch ($cfg['logs_debug_level']) { - case 1: - $loglevel = "1 - CRITICAL"; - break; - case 2: - $loglevel = "2 - ERROR"; - break; - case 3: - $loglevel = "3 - WARNING"; - break; - case 4: - $loglevel = "4 - NOTICE"; - break; - case 5: - $loglevel = "5 - INFO"; - break; - case 6: - $loglevel = "6 - DEBUG"; - break; - default: - $loglevel = "UNKNOWN"; - } - enter_logfile($cfg,9," Log Level: ".$loglevel); - enter_logfile($cfg,6," Serverside config 'max_execution_time' (PHP.ini): ".$max_execution_time." sec."); - enter_logfile($cfg,6," Serverside config 'memory_limit' (PHP.ini): ".$memory_limit); - krsort($cfg['rankup_definition']); - if(($groupslist = $mysqlcon->query("SELECT * FROM `$dbname`.`groups`")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - enter_logfile($cfg,1," Select on DB failed for group check: ".print_r($mysqlcon->errorInfo(), true)); - } - - $checkgroups = 0; - if(isset($groupslist) && $groupslist != NULL) { - if(isset($cfg['rankup_definition']) && $cfg['rankup_definition'] != NULL) { - foreach($cfg['rankup_definition'] as $rank) { - if(!isset($groupslist[$rank['group']]) && $rank['group'] != NULL) { - $checkgroups++; + $whoami = $ts3server->whoami(); + if(isset($cfg['teamspeak_default_channel_id']) && $cfg['teamspeak_default_channel_id'] != 0 && $cfg['teamspeak_default_channel_id'] != '') { + try { + usleep($cfg['teamspeak_query_command_delay']); + $ts3server->clientMove($whoami['client_id'],$cfg['teamspeak_default_channel_id']); + enter_logfile($cfg,5," Joined to specified TS channel with channel-ID ".$cfg['teamspeak_default_channel_id']."."); + } catch (Exception $e) { + if($e->getCode() != 770) { + enter_logfile($cfg,2," Could not join specified TS channel (channel-ID: ".$cfg['teamspeak_default_channel_id'].") - ".$e->getCode().': '.$e->getMessage()); + } else { + enter_logfile($cfg,5," Joined to specified TS channel with channel-ID ".$cfg['teamspeak_default_channel_id']." (already member of it)."); } } - } - if(isset($cfg['rankup_boost_definition']) && $cfg['rankup_boost_definition'] != NULL) { - foreach($cfg['rankup_boost_definition'] as $groupid => $value) { - if(!isset($groupslist[$groupid]) && $groupid != NULL) { - $checkgroups++; - } - } - } - if(isset($cfg['rankup_excepted_group_id_list']) && $cfg['rankup_excepted_group_id_list'] != NULL) { - foreach($cfg['rankup_excepted_group_id_list'] as $groupid => $value) { - if(!isset($groupslist[$groupid]) && $groupid != NULL) { - $checkgroups++; - } - } - } - } - if($checkgroups > 0) { - enter_logfile($cfg,3," Found servergroups in config, which are unknown. Redownload all servergroups from TS3 server."); - if($mysqlcon->exec("DELETE FROM `$dbname`.`groups`;") === false) { - enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } else { + enter_logfile($cfg,5," No channel defined where the Ranksystem Bot should be entered."); } - $serverinfo = $ts3server->serverInfo(); - $select_arr = array(); - $db_cache = array(); - $sqlexec2 .= update_groups($ts3server,$mysqlcon,$lang,$cfg,$dbname,$serverinfo,$db_cache,1); - if($mysqlcon->exec($sqlexec2) === false) { - enter_logfile($cfg,2,"Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + enter_logfile($cfg,9,"Config check started..."); + switch ($cfg['logs_debug_level']) { + case 1: + $loglevel = "1 - CRITICAL"; + break; + case 2: + $loglevel = "2 - ERROR"; + break; + case 3: + $loglevel = "3 - WARNING"; + break; + case 4: + $loglevel = "4 - NOTICE"; + break; + case 5: + $loglevel = "5 - INFO"; + break; + case 6: + $loglevel = "6 - DEBUG"; + break; + default: + $loglevel = "UNKNOWN"; } - unset($sqlexec2,$select_arr,$db_cache,$groupslist,$serverinfo,$ts3version); - $errcnf = 0; - enter_logfile($cfg,4," Downloading of servergroups finished. Recheck the config."); - + enter_logfile($cfg,9," Log Level: ".$loglevel); + enter_logfile($cfg,6," Serverside config 'max_execution_time' (PHP.ini): ".$max_execution_time." sec."); + enter_logfile($cfg,6," Serverside config 'memory_limit' (PHP.ini): ".$memory_limit); + krsort($cfg['rankup_definition']); + if(($groupslist = $mysqlcon->query("SELECT * FROM `$dbname`.`groups`")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { enter_logfile($cfg,1," Select on DB failed for group check: ".print_r($mysqlcon->errorInfo(), true)); } + $checkgroups = 0; if(isset($groupslist) && $groupslist != NULL) { if(isset($cfg['rankup_definition']) && $cfg['rankup_definition'] != NULL) { foreach($cfg['rankup_definition'] as $rank) { if(!isset($groupslist[$rank['group']]) && $rank['group'] != NULL) { - enter_logfile($cfg,1,' '.sprintf($lang['upgrp0001'], $rank['group'], $lang['wigrptime'])); - $errcnf++; + $checkgroups++; } } } if(isset($cfg['rankup_boost_definition']) && $cfg['rankup_boost_definition'] != NULL) { foreach($cfg['rankup_boost_definition'] as $groupid => $value) { if(!isset($groupslist[$groupid]) && $groupid != NULL) { - enter_logfile($cfg,2,' '.sprintf($lang['upgrp0001'], $groupid, $lang['wiboost'])); + $checkgroups++; } } } if(isset($cfg['rankup_excepted_group_id_list']) && $cfg['rankup_excepted_group_id_list'] != NULL) { foreach($cfg['rankup_excepted_group_id_list'] as $groupid => $value) { if(!isset($groupslist[$groupid]) && $groupid != NULL) { - enter_logfile($cfg,2,' '.sprintf($lang['upgrp0001'], $groupid, $lang['wiexgrp'])); + $checkgroups++; } } } } - if($errcnf > 0) { - shutdown($mysqlcon,$cfg,1,"Critical Config error!"); - } else { - enter_logfile($cfg,4," No critical problems found! All seems to be fine..."); + if($checkgroups > 0) { + enter_logfile($cfg,3," Found servergroups in config, which are unknown. Redownload all servergroups from TS3 server."); + if($mysqlcon->exec("DELETE FROM `$dbname`.`groups`;") === false) { + enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } + + $serverinfo = $ts3server->serverInfo(); + $select_arr = array(); + $db_cache = array(); + $sqlexec2 .= update_groups($ts3server,$mysqlcon,$lang,$cfg,$dbname,$serverinfo,$db_cache,1); + if($mysqlcon->exec($sqlexec2) === false) { + enter_logfile($cfg,2,"Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } + unset($sqlexec2,$select_arr,$db_cache,$groupslist,$serverinfo,$ts3version); + $errcnf = 0; + enter_logfile($cfg,4," Downloading of servergroups finished. Recheck the config."); + + if(($groupslist = $mysqlcon->query("SELECT * FROM `$dbname`.`groups`")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + enter_logfile($cfg,1," Select on DB failed for group check: ".print_r($mysqlcon->errorInfo(), true)); + } + + if(isset($groupslist) && $groupslist != NULL) { + if(isset($cfg['rankup_definition']) && $cfg['rankup_definition'] != NULL) { + foreach($cfg['rankup_definition'] as $rank) { + if(!isset($groupslist[$rank['group']]) && $rank['group'] != NULL) { + enter_logfile($cfg,1,' '.sprintf($lang['upgrp0001'], $rank['group'], $lang['wigrptime'])); + $errcnf++; + } + } + } + if(isset($cfg['rankup_boost_definition']) && $cfg['rankup_boost_definition'] != NULL) { + foreach($cfg['rankup_boost_definition'] as $groupid => $value) { + if(!isset($groupslist[$groupid]) && $groupid != NULL) { + enter_logfile($cfg,2,' '.sprintf($lang['upgrp0001'], $groupid, $lang['wiboost'])); + } + } + } + if(isset($cfg['rankup_excepted_group_id_list']) && $cfg['rankup_excepted_group_id_list'] != NULL) { + foreach($cfg['rankup_excepted_group_id_list'] as $groupid => $value) { + if(!isset($groupslist[$groupid]) && $groupid != NULL) { + enter_logfile($cfg,2,' '.sprintf($lang['upgrp0001'], $groupid, $lang['wiexgrp'])); + } + } + } + } + if($errcnf > 0) { + shutdown($mysqlcon,$cfg,1,"Critical Config error!"); + } else { + enter_logfile($cfg,4," No critical problems found! All seems to be fine..."); + } } - } - if(($lastupdate = $mysqlcon->query("SELECT `timestamp` FROM `$dbname`.`job_check` WHERE `job_name`='last_update'")->fetch()) === false) { - enter_logfile($cfg,1," Select on DB failed for job check: ".print_r($mysqlcon->errorInfo(), true)); - } else { - if($lastupdate['timestamp'] != 0 && ($lastupdate['timestamp'] + 10) > time()) { - if(isset($cfg['webinterface_admin_client_unique_id_list']) && $cfg['webinterface_admin_client_unique_id_list'] != NULL) { - foreach(array_flip($cfg['webinterface_admin_client_unique_id_list']) as $clientuuid) { - sendmessage($ts3server, $cfg, $clientuuid, NULL, sprintf($lang['upmsg2'], $cfg['version_current_using'], 'https://ts-ranksystem.com/#changelog'), sprintf($lang['upusrerr'], $clientuuid), 6, sprintf($lang['upusrinf'], $clientuuid)); + if(($lastupdate = $mysqlcon->query("SELECT `timestamp` FROM `$dbname`.`job_check` WHERE `job_name`='last_update'")->fetch()) === false) { + enter_logfile($cfg,1," Select on DB failed for job check: ".print_r($mysqlcon->errorInfo(), true)); + } else { + if($lastupdate['timestamp'] != 0 && ($lastupdate['timestamp'] + 10) > time()) { + if(isset($cfg['webinterface_admin_client_unique_id_list']) && $cfg['webinterface_admin_client_unique_id_list'] != NULL) { + foreach(array_flip($cfg['webinterface_admin_client_unique_id_list']) as $clientuuid) { + sendmessage($ts3server, $cfg, $clientuuid, sprintf($lang['upmsg2'], $cfg['version_current_using'], 'https://ts-ranksystem.com/#changelog'), 1, NULL, sprintf($lang['upusrerr'], $clientuuid), 6, sprintf($lang['upusrinf'], $clientuuid)); + } } } } - } - if($cfg['webinterface_fresh_installation'] == 1) { - if($mysqlcon->exec("UPDATE `$dbname`.`cfg_params` SET `value`=0 WHERE `param`='webinterface_fresh_installation'") === false) { - enter_logfile($cfg,2,"Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + if(isset($cfg['webinterface_fresh_installation']) && $cfg['webinterface_fresh_installation'] == 1) { + if($mysqlcon->exec("UPDATE `$dbname`.`cfg_params` SET `value`=0 WHERE `param`='webinterface_fresh_installation'") === false) { + enter_logfile($cfg,2,"Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } } - } - unset($groupslist,$errcnf,$checkgroups,$lastupdate,$updcld,$loglevel,$whoami,$ts3host,$max_execution_time,$memory_limit,$memory_limit); - enter_logfile($cfg,9,"Config check [done]"); + unset($groupslist,$errcnf,$checkgroups,$lastupdate,$updcld,$loglevel,$whoami,$ts3host,$max_execution_time,$memory_limit,$memory_limit); + enter_logfile($cfg,9,"Config check [done]"); + } enter_logfile($cfg,9,"Bot starts now his work!"); $looptime = $cfg['temp_count_laps'] = $cfg['temp_whole_laptime'] = $cfg['temp_count_laptime'] = 0; $cfg['temp_last_laptime'] = ''; @@ -547,6 +446,7 @@ function run_bot() { enter_logfile($cfg,6,"SQL executions needs: ".(number_format(round((microtime(true) - $startsql), 5),5))); reset_rs($ts3server,$mysqlcon,$lang,$cfg,$dbname,$db_cache); + db_ex_imp($ts3server,$mysqlcon,$lang,$cfg,$dbname,$db_cache); unset($sqlexec,$select_arr,$sqldump); @@ -559,7 +459,7 @@ function run_bot() { if($looptime < 1) { $loopsleep = (1 - $looptime); - if($cfg['teamspeak_query_encrypt_switch'] == 1 || version_compare($ts3version['version'],'1.4.0','>=') && version_compare($ts3version['version'],'2.9.9','<=')) { + if($cfg['teamspeak_query_encrypt_switch'] == 1 || version_compare($cfg['temp_ts_version'],'1.4.0','>=') && version_compare($cfg['temp_ts_version'],'2.9.9','<=')) { // no wait for data to become available on the stream on SSH due issues with non-blocking mode or TeaSpeak usleep(round($loopsleep * 1000000)); } else { @@ -568,13 +468,13 @@ function run_bot() { } } } catch (Exception $e) { - enter_logfile($cfg,2,$lang['errorts3'].$e->getCode().': '.$e->getMessage()); + enter_logfile($cfg,2,$lang['error'].': ['.$e->getCode().']: '.$e->getMessage()); if(in_array($e->getCode(), array(110,257,258,1024,1026,1031,1032,1033,1034,1280,1793))) { if($mysqlcon->exec("UPDATE $dbname.stats_server SET server_status='0'") === false) { enter_logfile($cfg,2,$lang['error'].print_r($mysqlcon->errorInfo(), true)); } } - + if($cfg['temp_last_botstart'] < (time() - 10)) { if($cfg['temp_reconnect_attempts'] < 4) { $wait_reconnect = 5; @@ -597,8 +497,18 @@ function run_bot() { check_shutdown($cfg); } + if(in_array($e->getCode(), array('HY000','10054','70100','8'))) { + $cfg['temp_ts_no_reconnection'] = 1; + try { + $mysqlcon = db_connect($db['type'], $db['host'], $db['dbname'], $db['user'], $db['pass'], "no_exit"); + enter_logfile($cfg,9,"Connection to database restored"); + } catch (Exception $e) { + enter_logfile($cfg,2,$lang['error'].print_r($mysqlcon->errorInfo(), true)); + } + } + $cfg['temp_reconnect_attempts'] = $cfg['temp_reconnect_attempts'] + 1; - return $cfg; + return $ts3server; } else { shutdown($mysqlcon,$cfg,1,"Critical TS3 error on core function!"); } @@ -606,6 +516,6 @@ function run_bot() { } while(1) { - run_bot(); + run_bot($cfg); } ?> \ No newline at end of file diff --git a/jobs/calc_serverstats.php b/jobs/calc_serverstats.php index 24185f6..756a810 100644 --- a/jobs/calc_serverstats.php +++ b/jobs/calc_serverstats.php @@ -4,7 +4,7 @@ function calc_serverstats($ts3,$mysqlcon,&$cfg,$dbname,$dbtype,$serverinfo,&$db_ $nowtime = time(); $sqlexec = ''; - if($db_cache['job_check']['calc_donut_chars']['timestamp'] < ($nowtime - 8)) { + if($db_cache['job_check']['calc_donut_chars']['timestamp'] < ($nowtime - 8) || $db_cache['job_check']['get_version']['timestamp'] < ($nowtime - 43199)) { $db_cache['job_check']['calc_donut_chars']['timestamp'] = $nowtime; $sqlexec .= "UPDATE `$dbname`.`job_check` SET `timestamp`={$nowtime} WHERE `job_name`='calc_donut_chars';\n"; @@ -12,6 +12,10 @@ function calc_serverstats($ts3,$mysqlcon,&$cfg,$dbname,$dbtype,$serverinfo,&$db_ $country_array = $platform_array = $count_version_user = array(); foreach($db_cache['all_user'] as $uuid) { + $nation = (string)$uuid['nation']; + $platform = (string)$uuid['platform']; + $version = (string)$uuid['version']; + if ($uuid['lastseen']>($nowtime-86400)) { $user_quarter++; $user_month++; $user_week++; $user_today++; } elseif ($uuid['lastseen']>($nowtime-604800)) { @@ -22,22 +26,22 @@ function calc_serverstats($ts3,$mysqlcon,&$cfg,$dbname,$dbtype,$serverinfo,&$db_ $user_quarter++; } - if(isset($country_array[$uuid['nation']])) { - $country_array[$uuid['nation']]++; + if(isset($country_array[$nation])) { + $country_array[$nation]++; } else { - $country_array[$uuid['nation']] = 1; + $country_array[$nation] = 1; } - if(isset($platform_array[$uuid['platform']])) { - $platform_array[$uuid['platform']]++; + if(isset($platform_array[$platform])) { + $platform_array[$platform]++; } else { - $platform_array[$uuid['platform']] = 1; + $platform_array[$platform] = 1; } - if(isset($count_version_user[$uuid['version']])) { - $count_version_user[$uuid['version']]++; + if(isset($count_version_user[$version])) { + $count_version_user[$version]++; } else { - $count_version_user[$uuid['version']] = 1; + $count_version_user[$version] = 1; } $total_online_time = $total_online_time + $uuid['count']; @@ -424,7 +428,7 @@ function calc_serverstats($ts3,$mysqlcon,&$cfg,$dbname,$dbtype,$serverinfo,&$db_ } } } - update_rs($mysqlcon,$lang,$cfg,$dbname,$phpcommand); + $sqlexec .= update_rs($mysqlcon,$lang,$cfg,$dbname,$phpcommand); } $sqlexec .= "UPDATE `$dbname`.`job_check` SET `timestamp`=$nowtime WHERE `job_name`='get_version';\nUPDATE `$dbname`.`cfg_params` SET `value`='{$cfg['version_latest_available']}' WHERE `param`='version_latest_available';\n"; } diff --git a/jobs/calc_user.php b/jobs/calc_user.php index 892d853..7be110e 100644 --- a/jobs/calc_user.php +++ b/jobs/calc_user.php @@ -26,68 +26,45 @@ function calc_user($ts3,$mysqlcon,$lang,$cfg,$dbname,$allclients,$phpcommand,&$d if(isset($db_cache['admin_addtime']) && count($db_cache['admin_addtime']) != 0) { foreach($db_cache['admin_addtime'] as $uuid => $value) { if(isset($db_cache['all_user'][$uuid])) { - $sqlexec2 = ''; $isonline = 0; foreach($allclients as $client) { if($client['client_unique_identifier'] == $uuid) { $isonline = 1; $temp_cldbid = $client['client_database_id']; - if($value['timecount'] < 0) { - $db_cache['all_user'][$uuid]['count'] += $value['timecount']; - if($db_cache['all_user'][$uuid]['count'] < 0) { - $db_cache['all_user'][$uuid]['count'] = 0; - $db_cache['all_user'][$uuid]['idle'] = 0; - } elseif ($db_cache['all_user'][$uuid]['idle'] > $db_cache['all_user'][$uuid]['count']) { - $db_cache['all_user'][$uuid]['idle'] = $db_cache['all_user'][$uuid]['count']; - } - } else { - $db_cache['all_user'][$uuid]['count'] += $value['timecount']; - } } } + $db_cache['all_user'][$uuid]['count'] += $value['timecount']; + if($db_cache['all_user'][$uuid]['count'] < 0) { + $db_cache['all_user'][$uuid]['count'] = $db_cache['all_user'][$uuid]['idle'] = 0; + } elseif ($db_cache['all_user'][$uuid]['idle'] > $db_cache['all_user'][$uuid]['count']) { + $db_cache['all_user'][$uuid]['idle'] = $db_cache['all_user'][$uuid]['count']; + } if($isonline != 1) { - if(($user = $mysqlcon->query("SELECT `uuid`,`count`,`idle`,`cldbid` FROM `$dbname`.`user` WHERE `uuid`='{$uuid}'")->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE)) === false) { + if(($user = $mysqlcon->query("SELECT `uuid`,`cldbid` FROM `$dbname`.`user` WHERE `uuid`='{$uuid}'")->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE)) === false) { enter_logfile($cfg,2,"Database error on selecting user (admin function remove/add time): ".print_r($mysqlcon->errorInfo(), true)); } else { $temp_cldbid = $user[$uuid]['cldbid']; - if($value['timecount'] < 0) { - $user[$uuid]['count'] += $value['timecount']; - if($user[$uuid]['count'] < 0) { - $user[$uuid]['count'] = 0; - $user[$uuid]['idle'] = 0; - } elseif ($user[$uuid]['idle'] > $user[$uuid]['count']) { - $user[$uuid]['idle'] = $user[$uuid]['count']; - } - } else { - $user[$uuid]['count'] += $value['timecount']; - } - $sqlexec2 .= "UPDATE `$dbname`.`user` SET `count`='{$user[$uuid]['count']}', `idle`='{$user[$uuid]['idle']}' WHERE `uuid`='{$uuid}'; "; + $sqlexec .= "UPDATE `$dbname`.`user` SET `count`='{$db_cache['all_user'][$uuid]['count']}', `idle`='{$db_cache['all_user'][$uuid]['idle']}' WHERE `uuid`='{$uuid}';\n"; } } - $sqlexec2 .= "DELETE FROM `$dbname`.`admin_addtime` WHERE `timestamp`=".$value['timestamp']." AND `uuid`='$uuid'; "; + if($mysqlcon->exec("DELETE FROM `$dbname`.`admin_addtime` WHERE `timestamp`=".$value['timestamp']." AND `uuid`='$uuid';") === false) { + enter_logfile($cfg,2,"Database error on updating user (admin function remove/add time): ".print_r($mysqlcon->errorInfo(), true)); + } if(($usersnap = $mysqlcon->query("SELECT `id`,`cldbid`,`count`,`idle` FROM `$dbname`.`user_snapshot` WHERE `cldbid`={$temp_cldbid}")->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE)) === false) { enter_logfile($cfg,2,"Database error on selecting user (admin function remove/add time): ".print_r($mysqlcon->errorInfo(), true)); } else { foreach($usersnap as $id => $valuesnap) { - if($value['timecount'] < 0) { - $valuesnap[$id]['count'] += $value['timecount']; - if($valuesnap[$id]['count'] < 0) { - $valuesnap[$id]['count'] = 0; - $valuesnap[$id]['idle'] = 0; - } elseif ($valuesnap[$id]['idle'] > $valuesnap[$id]['count']) { - $valuesnap[$id]['idle'] = $valuesnap[$id]['count']; - } - } else { - $valuesnap[$id]['count'] += $value['timecount']; + $valuesnap['count'] += $value['timecount']; + if($valuesnap['count'] < 0) { + $valuesnap['count'] = $valuesnap['idle'] = 0; + } elseif ($valuesnap['idle'] > $valuesnap['count']) { + $valuesnap['idle'] = $valuesnap['count']; } - $sqlexec2 .= "UPDATE `$dbname`.`user_snapshot` SET `count`='{$valuesnap[$id]['count']}', `idle`='{$valuesnap[$id]['idle']}' WHERE `cldbid`='{$temp_cldbid}' AND `id`='{$id}'; "; + $sqlexec .= "UPDATE `$dbname`.`user_snapshot` SET `count`='{$valuesnap['count']}', `idle`='{$valuesnap['idle']}' WHERE `cldbid`='{$temp_cldbid}' AND `id`='{$id}';\n"; } } - if($mysqlcon->exec($sqlexec2) === false) { - enter_logfile($cfg,2,"Database error on updating user (admin function remove/add time): ".print_r($mysqlcon->errorInfo(), true)); - } enter_logfile($cfg,4,sprintf($lang['sccupcount2'],$value['timecount'],$uuid)); - unset($sqlexec2, $user, $usersnap); + unset($user, $usersnap); } } unset($db_cache['admin_addtime']); @@ -95,7 +72,7 @@ function calc_user($ts3,$mysqlcon,$lang,$cfg,$dbname,$allclients,$phpcommand,&$d foreach ($allclients as $client) { $client_groups_rankup = array(); - $name = $mysqlcon->quote((mb_substr($client['client_nickname'],0,30)), ENT_QUOTES); + $name = $mysqlcon->quote((mb_substr(mb_convert_encoding($client['client_nickname'],'UTF-8','auto'),0,30)), ENT_QUOTES); $uid = htmlspecialchars($client['client_unique_identifier'], ENT_QUOTES); $sgroups = array_flip(explode(",", $client['client_servergroups'])); if(strlen($client['client_country']) > 2 || $client['client_country'] == '') $client['client_country'] = 'XX'; @@ -218,7 +195,7 @@ function calc_user($ts3,$mysqlcon,$lang,$cfg,$dbname,$allclients,$phpcommand,&$d $hours = $dtF->diff($dtT)->format('%h'); $mins = $dtF->diff($dtT)->format('%i'); $secs = $dtF->diff($dtT)->format('%s'); - sendmessage($ts3, $cfg, $uid, 1, NULL, sprintf($cfg['rankup_message_to_user'],$days,$hours,$mins,$secs,$db_cache['groups'][$rank['group']]['sgidname'],$client['client_nickname']), sprintf($lang['sgrprerr'], $name, $uid, $client['client_database_id'], $db_cache['groups'][$rank['group']]['sgidname'],$rank['group']), 2); + sendmessage($ts3, $cfg, $uid, sprintf($cfg['rankup_message_to_user'],$days,$hours,$mins,$secs,$db_cache['groups'][$rank['group']]['sgidname'],$client['client_nickname']), 1, NULL, sprintf($lang['sgrprerr'], $name, $uid, $client['client_database_id'], $db_cache['groups'][$rank['group']]['sgidname'],$rank['group']), 2); } } catch (Exception $e) { enter_logfile($cfg,2,"TS3 error: ".$e->getCode().': '.$e->getMessage()." ; ".sprintf($lang['sgrprerr'], $name, $uid, $client['client_database_id'], $db_cache['groups'][$rank['group']]['sgidname'], $rank['group'])); diff --git a/jobs/calc_userstats.php b/jobs/calc_userstats.php index c110941..e01a77c 100644 --- a/jobs/calc_userstats.php +++ b/jobs/calc_userstats.php @@ -5,15 +5,18 @@ function calc_userstats($ts3,$mysqlcon,$cfg,$dbname,&$db_cache) { $sqlexec = ''; $job_begin = $db_cache['job_check']['calc_user_limit']['timestamp']; - $job_end = ceil(count($db_cache['all_user']) / 10) * 10; - if ($job_begin >= $job_end) { + + $limit_calc = ceil(count($db_cache['all_user']) / 600); + if($limit_calc < 5) $limit_calc = 5; + + if ($job_begin >= (ceil(count($db_cache['all_user']) / $limit_calc) * $limit_calc)) { $job_begin = 0; - $job_end = 10; + $job_end = $limit_calc; } else { - $job_end = $job_begin + 10; + $job_end = $job_begin + $limit_calc; } - $sqlhis = array_slice($db_cache['all_user'],$job_begin ,10); + $sqlhis = array_slice($db_cache['all_user'],$job_begin ,$limit_calc); $cldbids = ''; foreach ($sqlhis as $uuid => $userstats) { @@ -23,8 +26,8 @@ function calc_userstats($ts3,$mysqlcon,$cfg,$dbname,&$db_cache) { $weekago = $db_cache['job_check']['last_snapshot_id']['timestamp'] - 28; $monthago = $db_cache['job_check']['last_snapshot_id']['timestamp'] - 120; - if ($weekago < 1) $weekago = $weekago + 121; - if ($monthago < 1) $monthago = $monthago + 121; + if ($weekago < 1) $weekago += 121; + if ($monthago < 1) $monthago += 121; if(isset($sqlhis) && $sqlhis != NULL) { enter_logfile($cfg,6,"Update User Stats between ".$job_begin." and ".$job_end.":"); @@ -35,79 +38,90 @@ function calc_userstats($ts3,$mysqlcon,$cfg,$dbname,&$db_cache) { $allupdateuuid = ''; foreach ($sqlhis as $uuid => $userstats) { - check_shutdown($cfg); usleep($cfg['teamspeak_query_command_delay']); + if($userstats['lastseen'] > ($nowtime - 2678400)) { + check_shutdown($cfg); usleep($cfg['teamspeak_query_command_delay']); - $keybase = array_search($db_cache['job_check']['last_snapshot_id']['timestamp'], array_column($userdata[$userstats['cldbid']], 'id')); - $keyweek = array_search($weekago, array_column($userdata[$userstats['cldbid']], 'id')); - $keymonth = array_search($monthago, array_column($userdata[$userstats['cldbid']], 'id')); + if(isset($userdata[$userstats['cldbid']]) && $userdata[$userstats['cldbid']] != NULL) { + $keybase = array_search($db_cache['job_check']['last_snapshot_id']['timestamp'], array_column($userdata[$userstats['cldbid']], 'id')); + $keyweek = array_search($weekago, array_column($userdata[$userstats['cldbid']], 'id')); + $keymonth = array_search($monthago, array_column($userdata[$userstats['cldbid']], 'id')); - if(isset($userdata[$userstats['cldbid']]) && isset($userdata[$userstats['cldbid']][$keyweek]) && $userdata[$userstats['cldbid']][$keyweek]['id'] == $weekago) { - $count_week = $userdata[$userstats['cldbid']][$keybase]['count'] - $userdata[$userstats['cldbid']][$keyweek]['count']; - $idle_week = $userdata[$userstats['cldbid']][$keybase]['idle'] - $userdata[$userstats['cldbid']][$keyweek]['idle']; - $active_week = $count_week - $idle_week; - } else { - $count_week = 0; - $idle_week = 0; - $active_week = 0; - } - if(isset($userdata[$userstats['cldbid']]) && isset($userdata[$userstats['cldbid']][$keymonth]) && $userdata[$userstats['cldbid']][$keymonth]['id'] == $monthago) { - $count_month = $userdata[$userstats['cldbid']][$keybase]['count'] - $userdata[$userstats['cldbid']][$keymonth]['count']; - $idle_month = $userdata[$userstats['cldbid']][$keybase]['idle'] - $userdata[$userstats['cldbid']][$keymonth]['idle']; - $active_month = $count_month - $idle_month; - } else { - $count_month = 0; - $idle_month = 0; - $active_month = 0; - } + if(isset($userdata[$userstats['cldbid']]) && isset($userdata[$userstats['cldbid']][$keyweek]) && $userdata[$userstats['cldbid']][$keyweek]['id'] == $weekago) { + $count_week = $userdata[$userstats['cldbid']][$keybase]['count'] - $userdata[$userstats['cldbid']][$keyweek]['count']; + $idle_week = $userdata[$userstats['cldbid']][$keybase]['idle'] - $userdata[$userstats['cldbid']][$keyweek]['idle']; + $active_week = $count_week - $idle_week; + if($count_week < 0 || $count_week < $idle_week) $count_week = 0; + if($idle_week < 0 || $count_week < $idle_week) $idle_week = 0; + if($active_week < 0 || $count_week < $idle_week) $active_week = 0; + } else { + $count_week = $idle_week = $active_week = 0; + } + if(isset($userdata[$userstats['cldbid']]) && isset($userdata[$userstats['cldbid']][$keymonth]) && $userdata[$userstats['cldbid']][$keymonth]['id'] == $monthago) { + $count_month = $userdata[$userstats['cldbid']][$keybase]['count'] - $userdata[$userstats['cldbid']][$keymonth]['count']; + $idle_month = $userdata[$userstats['cldbid']][$keybase]['idle'] - $userdata[$userstats['cldbid']][$keymonth]['idle']; + $active_month = $count_month - $idle_month; + if($idle_month < 0 || $count_month < $idle_month) $idle_month = 0; + if($count_month < 0 || $count_month < $idle_month) $count_month = 0; + if($active_month < 0 || $count_month < $idle_month) $active_month = 0; + } else { + $count_month = $idle_month = $active_month = 0; + } + } else { + $count_week = $idle_week = $active_week = $count_month = $idle_month = $active_month = 0; + } - try { - $clientinfo = $ts3->clientInfoDb($userstats['cldbid']); - $clientdesc = $mysqlcon->quote($clientinfo['client_description'], ENT_QUOTES); - if($clientinfo['client_totalconnections'] > 16777215) $clientinfo['client_totalconnections'] = 16777215; - } catch (Exception $e) { - if($e->getCode() == 512 || $e->getCode() == 1281) { - enter_logfile($cfg,6,"Client (uuid: ".$uuid." cldbid: ".$userstats['cldbid'].") known by Ranksystem is missing in TS database, perhaps its already deleted or cldbid changed. Try to search for client by uuid."); - try { - $getcldbid = $ts3->clientFindDb($uuid, TRUE); - if($getcldbid[0] != $userstats['cldbid']) { - enter_logfile($cfg,4," Client (uuid: ".$uuid." cldbid: ".$userstats['cldbid'].") known by the Ranksystem changed its cldbid. New cldbid is ".$getcldbid[0]."."); - if($cfg['rankup_client_database_id_change_switch'] == 1) { - $db_cache['all_user'][$uuid]['cldbid'] = $getcldbid[0]; - $sqlexec .= "UPDATE `$dbname`.`user` SET `count`=0,`idle`=0 WHERE `uuid`='$uuid';\nUPDATE `$dbname`.`stats_user` SET `count_week`=0,`count_month`=0,`idle_week`=0,`idle_month`=0,`active_week`=0,`active_month`=0 WHERE `uuid`='$uuid';\nDELETE FROM `$dbname`.`user_snapshot` WHERE `cldbid`='{$userstats['cldbid']}';\n"; - enter_logfile($cfg,4," ".sprintf($lang['changedbid'], $userstats['name'], $uuid, $userstats['cldbid'], $getcldbid[0])); - } else { - $sqlexec .= "UPDATE `$dbname`.`user` SET `cldbid`={$getcldbid[0]} WHERE `uuid`='$uuid';\n"; - // select current user_snapshot entries and insert this with the new database-ID - foreach($userdata[$userstats['cldbid']] as $id => $data) { - $allinsert .= "($id,'{$getcldbid[0]}',{$data['count']},{$data['idle']}),"; + try { + $clientinfo = $ts3->clientInfoDb($userstats['cldbid']); + $clientdesc = $mysqlcon->quote($clientinfo['client_description'], ENT_QUOTES); + if($clientinfo['client_totalconnections'] > 16777215) $clientinfo['client_totalconnections'] = 16777215; + } catch (Exception $e) { + if($e->getCode() == 512 || $e->getCode() == 1281) { + enter_logfile($cfg,6,"Client (uuid: ".$uuid." cldbid: ".$userstats['cldbid'].") known by Ranksystem is missing in TS database, perhaps its already deleted or cldbid changed. Try to search for client by uuid."); + try { + $getcldbid = $ts3->clientFindDb($uuid, TRUE); + if($getcldbid[0] != $userstats['cldbid']) { + enter_logfile($cfg,4," Client (uuid: ".$uuid." cldbid: ".$userstats['cldbid'].") known by the Ranksystem changed its cldbid. New cldbid is ".$getcldbid[0]."."); + if($cfg['rankup_client_database_id_change_switch'] == 1) { + $db_cache['all_user'][$uuid]['cldbid'] = $getcldbid[0]; + $sqlexec .= "UPDATE `$dbname`.`user` SET `count`=0,`idle`=0 WHERE `uuid`='$uuid';\nUPDATE `$dbname`.`stats_user` SET `count_week`=0,`count_month`=0,`idle_week`=0,`idle_month`=0,`active_week`=0,`active_month`=0 WHERE `uuid`='$uuid';\nDELETE FROM `$dbname`.`user_snapshot` WHERE `cldbid`='{$userstats['cldbid']}';\n"; + enter_logfile($cfg,4," ".sprintf($lang['changedbid'], $userstats['name'], $uuid, $userstats['cldbid'], $getcldbid[0])); + } else { + $sqlexec .= "UPDATE `$dbname`.`user` SET `cldbid`={$getcldbid[0]} WHERE `uuid`='$uuid';\n"; + // select current user_snapshot entries and insert this with the new database-ID + if(isset($userdata[$userstats['cldbid']])) { + $allinsert = ''; + foreach($userdata[$userstats['cldbid']] as $id => $data) { + $allinsert .= "($id,'{$getcldbid[0]}',{$data['count']},{$data['idle']}),"; + } + if ($allinsert != '') { + $allinsert = substr($allinsert, 0, -1); + $sqlexec .= "INSERT INTO `$dbname`.`user_snapshot` (`id`,`cldbid`,`count`,`idle`) VALUES $allinsert ON DUPLICATE KEY UPDATE `count`=VALUES(`count`),`idle`=VALUES(`idle`);\nDELETE FROM `$dbname`.`user_snapshot` WHERE `cldbid`='{$userstats['cldbid']}';\n"; + } + unset($allinsert); + } + enter_logfile($cfg,4," Store new cldbid ".$getcldbid[0]." for client (uuid: ".$uuid." old cldbid: ".$userstats['cldbid'].")"); } - if ($allinsert != '') { - $allinsert = substr($allinsert, 0, -1); - $sqlexec .= "INSERT INTO `$dbname`.`user_snapshot` (`id`,`cldbid`,`count`,`idle`) VALUES $allinsert ON DUPLICATE KEY UPDATE `count`=VALUES(`count`),`idle`=VALUES(`idle`);\nDELETE FROM `$dbname`.`user_snapshot` WHERE `cldbid`='{$userstats['cldbid']}';\n"; - } - unset($allinsert); - enter_logfile($cfg,4," Store new cldbid ".$getcldbid[0]." for client (uuid: ".$uuid." old cldbid: ".$userstats['cldbid'].")"); + } else { + enter_logfile($cfg,3," Client (uuid: ".$uuid." cldbid: ".$userstats['cldbid'].") is missing in TS database, but TeamSpeak answers on question with the same cldbid (".$getcldbid[0].").. It's weird!"); + } + } catch (Exception $e) { + if($e->getCode() == 2568) { + enter_logfile($cfg,4,$e->getCode() . ': ' . $e->getMessage()."; Error due command clientdbfind (permission: b_virtualserver_client_dbsearch needed)."); + } else { + enter_logfile($cfg,6,$e->getCode() . ': ' . $e->getMessage()."; Client (uuid: ".$uuid." cldbid: ".$userstats['cldbid'].") is missing in TS database, it seems to be deleted. Run the !clean command to correct this."); + $sqlexec .= "UPDATE `$dbname`.`stats_user` SET `count_week`=0,`count_month`=0,`idle_week`=0,`idle_month`=0,`active_week`=0,`active_month`=0,`removed`=1 WHERE `uuid`='$uuid';\n"; } - } else { - enter_logfile($cfg,3," Client (uuid: ".$uuid." cldbid: ".$userstats['cldbid'].") is missing in TS database, but TeamSpeak answers on question with the same cldbid (".$getcldbid[0].").. It's weird!"); - } - } catch (Exception $e) { - if($e->getCode() == 2568) { - enter_logfile($cfg,4,$e->getCode() . ': ' . $e->getMessage()."; Error due command clientdbfind (permission: b_virtualserver_client_dbsearch needed)."); - } else { - enter_logfile($cfg,6,$e->getCode() . ': ' . $e->getMessage()."; Client (uuid: ".$uuid." cldbid: ".$userstats['cldbid'].") is missing in TS database, it seems to be deleted. Run the !clean command to correct this."); - $sqlexec .= "UPDATE `$dbname`.`stats_user` SET `count_week`=0,`count_month`=0,`idle_week`=0,`idle_month`=0,`active_week`=0,`active_month`=0,`removed`=1 WHERE `uuid`='$uuid';\n"; } + } else { + enter_logfile($cfg,2,$lang['errorts3'].$e->getCode().': '.$e->getMessage()."; Error due command clientdbinfo for client-database-ID {$userstats['cldbid']} (permission: b_virtualserver_client_dbinfo needed)."); } - } else { - enter_logfile($cfg,2,$lang['errorts3'].$e->getCode().': '.$e->getMessage()."; Error due command clientdbinfo for client-database-ID {$userstats['cldbid']} (permission: b_virtualserver_client_dbinfo needed)."); + + $clientdesc = $clientinfo['client_base64HashClientUID'] = $mysqlcon->quote('', ENT_QUOTES); + $clientinfo['client_totalconnections'] = $clientinfo['client_total_bytes_uploaded'] = $clientinfo['client_total_bytes_downloaded'] = 0; } - $clientdesc = $clientinfo['client_base64HashClientUID'] = $mysqlcon->quote('', ENT_QUOTES); - $clientinfo['client_totalconnections'] = $clientinfo['client_total_bytes_uploaded'] = $clientinfo['client_total_bytes_downloaded'] = 0; + $allupdateuuid .= "('$uuid',$count_week,$count_month,$idle_week,$idle_month,$active_week,$active_month,{$clientinfo['client_totalconnections']},'{$clientinfo['client_base64HashClientUID']}',{$clientinfo['client_total_bytes_uploaded']},{$clientinfo['client_total_bytes_downloaded']},$clientdesc,$nowtime),"; } - - $allupdateuuid .= "('$uuid',$count_week,$count_month,$idle_week,$idle_month,$active_week,$active_month,{$clientinfo['client_totalconnections']},'{$clientinfo['client_base64HashClientUID']}',{$clientinfo['client_total_bytes_uploaded']},{$clientinfo['client_total_bytes_downloaded']},$clientdesc,$nowtime),"; } unset($sqlhis,$userdataweekbegin,$userdataend,$userdatamonthbegin,$clientinfo,$count_week,$idle_week,$active_week,$count_month,$idle_month,$active_month,$clientdesc); diff --git a/jobs/check_db.php b/jobs/check_db.php index 687f574..a6627e1 100644 --- a/jobs/check_db.php +++ b/jobs/check_db.php @@ -1,6 +1,6 @@ exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('stats_imprint_switch', '0'),('stats_imprint_address', 'Max Mustermann
Musterstraße 13
05172 Musterhausen
Germany'),('stats_imprint_address_url', 'https://site.url/imprint/'), ('stats_imprint_email', 'info@example.com'),('stats_imprint_phone', '+49 171 1234567'),('stats_imprint_notes', NULL),('stats_imprint_privacypolicy', 'Add your own privacy policy here. (editable in the webinterface)'),('stats_imprint_privacypolicy_url', 'https://site.url/privacy/');") === false) { } else { + enter_logfile($cfg,4," [1.3.12] Added new imprint values."); + } + } + + if(version_compare($cfg['version_current_using'], '1.3.13', '<')) { if($mysqlcon->exec("DELETE FROM `$dbname`.`admin_addtime`;") === false) { } if($mysqlcon->exec("DELETE FROM `$dbname`.`addon_assign_groups`;") === false) { } + + if($mysqlcon->exec("UPDATE `$dbname`.`user` SET `idle`=0 WHERE `idle`<0; UPDATE `$dbname`.`user` SET `count`=`idle` WHERE `count`<0; UPDATE `$dbname`.`user` SET `count`=`idle` WHERE `count`<`idle`;") === false) { } + if($mysqlcon->exec("UPDATE `$dbname`.`user_snapshot` SET `idle`=0 WHERE `idle`<0; UPDATE `$dbname`.`user_snapshot` SET `count`=`idle` WHERE `count`<0; UPDATE `$dbname`.`user_snapshot` SET `count`=`idle` WHERE `count`<`idle`;") === false) { } - if($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('stats_imprint_switch', '0'),('stats_imprint_address', 'Max Mustermann
Musterstraße 13
05172 Musterhausen
Germany'),('stats_imprint_address_url', 'https://site.url/imprint/'), ('stats_imprint_email', 'info@example.com'),('stats_imprint_phone', '+49 171 1234567'),('stats_imprint_notes', NULL),('stats_imprint_privacypolicy', 'Add your own privacy policy here. (editable in the webinterface)'),('stats_imprint_privacypolicy_url', 'https://site.url/privacy/');") === false) { } else { - enter_logfile($cfg,4," [1.3.12] Added new imprint values."); + if($mysqlcon->exec("INSERT INTO `$dbname`.`job_check` (`job_name`,`timestamp`) VALUES ('database_export', '0'),('update_groups', '0') ON DUPLICATE KEY UPDATE `timestamp`=VALUES(`timestamp`);") === false) { } else { + enter_logfile($cfg,4," [1.3.13] Added new job_check values."); } - if($mysqlcon->exec("CREATE INDEX `snapshot_id` ON `$dbname`.`user_snapshot` (`id`)") === false) { } - if($mysqlcon->exec("CREATE INDEX `snapshot_cldbid` ON `$dbname`.`user_snapshot` (`cldbid`)") === false) { } - if($mysqlcon->exec("CREATE INDEX `serverusage_timestamp` ON `$dbname`.`server_usage` (`timestamp`)") === false) { } - if($mysqlcon->exec("CREATE INDEX `user_version` ON `$dbname`.`user` (`version`)") === false) { } - if($mysqlcon->exec("CREATE INDEX `user_cldbid` ON `$dbname`.`user` (`cldbid` ASC,`uuid`,`rank`)") === false) { } - if($mysqlcon->exec("CREATE INDEX `user_online` ON `$dbname`.`user` (`online`,`lastseen`)") === false) { } + try { + if($mysqlcon->exec("INSERT IGNORE INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('webinterface_fresh_installation', '0'),('stats_column_nation_switch', '0'),('stats_column_version_switch', '0'),('stats_column_platform_switch', '0');") === false) { } + } catch (Exception $e) { } + + if($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('default_session_sametime', 'Strict'),('default_header_origin', ''),('default_header_xss', '1; mode=block'),('default_header_contenttyp', '1'),('default_header_frame', '') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`);") === false) { } else { + enter_logfile($cfg,4," [1.3.13] Added new cfg_params values."); + } + + if($mysqlcon->exec("UPDATE `$dbname`.`user` SET `nation`='XX' WHERE `nation`='';") === false) { } else { + enter_logfile($cfg,4," [1.3.13] Updated table user."); + } + + try { + if($mysqlcon->exec("DROP INDEX `snapshot_id` ON `$dbname`.`user_snapshot` (`id`)") === false) { } else { + enter_logfile($cfg,4," [1.3.13] Dropped unneeded Index snapshot_id on table user_snapshot."); + } + if($mysqlcon->exec("DROP INDEX `snapshot_cldbid` ON `$dbname`.`user_snapshot` (`cldbid`)") === false) { } else { + enter_logfile($cfg,4," [1.3.13] Dropped unneeded Index snapshot_cldbid on table user_snapshot."); + } + + if($mysqlcon->exec("CREATE INDEX `serverusage_timestamp` ON `$dbname`.`server_usage` (`timestamp`)") === false) { } + if($mysqlcon->exec("CREATE INDEX `user_version` ON `$dbname`.`user` (`version`)") === false) { } + if($mysqlcon->exec("CREATE INDEX `user_cldbid` ON `$dbname`.`user` (`cldbid` ASC,`uuid`,`rank`)") === false) { } + if($mysqlcon->exec("CREATE INDEX `user_online` ON `$dbname`.`user` (`online`,`lastseen`)") === false) { } + } catch (Exception $e) { } } $cfg = set_new_version($mysqlcon,$cfg,$dbname); } diff --git a/jobs/db_ex_imp.php b/jobs/db_ex_imp.php new file mode 100644 index 0000000..3e47148 --- /dev/null +++ b/jobs/db_ex_imp.php @@ -0,0 +1,139 @@ +exec("UPDATE `$dbname`.`job_check` SET `timestamp`='2' WHERE `job_name`='database_export';") === false) { + $err++; + enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } else { + $db_cache['job_check']['database_export']['timestamp'] = 2; + enter_logfile($cfg,4," Started job '".$lang['wihladmex']."'"); + } + + $datetime = date("Y-m-d_H-i-s", time()); + $filepath = $cfg['logs_path'].'db_export_'.$datetime; + $filename = 'db_export_'.$datetime; + $limit_entries = 10000; + + if (($tables = $mysqlcon->query("SHOW TABLES")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + $err++; + enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } else { + + $dump = fopen($filepath.".sql", 'a'); + fwrite($dump, "-- Ranksystem SQL Export\n-- from $datetime\n"); + fclose($dump); + + foreach ($tables as $table => $value) { + $out = ''; + if(substr($table, 0, 4) == 'bak_') continue; + #if($table == 'user_snapshot') continue; + if (($numColumns = $mysqlcon->query("SELECT * FROM `$dbname`.`$table` LIMIT 1")->columnCount()) === false) { + $err++; + enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } + + $out .= 'DROP TABLE IF EXISTS `' . $table . '`;' . "\n\n"; + + if (($create_table = $mysqlcon->query("SHOW CREATE TABLE `$dbname`.`$table`")->fetch(PDO::FETCH_ASSOC)) === false) { + $err++; + enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } + $out .= $create_table['Create Table'] . ';' . "\n\n"; + + if (($maxvalues = $mysqlcon->query("SELECT COUNT(*) FROM `$dbname`.`$table`;")->fetch()) === false) { + $err++; + enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } + + $dump = fopen($filepath.".sql", 'a'); + fwrite($dump, $out); + fclose($dump); + + unset($out); + + $loops = $maxvalues[0] / $limit_entries; + for ($i = 0; $i <= $loops; $i++) { + $out = ''; + $offset = $i * $limit_entries; + if (($sqldata = $mysqlcon->query("SELECT * FROM `$dbname`.`$table` LIMIT {$limit_entries} OFFSET {$offset}")->fetchALL(PDO::FETCH_NUM)) === false) { + $err++; + enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } + + if(count($sqldata) != 0) { + $out .= "INSERT INTO `$table` VALUES"; + foreach ($sqldata as $row) { + $out .= "("; + for ($j = 0; $j < $numColumns; $j++) { + if (isset($row[$j])) { + $out .= $mysqlcon->quote(($row[$j]), ENT_QUOTES); + } else { + $out .= '""'; + } + if ($j < ($numColumns - 1)) { + $out .= ','; + } + } + $out .= '),'; + } + $out = substr($out,0,-1); + $out .= ";"; + } + $out .= "\n\n"; + + $dump = fopen($filepath.".sql", 'a'); + fwrite($dump, $out); + fclose($dump); + + unset($out, $sqldata); + } + } + + $dump = fopen($filepath.".sql", 'a'); + fwrite($dump, "-- Finished export"); + fclose($dump); + + $zip = new ZipArchive(); + if ($zip->open($filepath.".sql.zip", ZipArchive::CREATE)!==TRUE) { + $err++; + enter_logfile($cfg,2," Cannot create $filepath.sql.zip!"); + } else { + $zip->addFile($filepath.".sql",$filename.".sql"); + if(version_compare(phpversion(), '7.2', '>=')) { + $zip->setEncryptionName($filename.".sql", ZipArchive::EM_AES_256, $cfg['teamspeak_query_pass']); + } + $zip->close(); + if(!unlink($filepath.".sql")) { + $err++; + enter_logfile($cfg,2," Cannot remove SQL file $filepath.sql!"); + } + } + } + + if ($err == 0) { + if($mysqlcon->exec("UPDATE `$dbname`.`job_check` SET `timestamp`='4' WHERE `job_name`='database_export';") === false) { + enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } else { + $db_cache['job_check']['database_export']['timestamp'] = 4; + enter_logfile($cfg,4," Finished job '".$lang['wihladmex']."'"); + } + } else { + if($mysqlcon->exec("UPDATE `$dbname`.`job_check` SET `timestamp`='3' WHERE `job_name`='database_export';") === false) { + enter_logfile($cfg,2," Executing SQL commands failed: ".print_r($mysqlcon->errorInfo(), true)); + } else { + $db_cache['job_check']['database_export']['timestamp'] = 3; + } + } + + enter_logfile($cfg,4,"DB Export job(s) finished"); + } + enter_logfile($cfg,6,"db_ex_imp needs: ".(number_format(round((microtime(true) - $starttime), 5),5))); +} +?> \ No newline at end of file diff --git a/jobs/event_userenter.php b/jobs/event_userenter.php index 3d949e2..4a8d74b 100644 --- a/jobs/event_userenter.php +++ b/jobs/event_userenter.php @@ -30,7 +30,11 @@ function event_userenter(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 $ip = ''; } elseif($cfg['rankup_hash_ip_addresses_mode'] == 2) { $salt = md5(dechex(crc32(substr(__DIR__,0,-4)))); - $hash = password_hash($ip, PASSWORD_DEFAULT, array("cost" => 10, "salt" => $salt)); + if(version_compare(PHP_VERSION, '7.9.9', '>')) { + $hash = crypt($ip, '$2y$10$'.$salt.'$'); + } else { + $hash = password_hash($ip, PASSWORD_DEFAULT, array("cost" => 10, "salt" => $salt)); + } $ip = ''; } else { $hash = ''; diff --git a/jobs/get_avatars.php b/jobs/get_avatars.php index 01810ae..2f1dd40 100644 --- a/jobs/get_avatars.php +++ b/jobs/get_avatars.php @@ -2,6 +2,7 @@ function get_avatars($ts3,$cfg,$dbname,&$db_cache) { $starttime = microtime(true); $nowtime = time(); + $sqlexec = ''; if($db_cache['job_check']['get_avatars']['timestamp'] < ($nowtime - 32)) { $db_cache['job_check']['get_avatars']['timestamp'] = $nowtime; diff --git a/jobs/handle_messages.php b/jobs/handle_messages.php index 267dd12..9749f30 100644 --- a/jobs/handle_messages.php +++ b/jobs/handle_messages.php @@ -60,7 +60,7 @@ function handle_messages(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 $msg = sprintf($cfg['rankup_next_message_1'], $days, $hours, $mins, $secs, $sqlhisgroup[$rank['group']]['sgidname'], $name, $user['rank'], $sqlhisgroup[$user['grpid']]['sgidname'], date('Y-m-d H:i:s', $user['grpsince'])); } $targetid = $event["invokerid"]; - sendmessage($host, $cfg, $event["invokeruid"], 1, $targetid, $msg); + sendmessage($host, $cfg, $event["invokeruid"], $msg, 1, $targetid); if($cfg['rankup_next_message_mode'] == 1) { break; } @@ -72,39 +72,38 @@ function handle_messages(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 if(strstr($event["msg"], '!version')) { if(version_compare($cfg['version_latest_available'], $cfg['version_current_using'], '>') && $cfg['version_latest_available'] != '') { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, sprintf($lang['upmsg'], $cfg['version_current_using'], $cfg['version_latest_available'], 'https://ts-ranksystem.com/#changelog')); + sendmessage($host, $cfg, $event["invokeruid"], sprintf($lang['upmsg'], $cfg['version_current_using'], $cfg['version_latest_available'], 'https://ts-ranksystem.com/#changelog'), $event["targetmode"], $targetid); } else { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, sprintf($lang['msg0001'], $cfg['version_current_using'])); + sendmessage($host, $cfg, $event["invokeruid"], sprintf($lang['msg0001'], $cfg['version_current_using']), $event["targetmode"], $targetid); } return; } if(strstr($event["msg"], '!help') || strstr($event["msg"], '!info') || strstr($event["msg"], '!commands') || strstr($event["msg"], '!cmd')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0002']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0002'], $event["targetmode"], $targetid); return; } if((strstr($event["msg"], '!shutdown') || strstr($event["msg"], '!quit') || strstr($event["msg"], '!stop')) && $admin == 1) { enter_logfile($cfg,5,sprintf($lang['msg0004'], $event["invokername"], $event["invokeruid"])); $path = substr(__DIR__, 0, -4); - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0005']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0005'], $event["targetmode"], $targetid); if (substr(php_uname(), 0, 7) == "Windows") { exec("start ".$phpcommand." ".$path."worker.php stop"); - file_put_contents(substr(__DIR__,0,-4).'logs\autostart_deactivated',""); } else { exec($phpcommand." ".$path."worker.php stop > /dev/null &"); - file_put_contents(substr(__DIR__,0,-4).'logs/autostart_deactivated',""); } + file_put_contents($cfg['logs_path'].'autostart_deactivated',""); shutdown($mysql,$cfg,4,"Stop command received!"); } elseif (strstr($event["msg"], '!shutdown') || strstr($event["msg"], '!quit') || strstr($event["msg"], '!stop')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0003']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0003'], $event["targetmode"], $targetid); return; } if((strstr($event["msg"], '!restart') || strstr($event["msg"], '!reboot')) && $admin == 1) { enter_logfile($cfg,5,sprintf($lang['msg0007'], $event["invokername"], $event["invokeruid"], "restart")); $path = substr(__DIR__, 0, -4); - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0006']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0006'], $event["targetmode"], $targetid); if (substr(php_uname(), 0, 7) == "Windows") { exec("start ".$phpcommand." ".$path."worker.php restart"); } else { @@ -112,18 +111,18 @@ function handle_messages(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 } return; } elseif (strstr($event["msg"], '!restart') || strstr($event["msg"], '!reboot')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0003']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0003'], $event["targetmode"], $targetid); return; } if((strstr($event["msg"], '!checkupdate') || strstr($event["msg"], '!update')) && $admin == 1) { - if($mysqlcon->exec("UPDATE `$dbname`.`job_check` SET `timestamp`='0' WHERE `job_name` IN ('check_update','get_version','calc_server_stats')") === false) { + if($mysqlcon->exec("UPDATE `$dbname`.`job_check` SET `timestamp`='0' WHERE `job_name` IN ('check_update','get_version','calc_server_stats','calc_donut_chars')") === false) { enter_logfile($cfg,4,"handle_messages 13:".print_r($mysqlcon->errorInfo(), true)); } - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0008']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0008'], $event["targetmode"], $targetid); return; } elseif(strstr($event["msg"], '!checkupdate') || strstr($event["msg"], '!update')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0003']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0003'], $event["targetmode"], $targetid); return; } @@ -132,10 +131,10 @@ function handle_messages(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 if($mysqlcon->exec("UPDATE `$dbname`.`job_check` SET `timestamp`='0' WHERE `job_name` IN ('clean_db','clean_clients')") === false) { enter_logfile($cfg,4,"handle_messages 13:".print_r($mysqlcon->errorInfo(), true)); } - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0009'] ." ". $lang['msg0010']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0009'] ." ". $lang['msg0010'], $event["targetmode"], $targetid); return; } elseif(strstr($event["msg"], '!clean')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0003']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0003'], $event["targetmode"], $targetid); return; } @@ -147,25 +146,25 @@ function handle_messages(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 enter_logfile($cfg,4,"handle_messages 15:".print_r($mysqlcon->errorInfo(), true)); } } - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0011'] ." ". $lang['msg0010']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0011'] ." ". $lang['msg0010'], $event["targetmode"], $targetid); return; } elseif(strstr($event["msg"], '!reloadgroups')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0003']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0003'], $event["targetmode"], $targetid); return; } if(strstr($event["msg"], '!online') || strstr($event["msg"], '!uptime')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, sprintf("Bot is online since %s, now %s.", (DateTime::createFromFormat('U', $cfg['temp_last_botstart'])->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s")), (new DateTime("@0"))->diff(new DateTime("@".(time()-$cfg['temp_last_botstart'])))->format($cfg['default_date_format']))); + sendmessage($host, $cfg, $event["invokeruid"], sprintf("Bot is online since %s, now %s.", (DateTime::createFromFormat('U', $cfg['temp_last_botstart'])->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s")), (new DateTime("@0"))->diff(new DateTime("@".(time()-$cfg['temp_last_botstart'])))->format($cfg['default_date_format'])), $event["targetmode"], $targetid); return; } if(strstr($event["msg"], '!runtime') || strstr($event["msg"], '!runtimes')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, sprintf("Last 10 runtimes (in seconds):\n%s\n\nØ %s sec. (Σ %s)", str_replace(";","\n",$cfg['temp_last_laptime']), round(($cfg['temp_whole_laptime'] / $cfg['temp_count_laptime']),5), $cfg['temp_count_laptime'])); + sendmessage($host, $cfg, $event["invokeruid"], sprintf("Last 10 runtimes (in seconds):\n%s\n\nØ %s sec. (Σ %s)", str_replace(";","\n",$cfg['temp_last_laptime']), round(($cfg['temp_whole_laptime'] / $cfg['temp_count_laptime']),5), $cfg['temp_count_laptime']), $event["targetmode"], $targetid); return; } if(strstr($event["msg"], '!memory')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, sprintf("Allocated memory of PHP for the Ranksystem Bot..\ncurrent using: %s KiB\npeak using: %s KiB", round((memory_get_usage()/1024),2), round((memory_get_peak_usage()/1024),2))); + sendmessage($host, $cfg, $event["invokeruid"], sprintf("Allocated memory of PHP for the Ranksystem Bot..\ncurrent using: %s KiB\npeak using: %s KiB", round((memory_get_usage()/1024),2), round((memory_get_peak_usage()/1024),2)), $event["targetmode"], $targetid); return; } @@ -220,12 +219,12 @@ function handle_messages(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 $message .= $line; } $targetid = $event["invokerid"]; - sendmessage($host, $cfg, $event["invokeruid"], 1, $targetid, $message, NULL, NULL, NULL, $nolog=1); + sendmessage($host, $cfg, $event["invokeruid"], $message, 1, $targetid, NULL, NULL, NULL, $nolog=1); } elseif(strstr($event["msg"], '!logs') || strstr($event["msg"], '!log')) { - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0003']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0003'], $event["targetmode"], $targetid); } - sendmessage($host, $cfg, $event["invokeruid"], $event["targetmode"], $targetid, $lang['msg0002']); + sendmessage($host, $cfg, $event["invokeruid"], $lang['msg0002'], $event["targetmode"], $targetid); } } ?> \ No newline at end of file diff --git a/jobs/update_groups.php b/jobs/update_groups.php index 334e799..b2e0b39 100644 --- a/jobs/update_groups.php +++ b/jobs/update_groups.php @@ -40,7 +40,11 @@ function update_groups($ts3,$mysqlcon,$lang,$cfg,$dbname,$serverinfo,&$db_cache, $sIconFile = 0; $extension = ''; if (!isset($db_cache['groups']['0']) || $db_cache['groups']['0']['iconid'] != $sIconId || (isset($iconarr["i".$sIconId]) && $iconarr["i".$sIconId] > $db_cache['groups']['0']['icondate'])) { - enter_logfile($cfg,6,"Servericon TSiconid:".$serverinfo['virtualserver_icon_id']."; powed TSiconid:".$sIconId."; DBiconid:".$db_cache['groups']['0']['iconid']."; TSicondate:".$iconarr["i".$sIconId]."; DBicondate:".$db_cache['groups']['0']['icondate'].";"); + if(isset($db_cache['groups']['0']) && isset($iconarr["i".$sIconId])) { + enter_logfile($cfg,6,"Servericon TSiconid:".$serverinfo['virtualserver_icon_id']."; powed TSiconid:".$sIconId."; DBiconid:".$db_cache['groups']['0']['iconid']."; TSicondate:".$iconarr["i".$sIconId]."; DBicondate:".$db_cache['groups']['0']['icondate'].";"); + } else { + enter_logfile($cfg,6,"Servericon TSiconid:".$serverinfo['virtualserver_icon_id']."; powed TSiconid:".$sIconId."; DBiconid: empty; TSicondate: empty; DBicondate: empty;"); + } if($sIconId > 600) { try { usleep($cfg['teamspeak_query_command_delay']); @@ -62,7 +66,7 @@ function update_groups($ts3,$mysqlcon,$lang,$cfg,$dbname,$serverinfo,&$db_cache, } } $iconarr["i".$sIconId] = $sIconId = 0; - } elseif($iconid < 601) { + } elseif($sIconId < 601) { $extension = 'png'; } else { $sIconId = 0; @@ -90,7 +94,7 @@ function update_groups($ts3,$mysqlcon,$lang,$cfg,$dbname,$serverinfo,&$db_cache, $tsgroupids[$servergroup['sgid']] = 0; $sgid = $servergroup['sgid']; $extension = ''; - $sgname = $mysqlcon->quote((mb_substr($servergroup['name'],0,30)), ENT_QUOTES); + $sgname = $mysqlcon->quote((mb_substr(mb_convert_encoding($servergroup['name'],'UTF-8','auto'),0,30)), ENT_QUOTES); $iconid = $servergroup['iconid']; $iconid = ($iconid < 0) ? (pow(2, 32)) - ($iconid * -1) : $iconid; $iconfile = 0; @@ -128,7 +132,7 @@ function update_groups($ts3,$mysqlcon,$lang,$cfg,$dbname,$serverinfo,&$db_cache, $iconarr["i".$iconid] = 0; } - if(isset($db_cache['groups'][$servergroup['sgid']]) && $db_cache['groups'][$servergroup['sgid']]['sgidname'] == $servergroup['name'] && $db_cache['groups'][$servergroup['sgid']]['iconid'] == $iconid && $db_cache['groups'][$servergroup['sgid']]['icondate'] == $iconarr["i".$iconid] && $db_cache['groups'][$servergroup['sgid']]['sortid'] == $servergroup['sortid']) { + if(isset($db_cache['groups'][$servergroup['sgid']]) && $db_cache['groups'][$servergroup['sgid']]['sgidname'] == $sgname && $db_cache['groups'][$servergroup['sgid']]['iconid'] == $iconid && $db_cache['groups'][$servergroup['sgid']]['icondate'] == $iconarr["i".$iconid] && $db_cache['groups'][$servergroup['sgid']]['sortid'] == $servergroup['sortid']) { enter_logfile($cfg,7,"Continue server group ".$sgname." (CID: ".$servergroup['sgid'].")"); continue; } else { diff --git a/jobs/update_rs.php b/jobs/update_rs.php index 691c07d..6c24f5b 100644 --- a/jobs/update_rs.php +++ b/jobs/update_rs.php @@ -1,5 +1,7 @@ query("SELECT 1 FROM `$dbname`.`bak_$table` LIMIT 1") !== false) { - if($mysqlcon->exec("DROP TABLE `$dbname`.`bak_$table`") === false) { - enter_logfile($cfg,1," Error due deleting old backup table bak_".$table.".",$norotate); - $countbackuperr++; - } else { - enter_logfile($cfg,4," Old backup table bak_".$table." successfully removed.",$norotate); + try { + if($mysqlcon->query("SELECT 1 FROM `$dbname`.`bak_$table` LIMIT 1") !== false) { + if($mysqlcon->exec("DROP TABLE `$dbname`.`bak_$table`") === false) { + enter_logfile($cfg,1," Error due deleting old backup table bak_".$table.".",$norotate); + $countbackuperr++; + } else { + enter_logfile($cfg,4," Old backup table bak_".$table." successfully removed.",$norotate); + } } - } + } catch (Exception $e) { } } foreach ($tables as $table) { @@ -62,72 +66,81 @@ function update_rs($mysqlcon,$lang,$cfg,$dbname,$phpcommand,$norotate=NULL) { } else { enter_logfile($cfg,5," New update file (update/ranksystem_".$cfg['version_latest_available'].".zip) already here...",$norotate); } - - $zipHandle = zip_open(substr(__DIR__,0,-4).'update/ranksystem_'.$cfg['version_latest_available'].'.zip'); - + $countwrongfiles = 0; $countchangedfiles = 0; + + $zip = new ZipArchive; - while ($aF = zip_read($zipHandle)) { - $thisFileName = zip_entry_name($aF); - $thisFileDir = dirname($thisFileName); - enter_logfile($cfg,6," Parent directory: ".$thisFileDir,$norotate); - enter_logfile($cfg,6," File/Dir: ".$thisFileName,$norotate); - - if(substr($thisFileName,-1,1) == '/' || substr($thisFileName,-1,1) == '\\') { - enter_logfile($cfg,6," Check folder is existing: ".$thisFileName,$norotate); - if(!is_dir(substr(__DIR__,0,-4).substr($thisFileName,0,-1))) { - enter_logfile($cfg,5," Create folder: ".substr(__DIR__,0,-4).substr($thisFileName,0,-1),$norotate); - if(mkdir((substr(__DIR__,0,-4).substr($thisFileName,0,-1)), 0755, true)) { - enter_logfile($cfg,4," Created new folder ".substr(__DIR__,0,-4).substr($thisFileName,0,-1),$norotate); + if($zip->open(substr(__DIR__,0,-4).'update/ranksystem_'.$cfg['version_latest_available'].'.zip')) { + for ($i = 0; $i < $zip->numFiles; $i++) { + $thisFileName = $zip->getNameIndex($i); + $thisFileDir = dirname($thisFileName); + enter_logfile($cfg,6," Parent directory: ".$thisFileDir,$norotate); + enter_logfile($cfg,6," File/Dir: ".$thisFileName,$norotate); + + if(substr($thisFileName,-1,1) == '/' || substr($thisFileName,-1,1) == '\\') { + enter_logfile($cfg,6," Check folder is existing: ".$thisFileName,$norotate); + if(!is_dir(substr(__DIR__,0,-4).substr($thisFileName,0,-1))) { + enter_logfile($cfg,5," Create folder: ".substr(__DIR__,0,-4).substr($thisFileName,0,-1),$norotate); + if(mkdir((substr(__DIR__,0,-4).substr($thisFileName,0,-1)), 0740, true)) { + enter_logfile($cfg,4," Created new folder ".substr(__DIR__,0,-4).substr($thisFileName,0,-1),$norotate); + } else { + enter_logfile($cfg,2," Error by creating folder ".substr(__DIR__,0,-4).substr($thisFileName,0,-1).". Please check the permissions on the folder one level above.",$norotate); + $countwrongfiles++; + } } else { - enter_logfile($cfg,2," Error by creating folder ".substr(__DIR__,0,-4).substr($thisFileName,0,-1).". Please check the permissions on the folder one level above.",$norotate); - $countwrongfiles++; - } - } else { - enter_logfile($cfg,6," Folder still existing.",$norotate); + enter_logfile($cfg,6," Folder still existing.",$norotate); + } + continue; } - continue; - } - if(!is_dir(substr(__DIR__,0,-4).'/'.$thisFileDir)) { - enter_logfile($cfg,6," Check parent folder is existing: ".$thisFileDir,$norotate); - if(mkdir(substr(__DIR__,0,-4).$thisFileDir, 0755, true)) { - enter_logfile($cfg,4," Created new folder ".$thisFileDir,$norotate); + if(!is_dir(substr(__DIR__,0,-4).'/'.$thisFileDir)) { + enter_logfile($cfg,6," Check parent folder is existing: ".$thisFileDir,$norotate); + if(mkdir(substr(__DIR__,0,-4).$thisFileDir, 0740, true)) { + enter_logfile($cfg,4," Created new folder ".$thisFileDir,$norotate); + } else { + enter_logfile($cfg,2," Error by creating folder ".$thisFileDir.". Please check the permissions on your folder ".substr(__DIR__,0,-4),$norotate); + $countwrongfiles++; + } } else { - enter_logfile($cfg,2," Error by creating folder ".$thisFileDir.". Please check the permissions on your folder ".substr(__DIR__,0,-4),$norotate); - $countwrongfiles++; + enter_logfile($cfg,6," Parent folder still existing.",$norotate); } - } else { - enter_logfile($cfg,6," Parent folder still existing.",$norotate); - } - enter_logfile($cfg,6," Check file: ".substr(__DIR__,0,-4).$thisFileName,$norotate); - if(!is_dir(substr(__DIR__,0,-4).$thisFileName)) { - $contents = zip_entry_read($aF, zip_entry_filesize($aF)); - $updateThis = ''; - if($thisFileName == 'other/dbconfig.php' || $thisFileName == 'install.php' || $thisFileName == 'other/phpcommand.php' || $thisFileName == 'logs/autostart_deactivated') { - enter_logfile($cfg,5," Did not touch ".$thisFileName,$norotate); - } else { - if(($updateThis = fopen(substr(__DIR__,0,-4).'/'.$thisFileName, 'w')) === false) { - enter_logfile($cfg,2," Failed to open file ".$thisFileName,$norotate); - $countwrongfiles++; - } elseif(!fwrite($updateThis, $contents)) { - enter_logfile($cfg,2," Failed to write file ".$thisFileName,$norotate); - $countwrongfiles++; + enter_logfile($cfg,6," Check file: ".substr(__DIR__,0,-4).$thisFileName,$norotate); + if(!is_dir(substr(__DIR__,0,-4).$thisFileName)) { + $contents = $zip->getFromName($thisFileName); + $updateThis = ''; + if($thisFileName == 'other/dbconfig.php' || $thisFileName == 'install.php' || $thisFileName == 'other/phpcommand.php' || $thisFileName == 'logs/autostart_deactivated') { + enter_logfile($cfg,5," Did not touch ".$thisFileName,$norotate); } else { - enter_logfile($cfg,4," Replaced file ".$thisFileName,$norotate); - $countchangedfiles++; + if(($updateThis = fopen(substr(__DIR__,0,-4).'/'.$thisFileName, 'w')) === false) { + enter_logfile($cfg,2," Failed to open file ".$thisFileName,$norotate); + $countwrongfiles++; + } elseif(!fwrite($updateThis, $contents)) { + enter_logfile($cfg,2," Failed to write file ".$thisFileName,$norotate); + $countwrongfiles++; + } else { + enter_logfile($cfg,4," Replaced file ".$thisFileName,$norotate); + $countchangedfiles++; + } + fclose($updateThis); + unset($contents); } - fclose($updateThis); - unset($contents); + } else { + enter_logfile($cfg,2," Unkown thing happened.. Is the parent directory existing? ".$thisFileDir." # ".$thisFileName,$norotate); + $countwrongfiles++; } - } else { - enter_logfile($cfg,2," Unkown thing happened.. Is the parent directory existing? ".$thisFileDir." # ".$thisFileName,$norotate); - $countwrongfiles++; } + + $zip->close(); + unset($zip); + sleep(1); + } else { + enter_logfile($cfg,2," Error with downloaded Zip file happened. Is the file inside the folder 'update' valid and readable?",$norotate); + $countwrongfiles++; } - + if(!unlink(substr(__DIR__,0,-4).'update/ranksystem_'.$cfg['version_latest_available'].'.zip')) { enter_logfile($cfg,3," Could not clean update folder. Please remove the unneeded file ".substr(__DIR__,0,-4)."update/ranksystem_".$cfg['version_latest_available'].".zip",$norotate); } else { @@ -135,31 +148,30 @@ function update_rs($mysqlcon,$lang,$cfg,$dbname,$phpcommand,$norotate=NULL) { } if($countwrongfiles == 0 && $countchangedfiles != 0) { - $nowtime = time(); - if($mysqlcon->exec("UPDATE `$dbname`.`job_check` SET `timestamp`='$nowtime' WHERE `job_name`='get_version'; UPDATE `$dbname`.`cfg_params` SET `value`='{$cfg['version_latest_available']}' WHERE `param`='version_latest_available';") === false) { - enter_logfile($cfg,1," Error due updating new version in database.",$norotate); - } - + $sqlexec .= "UPDATE `$dbname`.`cfg_params` SET `value`='{$cfg['version_latest_available']}' WHERE `param`='version_latest_available';\n"; + $path = substr(__DIR__, 0, -4); - - if (file_exists(substr(__DIR__,0,-4).'logs/pid')) { - unlink(substr(__DIR__,0,-4).'logs/pid'); + + if (file_exists($cfg['logs_path'].'pid')) { + unlink($cfg['logs_path'].'pid'); } - - sleep(2); + + enter_logfile($cfg,4," Files updated successfully.",$norotate); if (substr(php_uname(), 0, 7) == "Windows") { - exec("start ".$phpcommand." ".$path."worker.php start"); + pclose(popen("start /B cmd /C ".$phpcommand." ".$path."worker.php start 1500000 >NUL 2>NUL", "r")); } else { - exec($phpcommand." ".$path."worker.php start > /dev/null 2>/dev/null &"); + exec($phpcommand." ".$path."worker.php start 2500000 > /dev/null 2>&1 &"); } - - enter_logfile($cfg,4," Files updated successfully.",$norotate); - shutdown($mysqlcon,$cfg,4,"Update done. Wait for restart via cron/task.",TRUE); + + shutdown($mysqlcon,$cfg,4,"Update done. Wait for restart via cron/task.",FALSE); } else { enter_logfile($cfg,1," Files updated with at least one error. Please check the log!",$norotate); enter_logfile($cfg,2,"Update of the Ranksystem failed!",$norotate); enter_logfile($cfg,4,"Continue with normal work on old version.",$norotate); } + + $sqlexec .= "UPDATE `$dbname`.`job_check` SET `timestamp`='$nowtime' WHERE `job_name`='get_version';\n"; + return($sqlexec); } \ No newline at end of file diff --git "a/languages/core_ar_\330\247\331\204\330\271\330\261\330\250\331\212\330\251_arab.php" "b/languages/core_ar_\330\247\331\204\330\271\330\261\330\250\331\212\330\251_arab.php" index b8549b2..18a3594 100644 --- "a/languages/core_ar_\330\247\331\204\330\271\330\261\330\250\331\212\330\251_arab.php" +++ "b/languages/core_ar_\330\247\331\204\330\271\330\261\330\250\331\212\330\251_arab.php" @@ -51,6 +51,7 @@ $lang['factor'] = "Factor"; $lang['highest'] = "تم الوصول الى اعلى رتبة"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "in Seconds"; $lang['install'] = "Installation"; $lang['instdb'] = "تنصيب قاعدة البيانات"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Define here, after which time a user should get automatically a predefined servergroup.

time (seconds) => servergroup ID => permanent flag

Max. value is 999.999.999 seconds (over 31 years).

The entered seconds will be rated as 'online time' or 'active time', depending on the setting of the 'time mode' you have chosen.

Each entry has to separate from next with a comma.

The time must be entered cumulative

Example:
60=>9=>0,120=>10=>0,180=>11=>0
On this example a user receives servergroup 9 after 60 seconds, servergroup 10 after another 60 seconds, servergroup 11 after another 60 seconds."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "List Rankup (Admin-Mode)"; $lang['wihladm0'] = "Function description (click)"; $lang['wihladm0desc'] = "Choose one or more reset options and press \"start reset\" to start it.
Each option is described by itself.

After starting the reset job(s), you can view the status on this site.

The reset task will be done about the Ranksystem Bot as a job.
It is necessary the Ranksystem Bot is running.
Do NOT stop or restart the Bot during the reset is in progress!

For the time of running the reset, the Ranksystem will pause all other things. After completing the reset the Bot will automatically go on with the normal work.
Again, do NOT stop or restart the Bot!

When all jobs are done, you need to confirm them. This will reset the status of the jobs. That makes it possible to start a new reset.

In case of a reset you might also want to withdraw servergroups from the users. It is important not to change the 'rank up definition', before you have done this reset. After reset you can change the 'rank up definition', sure!
The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


Be aware, there is no way of return!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "created"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Estimated time to reset the system"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Are you sure, you still want to reset the system?"; $lang['wihladmrs13'] = "Yes, start reset"; $lang['wihladmrs14'] = "No, cancel reset"; @@ -469,8 +493,8 @@ $lang['wihladmrs5'] = "Reset Job(s) successfully created."; $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; -$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the reset is in progress!"; -$lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; +$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the job is in progress!"; +$lang['wihladmrs9'] = "Please %s confirm %s the job(s). This will reset the job status of all jobs. It is needed to be able to start a new one."; $lang['wihlset'] = "إعدادات"; $lang['wiignidle'] = "Ignoriere Idle"; $lang['wiignidledesc'] = "Define a period, up to which the idle time of a user will be ignored.

When a client does not do anything on the server (=idle), this time is noted by the Ranksystem. With this feature the idle time of an user will not be counted until the defined limit. Only when the defined limit is exceeded, it counts from that point for the Ranksystem as idle time.

This function matters only in conjunction with the mode 'active time'.

Meaning the function is e.g. to evaluate the time of listening in conversations as activity.

0 Sec. = disable this function

Example:
Ignore idle = 600 (seconds)
A client has an idle of 8 minuntes.
└ 8 minutes idle are ignored and he therefore receives this time as active time. If the idle time now increased to 12 minutes, the time is over 10 minutes and in this case 2 minutes would be counted as idle time, the first 10 minutes as active time."; @@ -503,6 +527,7 @@ $lang['winav11'] = "Please define a Bot-Admin, which should be the administrator of the Ranksystem (TeamSpeak -> Bot-Admin). This is very important in case you lost your login credentials for the webinterface."; $lang['winav12'] = "Addons"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Database"; $lang['winav3'] = "Core"; $lang['winav4'] = "Other"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Following things are required to reset the password:"; $lang['wiselcld'] = "select clients"; $lang['wiselclddesc'] = "Select the clients by their last known username, unique Client-ID or Client-database-ID.
Multiple selections are also possible."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "active time"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git "a/languages/core_az_Az\311\231rbaycan_az.php" "b/languages/core_az_Az\311\231rbaycan_az.php" index 1f27ed6..beff494 100644 --- "a/languages/core_az_Az\311\231rbaycan_az.php" +++ "b/languages/core_az_Az\311\231rbaycan_az.php" @@ -51,6 +51,7 @@ $lang['factor'] = "Factor"; $lang['highest'] = "ən yüksək dərəcəyə çatdı"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "in Seconds"; $lang['install'] = "Quraşdırma"; $lang['instdb'] = "Verilənlər bazasını quraşdırın"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Burada müəyyən olunduqdan sonra istifadəçi avtomatik olaraq əvvəlcədən təyin edilmiş server qrupunu almalıdır.

vaxt (saniyə) => server qrup ID  => permanent flag

Maks. dəyər 999.999.999 saniyə (31 ildən çoxdur)

Bunun üçün mühüm rejimdən asılı olaraq istifadəçinin 'onlayn vaxt' və ya 'aktiv vaxt' olması vacibdir.

Hər bir giriş vergüllə bir-birindən ayrı olmalıdır.

Vaxt kumulyativ şəkildə təqdim edilməlidir

Məsələn:
60=>9=>0,120=>10=>0,180=>11=>0
Bu nümunədə bir istifadəçi 60 saniyə sonra server qrup 9, server qrup 10 digər 60 saniyə sonra, server qrup 11 digər 60 saniyə sonra alır."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Siyahı sıralaması (Admin-Mod)"; $lang['wihladm0'] = "Təsvirin açıqlaması (klikləyin)"; $lang['wihladm0desc'] = "Bir və ya daha çox sıfırlama variantını seçin və başlamaq üçün \"start reset\" düyməsini basın.
Hər bir seçim özü tərəfindən təsvir olunur.

Sıfırlama işlərini başladıktan sonra, bu saytdakı vəziyyəti görə bilərsiniz.

Yeniləmə vəzifəsi Ranksystem Bot ilə əlaqədar bir iş olaraq ediləcək.
Ranksystem Bot başladılması lazımdır.
Yenidən sıfırlama zamanı Botu dayandırmayın və ya yenidən başladın!

Yenidən qurma zamanı Ranksystem bütün digər şeyləri durduracaq. Yeniləməni tamamladıqdan sonra Bot avtomatik olaraq normal işlə davam edəcək. Başlatma, dayandırma və ya yenidən başlatma bunları etməyin!

Bütün işlər edildikdə, onları təsdiqləməlisiniz. Bu, işlərin vəziyyətini yenidən quracaq. Bu yeni bir sıfırlamanın başlamasına imkan verir.

Bir sıfırlama halında, istifadəçilərdən server dəstələrini çıxarın da istəyə bilərsiniz. Bunu dəyişdirməmək vacibdir 'rank up definition', bu sıfırlamadan əvvəl. Yenidən qurduqdan sonra dəyişə bilərsiniz 'rank up definition'!
Server qrupların çəkilməsi bir müddət ala bilər. Aktivdir 'Query-Slowmode' lazımi müddəti daha da artıracaq. Dayandırılmasını məsləhət görürük'Query-Slowmode'!


Xəbərdar olun, heç bir geri dönüş üsulu yoxdur!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "created"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Estimated time to reset the system"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Are you sure, you still want to reset the system?"; $lang['wihladmrs13'] = "Yes, start reset"; $lang['wihladmrs14'] = "No, cancel reset"; @@ -469,8 +493,8 @@ $lang['wihladmrs5'] = "Reset Job(s) successfully created."; $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; -$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the reset is in progress!"; -$lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; +$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the job is in progress!"; +$lang['wihladmrs9'] = "Please %s confirm %s the job(s). This will reset the job status of all jobs. It is needed to be able to start a new one."; $lang['wihlset'] = "ayarlar"; $lang['wiignidle'] = "Boş vaxt"; $lang['wiignidledesc'] = "Bir istifadəçinin boş vaxtını nəzərə almadan bir müddət müəyyənləşdirin.

Bir müştəri serverdə heç bir şey etməzsə (=idle), bu dəfə Ranksystem tərəfindən müəyyən edilir. Bu funksiya ilə müəyyən bir limitə qədər istifadəçinin boş vaxtları onlayn kimi qiymətləndirilmir, əksinə, aktiv vaxt hesab olunur. Yalnız müəyyən edilmiş həddən artıq olduqda, bu nöqtədən Ranks System üçün boş vaxt kimi sayılır.

Bu funksiya yalnız rejimi ilə əlaqəli məsələdir 'active time'.

Bu funksiyanın mənası, məs. söhbətlərdə dinləmə müddətini bir fəaliyyət kimi qiymətləndirir

0 saniyə = funksiyanı dayandırır

Məsələn:
Boş vaxt = 600 (saniyə)
Müştəri 8 dəqiqə dayanır.
└ 8 dəqiqəlik boşluqlar göz ardı olunacaq və istifadəçi buna görə də bu vaxtı aktiv olaraq alır. Kəsintilər artıq 12 dəqiqə artıb, onda vaxt 10 dəqiqə və bu halda 2 dəqiqə boş vaxt kimi hesablanır olunacaq, ilk 10 dəqiqə hələ də fəal vaxt kimi qəbul olunacaqdır."; @@ -503,6 +527,7 @@ $lang['winav11'] = "Xahiş edirik, Ranksystem (TeamSpeak -> Bot-Admin) administratorunun unikal Müştəri ID daxil edin. Veb interfeys üçün giriş məlumatlarınızı unutmusunuzsa (sıfırlamaq üçün) çox vacibdir."; $lang['winav12'] = "Əlavələr"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Verilənlər bazası"; $lang['winav3'] = "Əsas Parametr"; $lang['winav4'] = "Başqa"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Şifrəni yenidən qurmaq üçün aşağıdakıları yerinə yetirmək lazımdır:"; $lang['wiselcld'] = "müştəriləri seçin"; $lang['wiselclddesc'] = "Müştərilərə son bilinən istifadəçi adı, unikal Müştəri-ID və ya Müştəri-verilənlər bazası-ID ilə seçmək.
Birdən çox seçim də mümkündür."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "aktiv vaxt"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git "a/languages/core_cz_\304\214e\305\241tina_cz.php" "b/languages/core_cz_\304\214e\305\241tina_cz.php" index b71dabc..ab79815 100644 --- "a/languages/core_cz_\304\214e\305\241tina_cz.php" +++ "b/languages/core_cz_\304\214e\305\241tina_cz.php" @@ -4,8 +4,8 @@ $lang['adduser'] = "Uživatel %s (unique Client-ID: %s; Client-database-ID %s) ještě není v databázi -> přidán do Ranksystem."; $lang['api'] = "API"; $lang['apikey'] = "API Key"; -$lang['asc'] = "Vzestupně"; -$lang['autooff'] = "Automatický start je zakázán"; +$lang['asc'] = "vzestupně"; +$lang['autooff'] = "autostart is deactivated"; $lang['botoff'] = "Bot je zastaven."; $lang['boton'] = "Bot je spuštěn..."; $lang['brute'] = "Mnoho nepovedených přihlášení do Ranksystému. Přihlášení bylo zablokováno na 300 sekund! Poslední přístup byl z IP adresy %s."; @@ -17,10 +17,10 @@ $lang['chkphpmulti'] = "Provozujete více verzí PHP na vašem systému.

Your webserver (this site) is running with version: %s
The defined command in %s is running with version: %s

Please use the same PHP version for both!

You can define the version for the Ranksystem Bot inside the file %s. More information and examples you will find inside.
Current definition out of %s:
%sYou can also change the PHP version, your webserver is using. Please use the world wide web to get help for this.

We recommend to use always the latest PHP version!

If you can't adjust the PHP versions on your system environment, it works for your purposes, it's ok. However, the only supported way is one single PHP version for both!"; $lang['chkphpmulti2'] = "Cesta k PHP na vaší website:%s"; $lang['clean'] = "Skenuji uživatele ke smazání"; -$lang['clean0001'] = "Odstranění nepoužívaných avatarů %s (erstwhile unique Client-ID: %s) úspěšně dokončeno."; -$lang['clean0002'] = "Chyba při odstraňování nepoužívaných vataru %s (unique Client-ID: %s)."; -$lang['clean0003'] = "Kontrola čištění DB provedena. Všechny nepoužívané objekty byly smazány."; -$lang['clean0004'] = "Kontrola smazaných uživatelů provedena. Žádný uživatel nebyl smazát, protože funkce 'čištění uživatelů' je deaktivována (webinterface - other)."; +$lang['clean0001'] = "Deleted unnecessary avatar %s (erstwhile unique Client-ID: %s) successfully."; +$lang['clean0002'] = "Error while deleting unnecessary avatar %s (unique Client-ID: %s)."; +$lang['clean0003'] = "Check for cleaning database done. All unnecessary stuff was deleted."; +$lang['clean0004'] = "Check for deleting users done. Nothing was changed, because function 'clean clients' is disabled (webinterface - other)."; $lang['cleanc'] = "Čištění uživatelů."; $lang['cleancdesc'] = "S touto funkcí budou staří uživatelé vymazáni z databáze.

Za tímto účelem je systém Ranks sychronizován s databází TeamSpeak. Klienty, které ve službě TeamSpeak neexistují, budou ze systému Ranks vymazány.

Tato funkce je povolena pouze při deaktivaci funkce Query-Slowmode!


Pro automatickou úpravu týmu TeamSpeak databáze ClientCleaner lze použít:
%s"; $lang['cleandel'] = "%s uživatelé byli vymazáni z databáze, protože již dlouho nebyli aktivní."; @@ -32,9 +32,9 @@ $lang['day'] = "%s den"; $lang['days'] = "%s dnů"; $lang['dbconerr'] = "Problém s připojením do databáze: "; -$lang['desc'] = "Sestupně"; +$lang['desc'] = "sestupně"; $lang['descr'] = "Popis"; -$lang['duration'] = "Délka trvání"; +$lang['duration'] = "Duration"; $lang['errcsrf'] = "CSRF Token je invalidní nebo vypršel (=security-check failed)! Aktualizuj stránku a zkus to znovu. Pokud problém přetrvává, smaž soubory Cookie!"; $lang['errgrpid'] = "Změny nebyly uloženy, protože nastal problém s databází. Pro zachování změn vyřešte problémy a uložte znovu."; $lang['errgrplist'] = "Chyba při volání servergrouplist: "; @@ -44,20 +44,21 @@ $lang['error'] = "Chyba (Error) "; $lang['errorts3'] = "TS3 Error: "; $lang['errperm'] = "Prosím ověř oprávnění v adresáři '%s'!"; -$lang['errphp'] = "%1\$s chybí. Je požadována instalace %1\$s !"; +$lang['errphp'] = "%1\$s is missed. Installation of %1\$s is required!"; $lang['errseltime'] = "Zadej prosím online čas, pro přidání!"; -$lang['errselusr'] = "Prosím vyber jednoho z uživatelů!"; +$lang['errselusr'] = "Prosím vyber jednoho uživatele!"; $lang['errukwn'] = "Došlo k neznámé chybě!"; $lang['factor'] = "Factor"; $lang['highest'] = "Nejvyšší rank byl již dosažen!"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "v Sekundách"; $lang['install'] = "Instalace"; $lang['instdb'] = "Nainstalovat databázi"; $lang['instdbsuc'] = "Databáze %s úspěšně vytvořena."; $lang['insterr1'] = "VAROVÁNÍ: Pokoušíte se nainstalovat Ranksystem, ale databáze již s tímto jménem \"%s\" již existuje.
Instalace databáze bude vynechána!
Ujistěte se, že to je v pořádku. Pokud ne, vyberte prosím jiný název databáze."; $lang['insterr2'] = "%1\$s je potřebný k instalaci, ale není nainstalován! Nainstalujte ho pomocí %1\$s a zkuste to znovu!
Path to your PHP config file, if one is defined and loaded: %3\$s"; -$lang['insterr3'] = "PHP %1\$s je požadováno, ale je zakázáno! Povolte prosím funkci: %1\$s A zkuste to znovu!
Cesta k vašemu konfiguračnímu souboru PHP: %3\$s"; +$lang['insterr3'] = "PHP %1\$s function is needed to be enabled but seems to be disabled. Please enable the PHP %1\$s function and try it again!
Path to your PHP config file, if one is defined and loaded: %3\$s"; $lang['insterr4'] = "Vaše PHP verze (%s) je nižší než 5.5.0. Prosím aktulizujte PHP a zkuste to znovu!"; $lang['isntwicfg'] = "Nemohu uložit konfiguraci do databáze! Prosím přidělte všechna práva souboru 'other/dbconfig.php' (Linux: chmod 740; Windows: 'full access') a zkuste to znovu!"; $lang['isntwicfg2'] = "Nakonfigurujte webinterface"; @@ -78,7 +79,7 @@ $lang['isntwiusr'] = "Uživatel byl úspěšně vytvořen a přidán do Admin panelu!"; $lang['isntwiusr2'] = "Povedlo se! Instalace Ranksystému se vydařila."; $lang['isntwiusrcr'] = "Přidat/Vytvořit uživatele do admin panelu."; -$lang['isntwiusrd'] = "Vytvořte přihlašovací údaje pro přístup k webové části Ranksystemu."; +$lang['isntwiusrd'] = "Create login credentials to access the Ranksystem Webinterface."; $lang['isntwiusrdesc'] = "Zadejte uživatelské jméno a heslo pro připojení do admin panelu. Přes admin panel můžete nastavovat Ranksystem."; $lang['isntwiusrh'] = "Admin panel (webinterface)"; $lang['listacsg'] = "Aktuální úroveň"; @@ -98,8 +99,8 @@ $lang['listuid'] = "Unikátní ID"; $lang['listver'] = "Verze klienta"; $lang['login'] = "Přihlášení"; -$lang['module_disabled'] = "Tento Modul je deaktivovaný."; -$lang['msg0001'] = "Ranksystem je ve verzi: %s"; +$lang['module_disabled'] = "This module is deactivated."; +$lang['msg0001'] = "Ranksystem je na verzi: %s"; $lang['msg0002'] = "Seznam příkazů je dostupný zde: [URL]https://ts-ranksystem.com/#commands[/URL]"; $lang['msg0003'] = "Nemáto dostatečné oprávnění pro tento příkaz!"; $lang['msg0004'] = "Uživatel %s (%s) požádal o vypnutí Ranksystemu!"; @@ -118,8 +119,8 @@ $lang['pass5'] = "Zapomenuté heslo?"; $lang['privacy'] = "Zásady ochrany osobních údajů"; $lang['repeat'] = "Opakovat (obnovit)"; -$lang['resettime'] = "Reset online času a délky nečinnosti uživatele %s (unique Client-ID: %s; Client-database-ID %s) ho odebralo zvýjímek (servergroup or client exception).; -$lang['sccupcount'] = "Přidání %s sekund aktivního času uživateli s unikátním Client-ID (%s) bude provedeno během několika sekund (provedení lze zkontrolovat v Ranksystem logu)."; +$lang['resettime'] = "Obnovení času online a nečinnosti uživatele% s (jedinečné ID klienta:% s; klientské databáze-ID% s) na nulu, což způsobilo, že uživatel byl odstraněn z výjimky."; +$lang['sccupcount'] = "Active time of %s seconds for the unique Client-ID (%s) will be added in a few seconds (have a look to the Ranksystem log)."; $lang['sccupcount2'] = "Add an active time of %s seconds for the unique Client-ID (%s); requested about admin function."; $lang['setontime'] = "Přidat čas"; $lang['setontime2'] = "Odebrat čas"; @@ -310,15 +311,15 @@ $lang['stri0018'] = "%s za nizozemský překlad"; $lang['stri0019'] = "%s za francouzský překlad"; $lang['stri0020'] = "%s za portugalský překlad"; -$lang['stri0021'] = "%s za jeho skvělou podporu na GitHubu a na našem serveru, sdílení nápadů, testovaní všech těch hoven a mnoho dalšího... :-)"; +$lang['stri0021'] = "%s za jeho skvělou podporu na GitHubu a na našem serveru, sdílení nápadů, testovaní všech těch hoven a mnoho dalšího..."; $lang['stri0022'] = "%s za sdílení jeho nápadů a testování"; $lang['stri0023'] = "Stabilní od: 18/04/2016."; $lang['stri0024'] = "%s za český překlad"; $lang['stri0025'] = "%s za polský překlad"; $lang['stri0026'] = "%s za španělský překlad"; -$lang['stri0027'] = "%s za přípravu maďarksého překladu"; -$lang['stri0028'] = "%s za ázerbájdžánský překlad"; -$lang['stri0029'] = "%s za imprint funkce"; +$lang['stri0027'] = "%s for initialisation hungarian translation"; +$lang['stri0028'] = "%s for azerbaijan translation"; +$lang['stri0029'] = "%s for the imprint function"; $lang['stta0001'] = "Od počátku věků"; $lang['sttm0001'] = "Tohoto měsíce"; $lang['sttw0001'] = "Nejlepší uživatelé"; @@ -355,20 +356,20 @@ $lang['time_sec'] = "sekund(sec)"; $lang['unknown'] = "unknown"; $lang['upgrp0001'] = "There is a servergroup with ID %s configured inside your '%s' parameter (webinterface -> rank), but that servergroup ID isn't existent on your TS3 server (anymore)! Please correct this or errors might happen!"; -$lang['upgrp0002'] = "Stažení nové ikony serveru"; -$lang['upgrp0003'] = "Chyba při změně ikony serveru."; -$lang['upgrp0004'] = "Chyba při stahování ikony TS3 Serveru z TS3 serveru: "; -$lang['upgrp0005'] = "Chyba při mazání ikony serveru."; +$lang['upgrp0002'] = "Download new ServerIcon"; +$lang['upgrp0003'] = "Error while writing out the servericon."; +$lang['upgrp0004'] = "Error while downloading TS3 ServerIcon from TS3 server: "; +$lang['upgrp0005'] = "Error while deleting the servericon."; $lang['upgrp0006'] = "Noticed the ServerIcon got removed from TS3 server, now it was also removed from the Ranksystem."; $lang['upgrp0007'] = "Error while writing out the servergroup icon from group %s with ID %s."; $lang['upgrp0008'] = "Error while downloading servergroup icon from group %s with ID %s: "; $lang['upgrp0009'] = "Error while deleting the servergroup icon from group %s with ID %s."; $lang['upgrp0010'] = "Noticed icon of severgroup %s with ID %s got removed from TS3 server, now it was also removed from the Ranksystem."; $lang['upgrp0011'] = "Download new ServerGroupIcon for group %s with ID: %s"; -$lang['upinf'] = "Nová verze Ranksystému je k dispozici; Informace pro klienty na serveru..."; -$lang['upinf2'] = "Ranksystem (%s) byl updatován. Zkontrolujte %sChangelog%s pro informace o změnách."; -$lang['upmsg'] = "\nNová verze [B]Ranksystem[/B] je dostupná!\n\nStávající verze: %s\n[B]Nová verze: %s[/B]\n\nPro bližší informace navštivte náš web [URL]%s[/URL].\n\nStarting the update process in background. [B]Please check the ranksystem.log![/B]"; -$lang['upmsg2'] = "\nHey, the [B]Ranksystem[/B] has been updated.\n\n[B]new version: %s[/B]\n\nPro bližší informace navštivte náš web [URL]%s[/URL]."; +$lang['upinf'] = "A new Version of the Ranksystem is available; Inform clients on server..."; +$lang['upinf2'] = "The Ranksystem was recently (%s) updated. Check out the %sChangelog%s for more information about the changes."; +$lang['upmsg'] = "\nHey, a new version of the [B]Ranksystem[/B] is available!\n\ncurrent version: %s\n[B]new version: %s[/B]\n\nPlease check out our site for more informations [URL]%s[/URL].\n\nStarting the update process in background. [B]Please check the ranksystem.log![/B]"; +$lang['upmsg2'] = "\nHey, the [B]Ranksystem[/B] has been updated.\n\n[B]new version: %s[/B]\n\nPlease check out our site for more informations [URL]%s[/URL]."; $lang['upusrerr'] = "Unique Client-ID %s se nemohl připojit na TeamSpeak!"; $lang['upusrinf'] = "Uživatel %s byl úspěšně informovaný.."; $lang['user'] = "Jméno"; @@ -411,38 +412,53 @@ $lang['widbgdesc'] = "Set up the Log-Level of the Ranksystem. With this you can decide, how much information should be written to the file \"ranksystem.log\"

The higher the Log-Level, the more information you'll get.

Changing the Log-Level will take effect with the next restart of the Ranksystem bot.

Please don't let the Ranksystem running longer on \"6 - DEBUG\" this could impair your filesystem!"; $lang['widelcldgrp'] = "Obnovit skupiny (groups)"; $lang['widelcldgrpdesc'] = "Rankssystém si vzpomíná na dané serverové skupiny, takže to nemusíte dávat / zkontrolovat s každým spustením pracovníka.php.

Pomocí této funkce můžete jednou jednou odstranit znalosti o daných serverových skupinách. Ve skutečnosti se řadový systém snaží poskytnout všem klientům (které jsou na serveru TS3 online) serverovou skupinu skutečné pozice.
Pro každého klienta, který dostane skupinu nebo zůstane ve skupině, si Ranksystem pamatuje to tak, jak bylo popsáno na začátku.

Tato funkce může být užitečná, pokud uživatel není v serverové skupině, měl by být pro definovaný čas online.

Pozor: Spusťte to v okamžiku, kdy v následujících několika minutách nekupujete být splatný !!! Ranksystem nemůže odstranit starou skupinu, protože si ji nemůže vzpomenout ;-)"; -$lang['widelsg'] = "Odebrat ze serverových skupin"; +$lang['widelsg'] = "odebrat ze serverových skupin"; $lang['widelsgdesc'] = "Zvolte, zda by klienti měli být také odstraněni z poslední známé skupiny serverů, když odstraníte klienty z databáze Ranksystem.

Bude se jednat pouze o serverové skupiny, které se týkaly systému Ranksystem"; $lang['wiexcept'] = "Výjimky"; -$lang['wiexcid'] = "Kanálová výjimka"; +$lang['wiexcid'] = "kanálová výjimka"; $lang['wiexciddesc'] = "Seznam oddělených čárkami ID kanálů, které se nepodílejí na systému Ranks.

Zůstaňte uživatelé v jednom z uvedených kanálů, čas, který bude zcela ignorován. Neexistuje ani on-line čas, ale počítá se doba nečinnosti.

Tato funkce má smysl pouze s režimem 'online čas', protože zde mohou být ignorovány například kanály AFK.
Režim 'aktivní' čas , tato funkce je zbytečná, protože by byla odečtena doba nečinnosti v místnostech AFK a tudíž nebyla započítána.

Být uživatel v vyloučené kanálu, je to pro toto období poznamenáno jako' vyloučeno z Ranksystemu '. Uživatel se už nezobrazuje v seznamu 'stats / list_rankup.php', pokud se tam na něm nezobrazí vyloučené klienty (stránka Statistiky - výjimka pro klienta)."; $lang['wiexgrp'] = "výjimka pro serverovou skupinu"; $lang['wiexgrpdesc'] = "Čárka oddělený seznam ID serverových skupin, který by neměl být považován za Ranksystem.
Uživatel v alespoň jednom z těchto ID serverových skupin bude ignorován pro hodnocení."; -$lang['wiexres'] = "Výjímkový mod"; -$lang['wiexres1'] = "Doba počítání (výchozí)"; -$lang['wiexres2'] = "Přestávka"; -$lang['wiexres3'] = "Čas resetování"; +$lang['wiexres'] = "výjímkový mod"; +$lang['wiexres1'] = "doba počítání (výchozí)"; +$lang['wiexres2'] = "přestávka"; +$lang['wiexres3'] = "čas resetování"; $lang['wiexresdesc'] = "Existují tři režimy, jak zacházet s výjimkou. V každém případě je pozici (přiřazení serverové skupiny) zakázáno. Můžete si zvolit různé možnosti, jak by měl být vynaložen čas strávený od uživatele (který je vyloučen).

1) doba počítání (výchozí): Ve výchozím nastavení Ranksystem také počítá online / aktivní čas uživatelů, které jsou vyloučeny (klient / servergroup). S výjimkou je zakázána pouze pozice (přiřazení serverové skupiny). To znamená, že pokud uživatel není více vyloučen, bude mu přiřazen do skupiny v závislosti na jeho shromážděném čase (např. Úroveň 3).

2) čas přestávky: Na této volbě strávit čas online a nečinně zmrznout (zlomit) na skutečnou hodnotu (předtím, než je uživatel vyloučen). Po vynechání výjimky (po odebrání výjimky pro skupinu serverů nebo odebrání pravopisu výpovědi) se počítá 'počítání'.

3) čas vynulování: S touto funkcí se počítá doba online a nečinnosti bude v okamžiku, kdy již uživatel není vyloučen, vynulován (vynecháním výjimky skupiny serverů nebo odebráním pravidla výjimky). Týdenní výjimka by se stále počítala, dokud se neobnoví.


Výjimka z kanálu nezáleží na tom, protože čas bude vždy ignorován (jako je režim přerušení)."; -$lang['wiexuid'] = "Klientská výjimka"; +$lang['wiexuid'] = "klientská výjimka"; $lang['wiexuiddesc'] = "Čárka odděluje seznam jedinečných identifikátorů klientů, které by se neměly týkat systému Ranks.
Uživatel v tomto seznamu bude ignorován pro hodnocení."; $lang['wigrpimp'] = "Import Mode"; $lang['wigrpt1'] = "Čas v sekundách"; $lang['wigrpt2'] = "Servergroup"; $lang['wigrpt3'] = "Permanent Group"; -$lang['wigrptime'] = "Definice pořadí"; -$lang['wigrptime2desc'] = "Definujte čas, po kterém by měl uživatel automaticky získat předdefinovanou serverovou skupinu.

čas v sekundách => ID serverové skupiny => permanent flag

Max. hodnota je 999.999.999 sekund (přes 31 let).

Zadané sekundy budou hodnoceny jako 'online čas' nebo 'aktivní čas', v závislosti na zvoleném „časovém režimu“.


Čas v sekundách je potřeba zadávat kumulativně!

špatně:

100 seconds, 100 seconds, 50 seconds
správně:

100 seconds, 200 seconds, 250 seconds
"; +$lang['wigrptime'] = "definice pořadí"; +$lang['wigrptime2desc'] = " +Definujte čas, po kterém by měl uživatel automaticky získat předdefinovanou serverovou skupinu.

čas v sekundách => ID serverové skupiny => permanent flag

Max. hodnota je 999.999.999 sekund (přes 31 let).

Zadané sekundy budou hodnoceny jako 'online čas' nebo 'aktivní čas', v závislosti na zvoleném „časovém režimu“.


Čas v sekundách je potřeba zadávat kumulativně!

špatně:

100 seconds, 100 seconds, 50 seconds
správně:

100 seconds, 200 seconds, 250 seconds
"; $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Definujte zde a po uplynutí této doby by měl uživatel automaticky získat předdefinovanou serverovou skupinu.

Max. value are 999.999.999 seconds (over 31 years)

čas (sekund) => ID skupiny serverů => permanent flag

Důležité pro toto je 'online čas' nebo 'aktivní čas' uživatel v závislosti na nastavení režimu.

Každý záznam se oddělí od dalšího čárkou.

Čas musí být zadán kumulativní

Příklad:
60=>9=>0,120=>10=>0,180=>11=>0
Na tomto uživatelé dostanou po 60 sekundách servergroup 9, poté po 60 sekundách servergroup 10 a tak dále ..."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Seznam hodnocení (režim administrátora)"; $lang['wihladm0'] = "Popis funkce (klikni)"; $lang['wihladm0desc'] = "Choose one or more reset options and press \"start reset\" to start it.
Each option is described by itself.

After starting the reset job(s), you can view the status on this site.

The reset task will be done about the Ranksystem Bot as a job.
It is necessary the Ranksystem Bot is running.
Do NOT stop or restart the Bot during the reset is in progress!

For the time of running the reset, the Ranksystem will pause all other things. After completing the reset the Bot will automatically go on with the normal work.
Again, do NOT stop or restart the Bot!

When all jobs are done, you need to confirm them. This will reset the status of the jobs. That makes it possible to start a new reset.

In case of a reset you might also want to withdraw servergroups from the users. It is important not to change the 'rank up definition', before you have done this reset. After reset you can change the 'rank up definition', sure!
The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


Be aware, there is no way of return!"; $lang['wihladm1'] = "Přidat čas"; $lang['wihladm2'] = "Odebrat čas"; $lang['wihladm3'] = "Reset Ranksystem"; -$lang['wihladm31'] = "Reset statistik všech uživatelů"; +$lang['wihladm31'] = "reset statistik všech uživatelů"; $lang['wihladm311'] = "zero time"; -$lang['wihladm312'] = "Smaž uživatele"; +$lang['wihladm312'] = "smaž uživatele"; $lang['wihladm31desc'] = "Choose one of the both options to reset the statistics of all users.

zero time: Resets the time (online time & idle time) of all users to a value of 0.

delete users: With this option, all users will be deleted out of the Ranksystem database. The TeamSpeak database will not be touched!


Both options affect the following things..

.. on zero time:
Reset Server statistics summary (table: stats_server)
Reset My statistics (table: stats_user)
Reset List Rankup / user statistics (table: user)
Cleans Top users / user statistic snapshots (table: user_snapshot)

.. on delete users:
Cleans donut chart nations (table: stats_nations)
Cleans donut chart platforms (table: stats_platforms)
Cleans donut chart versions (table: stats_versions)
Reset Server statistics summary (table: stats_server)
Cleans My statistics (table: stats_user)
Cleans List Rankup / user statistics (table: user)
Cleans user ip-hash values (table: user_iphash)
Cleans Top users / user statistic snapshots (table: user_snapshot)"; $lang['wihladm32'] = "withdraw servergroups"; $lang['wihladm32desc'] = "Activate this function to withdraw the servergroups from all TeamSpeak users.

The Ranksystem scans each group, which is defined inside the 'rank up definition'. It will remove all user, which are known by the Ranksystem, out of this groups.

That's why it is important not to change the 'rank up definition', before you have done the reset. After reset you can change the 'rank up definition', sure!


The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


The servergroup itself on the TeamSpeak server will not be removed / touched."; @@ -453,15 +469,24 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "zakázaná"; $lang['wihladmrs1'] = "vytvořeno"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Zbývající čas do resetu systému"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Opravdu chcete systém resetovat?"; $lang['wihladmrs13'] = "Ano, spust reset"; $lang['wihladmrs14'] = "Ne, zruš reset"; -$lang['wihladmrs15'] = "Prosím vyber si jednu z možností!"; +$lang['wihladmrs15'] = "Please choose at least one option!"; $lang['wihladmrs16'] = "povoleno"; $lang['wihladmrs2'] = "spracovávám.."; $lang['wihladmrs3'] = "faulted (ended with errors!)"; @@ -469,7 +494,7 @@ $lang['wihladmrs5'] = "Reset Job(s) successfully created."; $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; -$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the reset is in progress!"; +$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the job is in progress!"; $lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; $lang['wihlset'] = "nastavení"; $lang['wiignidle'] = "Ignorování nečinnosti"; @@ -503,6 +528,7 @@ $lang['winav11'] = "Zadejte prosím jedinečné ID klienta administrátora Ranksystem (TeamSpeak -> Bot-Admin). To je velmi důležité v případě, že jste přišli o své přihlašovací údaje pro webinterface (resetovat je)."; $lang['winav12'] = "Moduly"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Databáze"; $lang['winav3'] = "Hlavní nastavení"; $lang['winav4'] = "Ostatní"; @@ -536,6 +562,8 @@ $lang['wirtpw9'] = "Pro obnovení hesla je třeba provést následující kroky:"; $lang['wiselcld'] = "vyberte klienty"; $lang['wiselclddesc'] = "Vyberte klienty podle jejich posledního známého uživatelského jména, jedinečného ID klienta nebo ID databáze klienta.
Více možností je možné vybrat."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Zobrazit/skrýt sloupec"; $lang['wishcolat'] = "aktivní čas"; $lang['wishcoldesc'] = "Chcete-li tento sloupec zobrazit nebo skrýt na stránce statistik, přepněte jej na 'on' nebo 'off'.

To vám umožní individuálně nakonfigurovat seznam povyšení (stats/list_rankup.php)."; @@ -554,10 +582,10 @@ $lang['wishhicld'] = "Klienti na nejvyšší úrovni"; $lang['wishhiclddesc'] = "Zobrazit klienty v seznamu_rankup.php, který dosáhl nejvyšší úrovně v systému Ranks."; $lang['wishmax'] = "Server usage graph"; -$lang['wishmax0'] = "Ukaž všechny statistiky"; -$lang['wishmax1'] = "skryj max. uživatelů"; -$lang['wishmax2'] = "skryj kanál channel"; -$lang['wishmax3'] = "skryj max. uživatelů + kanál"; +$lang['wishmax0'] = "show all stats"; +$lang['wishmax1'] = "hide max. clients"; +$lang['wishmax2'] = "hide channel"; +$lang['wishmax3'] = "hide max. clients + channel"; $lang['wishmaxdesc'] = "Choose which stats should be displayed on the server usage graph on 'stats/' page.

By default, all stats are visible. You can hide here some stats, if needed."; $lang['wishnav'] = "zobrazit navigaci na webu"; $lang['wishnavdesc'] = "Zobrazit stránku navigace na stránce 'statistiky'.

Pokud je tato možnost deaktivována na stránce statistik, navigace na webu bude skryta. 'stats / list_rankup.php' a vložte jej jako rámeček do stávajícího webu nebo do tabulky."; diff --git a/languages/core_de_Deutsch_de.php b/languages/core_de_Deutsch_de.php index ee2cb3f..b0af82b 100644 --- a/languages/core_de_Deutsch_de.php +++ b/languages/core_de_Deutsch_de.php @@ -51,6 +51,7 @@ $lang['factor'] = "Faktor"; $lang['highest'] = "höchster Rang erreicht"; $lang['imprint'] = "Impressum"; +$lang['input'] = "Eingabewert"; $lang['insec'] = "in Sekunden"; $lang['install'] = "Installation"; $lang['instdb'] = "Installiere Datenbank"; @@ -381,7 +382,8 @@ $lang['wiadmhide'] = "unterdrücke ausgeschl. User"; $lang['wiadmhidedesc'] = "Hiermit können vom Ranksystem ausgeschlossene User in der folgenden Auswahl unterdrückt werden."; $lang['wiadmuuid'] = "Bot-Admin"; -$lang['wiadmuuiddesc'] = "Choose the user, which are the administrator(s) of the Ranksystem.
Also multiple selections are possible.

Here listed users are the user of your TeamSpeak server. Be sure, you are online there. When you are offline, go online, restart the Ranksystem Bot and reload this site.


The administrator of the Ranksystem Bot have the privileges:

- to reset the password for the webinterface.
(Note: Without definition of an administrator, it is not possible to reset the password!)

- using Bot commands with Bot-Admin privileges
(A list of commands you'll find %shere%s.)"; +$lang['wiadmuuiddesc'] = "Lege einen User als Administrator des Ranksystems fest.
Auch mehrere User können gewählt werden.

+Die hier aufgelisteten User sind die User, welche auf dem TeamSpeak Server online sind bzw. waren und das Ranksystem schon kennt. Sofern der gewünschte User nicht gelistet wird, stelle sicher das dieser auf dem TS online ist, starte den Ranksystem-Bot ggfs. neu und lade diese Seite nochmals, um die Liste zu aktualisieren.


Der Administrator des Ranksystem-Bots hat die Privilegien:

-, um das Passwort für das Webinterface zurückzusetzen.
(Hinweis: Ohne Definition eines Administrators ist es nicht möglich, das Passwort im Bedarfsfall zurückzusetzen!)

- Bot-Befehle mit Admin-Privilegien auszuführen
(Eine Liste der Befehle befindet sich %shier%s.)"; $lang['wiapidesc'] = "Mit der API ist es möglich, Daten (welche das Ranksystem gesammelt hat) an Dritt-Software weiterzugeben.

Um Informationen abfragen zu können, ist eine Authentifizierung mit einem API Schlüssel erforderlich. Die Schlüssel können hier verwaltet werden.

Die API ist erreichbar unter:
%s

Die Ausgabe (Rückgabewert) der API erfolgt mittels einem JSON string. Eine Dokumentation der API erfolgt durch sich selbst; einfach den Link oben öffnen und der dortigen Beschreibung folgen."; $lang['wiboost'] = "Boost"; $lang['wiboost2desc'] = "Hier können Boost-Gruppen definiert werden, um z.B. User zu belohnen. Damit sammeln sie schneller Zeit und steigen somit schneller im Rang.

Was ist zu tun?

1) Erstelle zunächst eine Servergruppe auf dem TS Server, welche als Boost-Gruppe genutzt werden kann.

2) Hinterlege die Boost-Definition auf dieser Seite.

Servergruppe: Wähle eine Servergruppe, welche den Boost auslösen soll.

Boost Faktor: Der Faktor, mit welchem die online/aktive Zeit eines Users geboostet wird, welcher die Servergruppe innehat (Beispiel: 2-fach). Als Faktor sind Zahlen mit Nachkommastellen (=Dezimalzahlen) zulässig (z.B. 1.5). Nachkommastellen sind durch einen Punkt zu trennen!

Gültigkeitsdauer in Sekunden: Lege fest, wie lange der Boost aktiv sein soll. Ist die Zeit abgelaufen, wird die Boost-Gruppe automatisch von den betroffenen Usern entfernt. Die Zeit beginnt in dem Moment zu laufen, in dem der User die Servergruppe erhält. Die Zeit läuft weiterhin ab, auch wenn der User offline ist.

3) Gebe einem oder mehreren Usern die definierte Servergruppe auf dem TS Server, um sie zu boosten."; @@ -434,6 +436,20 @@ $lang['wigrptime3desc'] = "

Permanente Gruppe
Dies ermöglicht es, eine Servergruppe als 'permanent' zu kennzeichnen, die dann bei der nächsten Rangsteigerung nicht entfernt werden soll. Die Zeile, mit dieser Kennzeichnung (='ON'), bleibt vom Ranksystem dauerhaft erhalten.
Mit der Voreinstellung (='OFF'), wird die aktuelle Servergruppe zu dem Zeitpunkt entfernt, zu dem der User einen höheren Rang erreicht."; $lang['wigrptimedesc'] = "Definiere hier, nach welcher Zeit ein User automatisch in eine vorgegebene Servergruppe gelangen soll.

Zeit (Sekunden) => Servergruppen ID => Permanente Gruppe

Maximaler Wert sind 999.999.999 Sekunden (über 31 Jahre)

Die eingegebenen Sekunden werden als 'online Zeit' oder 'aktive Zeit' gewertet, je nach dem welcher 'Zeit-Modus' gewählt ist.

Jeder Eintrag ist vom nächsten durch ein Komma zu separieren.

Die Zeiten sind kumulativ zu hinterlegen.

Beispiel:
60=>9=>0,120=>10=>0,180=>11=>0
In diesem Beispiel erhält ein User die Servergruppe 9 nach 60 Sekunden, die Servergruppe 10 nach weiteren 60 Sekunden, die Servergruppe 11 nach weiteren 60 Sekunden."; $lang['wigrptk'] = "kumulativ"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "erlaube jede Ressource"; +$lang['wiheadacao3'] = "erlaube individuelle URL"; +$lang['wiheadacaodesc'] = "Mit dieser Option kann der Access-Control-Allow-Origin Header definiert werden. Weitere Informationen sind hier zu finden:
%s

An dieser Position kann der Wert für den 'Access-Control-Allow-Origin' hinterlegt werden.
Lege eine Quelle fest, um nur Anfragen von dieser Quelle zuzulassen.
Beispiel:
https://ts-ranksystem.com


Multiple Quellen können getrennt mit einem Komma angegeben werden.
Beispiel:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Aktiviere dies, um den Header auf die Option 'nosniff' zu setzen."; +$lang['wiheaddesc'] = "Mit dieser Option kann der %s Header definiert werden. Weitere Informationen sind hier zu finden:
%s"; +$lang['wiheaddesc1'] = "Wähle 'deaktiviert', um diesen Header nicht durch das Ranksystem zu setzen."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "deaktiviere XSS Filter"; +$lang['wiheadxss2'] = "aktiviere XSS Filter"; +$lang['wiheadxss3'] = "filter XSS Inhalte"; +$lang['wiheadxss4'] = "blocke vollständiges Rendern"; $lang['wihladm'] = "List Rankup (Admin-Modus)"; $lang['wihladm0'] = "Funktions-Beschreibung (hier klicken)"; $lang['wihladm0desc'] = "Wähle eine oder mehrere Optionen und drücke 'Starte Reset', um einen Reset auszuführen.
Jede Option ist nochmals für sich beschrieben.

Der Reset wird über den Ranksystem Bot als Job ausgeführt. Nach dem Start eines Reset-Jobs kannst du den Status auf dieser Seite einsehen.

Es ist erforderlich, dass der Ranksystem Bot läuft.
Solange der Reset in Bearbeitung ist, darf der Bot NICHT gestoppt oder neu gestartet werden!

In der Zeit, in der der Reset läuft, werden alle anderen Aufgaben des Ranksystem ausgesetzt. Nach Abschluss setzt der Bot automatisch seine reguläre Arbeit fort.
Nochmals, bitte NICHT den Bot stoppen oder neustarten!

Wenn alle Jobs erledigt sind, musst du diese bestätigen. Dadurch wird der Job-Status zurückgesetzt, was es ermöglicht weitere Resets zu starten.

Im Falle eines Resets möchtest du evtl. auch die Servergruppen entziehen. Es ist wichtig dafür die 'Rangsteigerungs Defintion' vor Abschluss des Resets nicht zu verändern. Danach kann diese natürlich angepasst werden!
Das Entziehen der Servergruppen kann eine Weile dauern. Bei aktiven 'Query-Slowmode' wird die Laufzeit nochmals stark erhöht. Wir empfehlen daher einen deaktivierten 'Query-Slowmode'!


Beachte, es gibt keinen Weg zurück!"; @@ -453,11 +469,20 @@ $lang['wihladm35'] = "Starte Reset"; $lang['wihladm36'] = "Bot danach stoppen"; $lang['wihladm36desc'] = "Ist diese Option aktiviert, wird der Ranksystem Bot gestoppt, nachdem alle Reset-Dinge erledigt sind.

Dieser Stop funktioniert exakt wie der normale Stop-Befehl. Heißt, der Bot wird nicht durch den 'check' Parameter gestartet.

Um den Ranksystem Bot zu starten, benutze den 'start' oder 'restart' Parameter."; +$lang['wihladmex'] = "Datenbank Export"; +$lang['wihladmex1'] = "Datenbank Export Job erfolgreich abgeschlossen."; +$lang['wihladmex2'] = "Beachte:%s Das Passwort für den ZIP Container ist das aktuelle TS3 Query-Passwort:"; +$lang['wihladmex3'] = "Datei %s erfolgreich gelöscht."; +$lang['wihladmex4'] = "Beim Löschen der Datei '%s' ist ein Fehler aufgetreten. Existiert die Datei noch und bestehen Berechtigung diese zu löschen?"; +$lang['wihladmex5'] = "Download Datei"; +$lang['wihladmex6'] = "Lösche Datei"; +$lang['wihladmex7'] = "Erstelle SQL Export"; +$lang['wihladmexdesc'] = "Mit dieser Funktion kann ein Export/Backup der Ranksystem-Datenbank erstellt werden. Als Ausgabe wird eine SQL-Datei erzeugt, die ZIP-komprimiert ist.

Der Export kann je nach Größe der Datenbank einige Minuten dauern. Er wird als Job vom Ranksystem-Bot ausgeführt.
Bitte NICHT den Ranksystem-Bot stoppen oder neu starten, während der Job läuft!


Bevor ein Export gestartet wird, sollte ggfs. der Webserver so konfiguriert werden, dass 'ZIP'- und 'SQL'-Dateien innerhalb des Log-Pfades (Webinterface -> Anderes -> Log-Pfad) nicht für Clients zugänglich sind. Dies schützt Ihren Export, da sich darin sensible Daten befinden, wie z.B. die TS3-Query-Zugangsdaten. Der User des Webservers benötigt trotzdem Berechtigungen für diese Dateien, um auf sie für den Download über das Webinterface zugreifen zu können!

Überprüfe nach dem Download die letzte Zeile der SQL-Datei, um sicherzustellen, dass die Datei vollständig geschrieben wurde. Sie muss lauten:
-- Finished export

Bei PHP-Version >= 7.2 wird die 'ZIP'-Datei passwortgeschützt. Als Passwort verwenden wir das TS3-Query-Passwort, welches in den 'TeamSpeak'-Optionen festgelegt ist.

Die SQL-Datei kann bei Bedarf direkt in die Datenbank importiert werden. Dafür kann z.B. phpMyAdmin verwenden werden, ist aber nicht zwangläufig nötig. Es kann jegliche Möglichkeit genutzt werden, eine SQL-Datei in die Datenbank zu importieren.
Vorsicht beim Import der SQL-Datei. Alle vorhandenen Daten in der gewählten Datenbank werden dadurch gelöscht/überschrieben!"; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "deaktiviert"; $lang['wihladmrs1'] = "erstellt"; $lang['wihladmrs10'] = "Job-Status erfolgreich zurückgesetzt!"; -$lang['wihladmrs11'] = "Benötigte Zeit zum Zurücksetzen des Systems"; +$lang['wihladmrs11'] = "Erwartete Zeit um den Job abzuschließen"; $lang['wihladmrs12'] = "Bist du dir sicher, dass du immer noch den Reset ausführen möchtest?"; $lang['wihladmrs13'] = "Ja, starte Reset"; $lang['wihladmrs14'] = "Nein, abbrechen"; @@ -469,8 +494,8 @@ $lang['wihladmrs5'] = "Job(s) für Reset erfolgreich erstellt."; $lang['wihladmrs6'] = "Es ist bereits ein Reset-Job aktiv. Bitte warte bis alles erledigt ist, bevor du weitere startest!"; $lang['wihladmrs7'] = "Drücke %s Aktualisieren %s um den Status zu beobachten."; -$lang['wihladmrs8'] = "Solange der Reset in Bearbeitung ist, darf der Bot NICHT gestoppt oder neu gestartet werden!"; -$lang['wihladmrs9'] = "Bitte %s bestätige %s die Jobs. Damit wird der Job-Status zurücksetzt, sodass ein neuer Reset gestartet werden könnte."; +$lang['wihladmrs8'] = "Solange ein Job in Bearbeitung ist, darf der Bot NICHT gestoppt oder neu gestartet werden!"; +$lang['wihladmrs9'] = "Bitte %s bestätige %s die Jobs. Damit wird der Job-Status zurücksetzt, sodass ein neuer gestartet werden könnte."; $lang['wihlset'] = "Einstellungen"; $lang['wiignidle'] = "Ignoriere Idle"; $lang['wiignidledesc'] = "Lege eine Zeit fest, bis zu der die Idle-Zeit eines Users ignoriert werden soll.

Unternimmt ein Client nichts auf dem Server (=Idle), kann diese Zeit vom Ranksystem festgestellt werden. Mit dieser Funktion wird die Idle-Zeit eines User bis zur definierten Grenze nicht als Idle-Zeit gewertet, sprich sie zählt dennoch als aktive Zeit. Erst wenn der definierte Wert überschritten wird, zählt sie ab diesem Zeitpunkt für das Ranksystem auch als Idle-Zeit.

Diese Funktion spielt nur in Verbindung mit dem Modus 'aktive Zeit' eine Rolle.
Sinn der Funktion ist es z.B. die Zeit des Zuhörens bei Gesprächen als Aktivität zu werten.

0 Sec. = Deaktivieren der Funktion

Beispiel:
Ignoriere Idle = 600 (Sekunden)
Ein Client hat einen Idle von 8 Minuten.
Folge:
Die 8 Minuten Idle werden ignoriert und der User erhält demnach diese Zeit als aktive Zeit. Wenn sich die Idle-Zeit nun auf 12 Minuten erhöht, so wird die Zeit über 10 Minuten, also 2 Minuten, auch als Idle-Zeit gewertet. Die ersten 10 Minuten zählen weiterhin als aktive Zeit."; @@ -503,6 +528,7 @@ $lang['winav11'] = "Bitte definiere einen Bot-Admin, welcher der Administrator des Ranksystems ist (TeamSpeak -> Bot-Admin). Dies ist sehr wichtig im Falle des Verlustes der Login-Daten für das Webinterface."; $lang['winav12'] = "Addons"; $lang['winav13'] = "Allgemein (Statistiken)"; +$lang['winav14'] = "Die Navbar der Statistik-Seite wurde deaktiviert. Soll die Statistik-Seite vielleicht als Iframe in eine andere Webseite eingebunden werden? Dann werfe einen Blick auf diese FAQ:"; $lang['winav2'] = "Datenbank"; $lang['winav3'] = "Kern"; $lang['winav4'] = "Anderes"; @@ -522,7 +548,7 @@ $lang['winxmsgdesc1'] = "Definiere eine Nachricht, welche ein User als Antwort auf den Befehl \"!nextup\" erhält.

Argumente:
%1$s - Tage zur nächsten Rangsteigerung
%2$s - Stunden zur nächsten Rangsteigerung
%3$s - Minuten zur nächsten Rangsteigerung
%4$s - Sekunden zur nächsten Rangsteigerung
%5\$s - Name der nächsten Servergruppe (Rank)
%6$s - Name des Users (Empfänger)
%7$s - aktueller User Rank
%8$s - Name der aktuellen Servergruppe
%9$s - aktuelle Servergruppe seit (Zeitpunkt)


Beispiel:
Deine nächste Rangsteigerung ist in %1$s Tagen, %2$s Stunden, %3$s Minuten und %4$s Sekunden. Die nächste Servergruppe, die du erreichst ist [B]%5$s[/B].
"; $lang['winxmsgdesc2'] = "Definiere eine Nachricht, welche ein User als Antwort auf den Befehl \"!nextup\" erhält, wenn der User bereits im höchsten Rang ist.

Argumente:
%1$s - Tage zur nächsten Rangsteigerung
%2$s - Stunden zur nächsten Rangsteigerung
%3$s - Minuten zur nächsten Rangsteigerung
%4$s - Sekunden zur nächsten Rangsteigerung
%5vs - Name der nächsten Servergruppe (Rank)
%6$s - Name des Users (Empfänger)
%7$s - aktueller User Rank
%8$s - Name der aktuellen Servergruppe
%9$s - aktuelle Servergruppe seit (Zeitpunkt)


Beispiel:
Du hast bereits den höchsten Rang erreicht seit %1$s Tagen, %2$s Stunden, %3$s Minuten und %4$s Sekunden.
"; $lang['winxmsgdesc3'] = "Definiere eine Nachricht, welche ein User als Antwort auf den Befehl \"!nextup\" erhält, wenn der User vom Ranksystem ausgeschlossen ist.

Argumente:
%1$s - Tage zur nächsten Rangsteigerung
%2$s - Stunden zur nächsten Rangsteigerung
%3$s - Minuten zur nächsten Rangsteigerung
%4$s - Sekunden zur nächsten Rangsteigerung
%5$s - Name der nächsten Servergruppe (Rank)
%6$s - Name des Users (Empfänger)
%7$s - aktueller User Rank
%8$s - Name der aktuellen Servergruppe
%9$s - aktuelle Servergruppe seit (Zeitpunkt)


Beispiel:
Du bist vom Ranksystem ausgeschlossen. Wenn du eine Teilnahme am Ranksystem wünschst, kontaktiere einen Admin auf dem TS3 Server.
"; -$lang['wirtpw1'] = "Sorry Bro, du hast vergessen einen Bot-Admin im Webinterface zu hinterlegen. The only way to reset is by updating your database! A description how to do can be found here:
%s"; +$lang['wirtpw1'] = "Sorry Bro, du hast vergessen einen Bot-Admin im Webinterface zu hinterlegen. Nun kann das Passwort nur noch über einen direkten Eingriff in die Datenbank geändert werden. Eine Beschreibung dazu befindet sich hier:
%s"; $lang['wirtpw10'] = "Du musst mit dem TeamSpeak3 Server verbunden sein."; $lang['wirtpw11'] = "Du musst mit der eindeutigen Client-ID online sein, welche als Bot-Admin definiert wurde."; $lang['wirtpw12'] = "Du musst mit der gleichen IP Adresse mit dem TeamSpeak3 Server verbunden sein, welche auch hier auf dieser Seite genutzt wird (und auch das gleiche Protokoll IPv4 / IPv6)."; @@ -536,6 +562,8 @@ $lang['wirtpw9'] = "Folgende Dinge werden für den Reset benötigt:"; $lang['wiselcld'] = "wähle User"; $lang['wiselclddesc'] = "Wähle ein oder mehrere User anhand des zuletzt bekannten Nicknamen, der eindeutigen Client-ID oder der Client-Datenbank-ID.

Mehrfachselektionen sind durch einen Klick oder mit der Enter-Taste möglich."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "Mit dem 'SameSite' Attribut (des Set-Cookie HTTP-Antwort-Headers) kann bestimmt werden, ob das Cookie auf den First-Party-Kontext (=gleiche Domain/Webseite) beschränkt werden soll oder auch für ander Webseiten zur Verfügung stehen soll. Weitere Informationen sind hier zu finden:
%s

Das 'SameSite' Attribut für das Ranksystem kann hier definiert werden. Dies kann insbesondere notwendig/nützlich sein, wenn das Ranksystem mit einem Iframe in einer anderen Website eingebettet wird.

Die Funktion wird nur mit PHP 7.3 oder höher unterstützt."; $lang['wishcol'] = "Zeige/Verstecke Spalte"; $lang['wishcolat'] = "aktive Zeit"; $lang['wishcoldesc'] = "Stelle den Schalter auf 'ON' bzw. 'OFF', um die Spalte auf der Statistik-Seite anzuzeigen bzw. zu deaktivieren.

Dies erlaubt die Rank-Liste (stats/list_rankup.php) individuell zu gestalten."; diff --git a/languages/core_en_english_gb.php b/languages/core_en_english_gb.php index 56931e1..b3851f5 100644 --- a/languages/core_en_english_gb.php +++ b/languages/core_en_english_gb.php @@ -1,7 +1,7 @@ added to the Ranksystem now."; +$lang['adduser'] = "Added new user %s (unique Client-ID: %s; Client-database-ID %s) to the Ranksystem database."; $lang['api'] = "API"; $lang['apikey'] = "API Key"; $lang['asc'] = "ascending"; @@ -51,6 +51,7 @@ $lang['factor'] = "Factor"; $lang['highest'] = "highest rank reached"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "in Seconds"; $lang['install'] = "Installation"; $lang['instdb'] = "Install database"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Define here, after which time a user should get automatically a predefined servergroup.

time (seconds) => servergroup ID => permanent flag

Max. value is 999.999.999 seconds (over 31 years).

The entered seconds will be rated as 'online time' or 'active time', depending on the setting of the 'time mode' you have chosen.

Each entry has to separate from next with a comma.

The time must be entered cumulative

Example:
60=>9=>0,120=>10=>0,180=>11=>0
On this example a user receives servergroup 9 after 60 seconds, servergroup 10 after another 60 seconds, servergroup 11 after another 60 seconds."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "List Rankup (Admin-Mode)"; $lang['wihladm0'] = "Description of function (click)"; $lang['wihladm0desc'] = "Choose one or more reset options and press \"start reset\" to start it.
Each option is described by itself.

After starting the reset job(s), you can view the status on this site.

The reset task will be done about the Ranksystem Bot as a job.
It is necessary the Ranksystem Bot is running.
Do NOT stop or restart the Bot during the reset is in progress!

For the time of running the reset, the Ranksystem will pause all other things. After completing the reset the Bot will automatically go on with the normal work.
Again, do NOT stop or restart the Bot!

When all jobs are done, you need to confirm them. This will reset the status of the jobs. That makes it possible to start a new reset.

In case of a reset you might also want to withdraw servergroups from the users. It is important not to change the 'rank up definition', before you have done this reset. After reset you can change the 'rank up definition', sure!
The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


Be aware, there is no way of return!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "created"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Estimated time to reset the system"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Are you sure, you still want to reset the system?"; $lang['wihladmrs13'] = "Yes, start reset"; $lang['wihladmrs14'] = "No, cancel reset"; @@ -469,8 +493,8 @@ $lang['wihladmrs5'] = "Reset Job(s) successfully created."; $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; -$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the reset is in progress!"; -$lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; +$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the job is in progress!"; +$lang['wihladmrs9'] = "Please %s confirm %s the job(s). This will reset the job status of all jobs. It is needed to be able to start a new one."; $lang['wihlset'] = "settings"; $lang['wiignidle'] = "Ignore idle"; $lang['wiignidledesc'] = "Define a period, up to which the idle time of a user will be ignored.

If a client does nothing on the server (=idle), this time can be determined by the Ranksystem. With this function the idle time of a user up to the defined limit is not evaluated as idle time, rather it counts as active time. Only when the defined limit is exceeded, it counts from that point on for the Ranksystem as idle time.

This function does matter only in conjunction with the mode 'active time'.

Meaning the function is e.g. to evaluate the time of listening in conversations as an activity.

0 Sec. = disables this function

Example:
Ignore idle = 600 (seconds)
A client has an idle of 8 minuntes.
└ 8 minutes idle will be ignored and the user therefore receives this time as active time. If the idle time now increased to 12 minutes, the time is over 10 minutes and in this case 2 minutes would be counted as idle time, the first 10 minutes still as active time."; @@ -503,6 +527,7 @@ $lang['winav11'] = "Please define a Bot-Admin, which should be the administrator of the Ranksystem (TeamSpeak -> Bot-Admin). This is very important in case you lost your login credentials for the webinterface."; $lang['winav12'] = "Add-ons"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Database"; $lang['winav3'] = "Core"; $lang['winav4'] = "Other"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Following things are required to reset the password:"; $lang['wiselcld'] = "select clients"; $lang['wiselclddesc'] = "Select the clients by their last known username, unique Client-ID or Client-database-ID.
Multiple selections are also possible."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "active time"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; @@ -580,7 +607,7 @@ $lang['wits3encrypt'] = "TS3 Query encryption"; $lang['wits3encryptdesc'] = "Activate this option to encrypt the communication between the Ranksystem and the TeamSpeak 3 server (SSH).
When this function is disabled, the communication will be done in plain text (RAW). This could be a security risk, especially when the TS3 server and the Ranksystem are running on different machines.

Be also sure, you have checked the TS3 Query Port, which needs (perhaps) to be changed in the Ranksystem!

Attention: The SSH encryption needs more CPU time and with this truly more system resources. That's why we recommend to use a RAW connection (disabled encryption) if the TS3 server and the Ranksystem are running on the same host / server (localhost / 127.0.0.1). If they are running on separate hosts, you should activate the encrypted connection!

Requirements:

1) TS3 Server version 3.3.0 or above.

2) The PHP extension PHP-SSH2 is necessary.
On Linux you can it install with the following command:
%s
3) The encryption needs to be enabled on your TS3 server!
Activate the following parameters inside your 'ts3server.ini' and customize it for your needs:
%s After changing your TS3 server configurations a restart of your TS3 server is necessary."; $lang['wits3host'] = "TS3 Hostaddress"; -$lang['wits3hostdesc'] = "TeamSpeak 3 Server address
(IP oder DNS)"; +$lang['wits3hostdesc'] = "TeamSpeak 3 Server address (IP oder DNS)

Should be the (IP) address of the host system of the TS Server.

When the Ranksystem and the TS Server are running on the same host machine, we recommend to use '127.0.0.1' or 'localhost'."; $lang['wits3qnm'] = "Bot name"; $lang['wits3qnmdesc'] = "The name, with this the query-connection will be established.
You can name it free."; $lang['wits3querpw'] = "TS3 Query-Password"; diff --git "a/languages/core_es_espa\303\261ol_es.php" "b/languages/core_es_espa\303\261ol_es.php" index 9036ad5..ea4c905 100644 --- "a/languages/core_es_espa\303\261ol_es.php" +++ "b/languages/core_es_espa\303\261ol_es.php" @@ -51,6 +51,7 @@ $lang['factor'] = "Factor"; $lang['highest'] = "rango más alto alcanzado"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "in Seconds"; $lang['install'] = "Instalación"; $lang['instdb'] = "Instalar base de datos"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Defina aquí después de qué momento un usuario debe obtener automáticamente un grupo de servidores predefinido.

tiempo (segundos) => grupo de servidores ID => permanent flag

Max. valor son 999.999.999 segundos (más de 31 años)

Importante para esto es el 'tiempo en línea' o el 'tiempo activo' de un usuario, dependiendo de la configuración del modo.

Cada entrada tiene que separarse de la siguiente con una coma.

El tiempo debe ser ingresado acumulativo

Ejemplo:
60=>9=>0,120=>10=>0,180=>11=>0
En esto, un usuario obtiene después de 60 segundos el grupo de servidores 9, a su vez después de 60 segundos el grupo de servidores 10, y así sucesivamente ..."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Lista rangos (modo de administrador)"; $lang['wihladm0'] = "Function description (click)"; $lang['wihladm0desc'] = "Choose one or more reset options and press \"start reset\" to start it.
Each option is described by itself.

After starting the reset job(s), you can view the status on this site.

The reset task will be done about the Ranksystem Bot as a job.
It is necessary the Ranksystem Bot is running.
Do NOT stop or restart the Bot during the reset is in progress!

For the time of running the reset, the Ranksystem will pause all other things. After completing the reset the Bot will automatically go on with the normal work.
Again, do NOT stop or restart the Bot!

When all jobs are done, you need to confirm them. This will reset the status of the jobs. That makes it possible to start a new reset.

In case of a reset you might also want to withdraw servergroups from the users. It is important not to change the 'rank up definition', before you have done this reset. After reset you can change the 'rank up definition', sure!
The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


Be aware, there is no way of return!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "created"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Estimated time to reset the system"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Are you sure, you still want to reset the system?"; $lang['wihladmrs13'] = "Yes, start reset"; $lang['wihladmrs14'] = "No, cancel reset"; @@ -469,8 +493,8 @@ $lang['wihladmrs5'] = "Reset Job(s) successfully created."; $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; -$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the reset is in progress!"; -$lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; +$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the job is in progress!"; +$lang['wihladmrs9'] = "Please %s confirm %s the job(s). This will reset the job status of all jobs. It is needed to be able to start a new one."; $lang['wihlset'] = "Configuración"; $lang['wiignidle'] = "Ignorar idle"; $lang['wiignidledesc'] = "Defina un período, hasta el cual se ignorará el tiempo de inactividad de un usuario.

Cuando un cliente no hace nada en el servidor (=inactivo), esta vez lo notará Ranksystem. Con esta característica, el tiempo de inactividad de un usuario no se contará hasta el límite definido. Solo cuando se excede el límite definido, cuenta desde ese punto para el sistema de rangos como tiempo de inactividad.

Esta función solo importa junto con el modo 'tiempo activo'.

Lo que significa que la función es, p. evaluar el tiempo de escucha en conversaciones como actividad.

0 Segundos. = desactivar esta función

Ejemplo:
Ignorar inactivo = 600 (segundos)
Un cliente tiene una inactividad de 8 minutos.
└ Se ignoran 8 minutos inactivos y, por lo tanto, recibe esta vez como tiempo activo. Si el tiempo de inactividad ahora aumentó a 12 minutos, el tiempo es más de 10 minutos y en este caso 2 minutos se contarán como tiempo de inactividad, los primeros 10 minutos como tiempo de actividad."; @@ -503,6 +527,7 @@ $lang['winav11'] = "Ingrese el ID de cliente único del administrador del Ranksystem (TeamSpeak -> Bot-Admin). Esto es muy importante en caso de que haya perdido sus datos de inicio de sesión para la webinterface (para restablecerlos)."; $lang['winav12'] = "Complementos"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Base de datos"; $lang['winav3'] = "Núcleo"; $lang['winav4'] = "Otro"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Se requieren las siguientes cosas para restablecer la contraseña:"; $lang['wiselcld'] = "seleccionar clientes"; $lang['wiselclddesc'] = "Seleccione los clientes por su último nombre de usuario conocido, ID de cliente unica o ID de cliente en base de datos.
Múltiples selecciones también son posibles."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "tiempo activo"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git "a/languages/core_fr_fran\303\247ais_fr.php" "b/languages/core_fr_fran\303\247ais_fr.php" index 5a98d22..81aa8af 100644 --- "a/languages/core_fr_fran\303\247ais_fr.php" +++ "b/languages/core_fr_fran\303\247ais_fr.php" @@ -51,6 +51,7 @@ $lang['factor'] = "Factor"; $lang['highest'] = "plus haut rang atteint"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "in Seconds"; $lang['install'] = "Installation"; $lang['instdb'] = "Installer la base de données"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Définissez ici après quoi un utilisateur doit automatiquement obtenir un groupe de serveurs prédéfini.

temps (secondes) => ID du groupe de serveur => permanent flag

Max. value is 999.999.999 seconds (over 31 years)

Important pour cela est le 'online time' ou le 'active time' d'un utilisateur, en fonction du réglage du mode.

Chaque entrée doit se séparer de la suivante avec une virgule.

L'heure doit être saisie cumulative

Exemple:
60=>9=>0,120=>10=>0,180=>11=>0
Sur ce un utilisateur obtient après 60 secondes le groupe de serveurs 9, à son tour après 60 secondes le groupe de serveurs 10, et ainsi de suite ..."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Liste de classement (Mode-Admin)"; $lang['wihladm0'] = "Function description (click)"; $lang['wihladm0desc'] = "Choose one or more reset options and press \"start reset\" to start it.
Each option is described by itself.

After starting the reset job(s), you can view the status on this site.

The reset task will be done about the Ranksystem Bot as a job.
It is necessary the Ranksystem Bot is running.
Do NOT stop or restart the Bot during the reset is in progress!

For the time of running the reset, the Ranksystem will pause all other things. After completing the reset the Bot will automatically go on with the normal work.
Again, do NOT stop or restart the Bot!

When all jobs are done, you need to confirm them. This will reset the status of the jobs. That makes it possible to start a new reset.

In case of a reset you might also want to withdraw servergroups from the users. It is important not to change the 'rank up definition', before you have done this reset. After reset you can change the 'rank up definition', sure!
The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


Be aware, there is no way of return!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "created"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Estimated time to reset the system"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Are you sure, you still want to reset the system?"; $lang['wihladmrs13'] = "Yes, start reset"; $lang['wihladmrs14'] = "No, cancel reset"; @@ -469,8 +493,8 @@ $lang['wihladmrs5'] = "Reset Job(s) successfully created."; $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; -$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the reset is in progress!"; -$lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; +$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the job is in progress!"; +$lang['wihladmrs9'] = "Please %s confirm %s the job(s). This will reset the job status of all jobs. It is needed to be able to start a new one."; $lang['wihlset'] = "paramètres"; $lang['wiignidle'] = "Ignorer le mode inactif"; $lang['wiignidledesc'] = "Définissez une période, jusqu'à laquelle le temps d'inactivité d'un utilisateur sera ignoré.

Lorsqu'un client ne fait rien sur le serveur (= inactif), ce temps est noté par le Ranksystem. Avec cette fonction, le temps d'inactivité d'un utilisateur ne sera compté que lorsque la limite définie. Seulement quand la limite définie est dépassée, le Ranksystem compte le temps d'inactivité

Cette fonction joue seulement en conjonction avec le mode 'active time' un rôle.

Ce qui signifie que la fonction est, par exemple, pour évaluer le temps d'écoute dans les conversations, cela est définie comme une activitée.

0 = désactiver la fonction

Exemple:
Ignorer le mode inactif = 600 (secondes)
Un client a un ralenti de 8 minutes
Conséquence:
8 minutes de ralenti sont ignorés et il reçoit donc cette fois comme temps actif. Si le temps d'inactivité augmente maintenant à plus de 12 minutes, le temps dépasse 10 minutes et, dans ce cas, 2 minutes seront comptées comme temps d'inactivité."; @@ -503,6 +527,7 @@ $lang['winav11'] = "Veuillez saisir l'identifiant client unique de l'administrateur du Ranksystem (TeamSpeak -> Bot-Admin). Ceci est très important dans le cas où vous avez perdu vos informations de connexion pour l'interface Web (pour les réinitialiser)."; $lang['winav12'] = "Addons"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Base de données"; $lang['winav3'] = "Coeur"; $lang['winav4'] = "Autres"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Les éléments suivants sont nécessaires pour réinitialiser le mot de passe:"; $lang['wiselcld'] = "Sélectionner des clients"; $lang['wiselclddesc'] = "Sélectionnez les clients par leur dernier nom d'utilisateur connu, leur identifiant unique ou leur ID dans la base de données.
Des sélections multiples sont également possibles."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "Temps actif"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git a/languages/core_hu_Hungary_hu.php b/languages/core_hu_Hungary_hu.php index d5022f8..45eeea7 100644 --- a/languages/core_hu_Hungary_hu.php +++ b/languages/core_hu_Hungary_hu.php @@ -5,7 +5,7 @@ $lang['api'] = "API"; $lang['apikey'] = "API Kulcs"; $lang['asc'] = "emelkedő"; -$lang['autooff'] = "autostart is deactivated"; +$lang['autooff'] = "Automatikus indítás kikapcsolva"; $lang['botoff'] = "A bot jelenleg nem fut."; $lang['boton'] = "A bot jelenleg fut..."; $lang['brute'] = "A webinterface felületen sok helytelen bejelentkezést észleltek. Blokkolt bejelentkezés 300 másodpercre! Utolsó hozzáférés erről az IP-ről %s."; @@ -51,6 +51,7 @@ $lang['factor'] = "Tényező"; $lang['highest'] = "Elérte a legnagyobb rangot"; $lang['imprint'] = "Impresszum"; +$lang['input'] = "Input Value"; $lang['insec'] = "Másodpercben"; $lang['install'] = "Telepítés"; $lang['instdb'] = "Telepítse az adatbázist"; @@ -98,7 +99,7 @@ $lang['listuid'] = "Unique ID"; $lang['listver'] = "Kliens verzió"; $lang['login'] = "Belépés"; -$lang['module_disabled'] = "This module is deactivated."; +$lang['module_disabled'] = "Ez a modul inaktív."; $lang['msg0001'] = "A RankSystem ezen a verzión fut: %s"; $lang['msg0002'] = "Az érvényes botparancsok listája itt található [URL]https://ts-ranksystem.com/#commands[/URL]"; $lang['msg0003'] = "Ön nem jogosult erre a parancsra!"; @@ -112,12 +113,12 @@ $lang['msg0011'] = "Tisztított a csoportok gyorsítótára. Csoportok és ikonok betöltésének indítása..."; $lang['noentry'] = "Nincs bejegyzés.."; $lang['pass'] = "Jelszó"; -$lang['pass2'] = "jelszóváltoztatás"; -$lang['pass3'] = "régi jelszó"; -$lang['pass4'] = "új jelszó"; +$lang['pass2'] = "Jelszóváltoztatás"; +$lang['pass3'] = "Régi jelszó"; +$lang['pass4'] = "Új jelszó"; $lang['pass5'] = "Elfelejtett jelszó?"; $lang['privacy'] = "Adatvédelmi irányelvek"; -$lang['repeat'] = "ismét"; +$lang['repeat'] = "Ismét"; $lang['resettime'] = "Nullázza a felhasználó online és tétlen idejét %s (unique Client-ID: %s; Client-database-ID %s) nullára, oka, hogy a felhasználót eltávolították egy kivételből (szervercsoport vagy kliens kivétel)."; $lang['sccupcount'] = "%s másodperc az (%s) unique Client-ID-hez hozzá lesz adva egy pillanat alatt (nézd meg a Ranksystem naplót)."; $lang['sccupcount2'] = "%s másodperc aktív idő hozzáadva az unique Client-ID-hez (%s); admin funkció kérésére."; @@ -384,7 +385,7 @@ $lang['wiadmuuiddesc'] = "Válassza ki a felhasználót, aki a Ranksystem rendszergazdaja.
Többféle választás is lehetséges.

Az itt felsorolt ​​felhasználók a TeamSpeak szerver felhasználói. Legyen biztos, hogy online van. Ha offline állapotban van, lépjen online, indítsa újra a Ranksystem Bot szoftvert, és töltse be újra ezt a webhelyet.


A Ranksystem rendszergazdája a következő jogosultságokkal rendelkezik:

- a webinterfész jelszavának visszaállítása.
(Megjegyzés: A rendszergazda meghatározása nélkül nem lehet visszaállítani a jelszót!)

- Bot parancsok használata a Bot-Admin privilégiumokkal
(%sitt%s található a parancsok listája.)"; $lang['wiapidesc'] = "Az API-val lehet adatokat (amelyeket a Ranksytem gyűjtött) harmadik féltől származó alkalmazásokba továbbítani.

Az információk fogadásához API-kulccsal kell hitelesítenie magát. Ezeket a kulcsokat itt kezelheti.

Az API elérhető itt:
%s

Az API JSON karakterláncként generálja a kimenetet. Mivel az API-t önmagában dokumentálja, csak ki kell nyitnia a fenti linket és követnie kell az utasításokat."; $lang['wiboost'] = "Boost"; -$lang['wiboost2desc'] = "Definiálhat csoportokat, például a felhasználók jutalmazására. Ezzel gyorsabban gyűjtik az időt (növelik), és így gyorsabban jutnak a következő rangsorba.

Lépések:

1) Hozzon létre egy szervercsoportot a kiszolgálón, amelyet fel kell használni a növeléshez.

2) Adja meg a lendület meghatározását ezen a webhelyen.

Servergroups: Válassza ki azt a szervercsoportot, amely indítja el a lendületet.

Boost Factor: Az a tényező, amely növeli annak a felhasználónak az online / aktív idejét, aki a csoportot birtokolta (példa kétszer). Faktorként decimális szám is lehetséges (1.5. Példa). A tizedes helyeket ponttal kell elválasztani!

Duration in Seconds: Határozza meg, mennyi ideig legyen aktív a feltöltés. Az idő lejártakor, az emlékeztető szervercsoport automatikusan eltávolításra kerül az érintett felhasználótól. Az idő akkor fut, amikor a felhasználó megkapja a szervercsoportot. Nem számít, hogy a felhasználó online vagy nem, az időtartam fogy.

3) Adjon egy vagy több felhasználót a TS-kiszolgálón a meghatározott szervercsoporthoz, hogy növeljék őket."; +$lang['wiboost2desc'] = "Definiálhat csoportokat, például a felhasználók jutalmazására. Ezzel gyorsabban gyűjtik az időt (növelik), és így gyorsabban jutnak a következő rangsorba.

Lépések:

1) Hozzon létre egy szervercsoportot a kiszolgálón, amelyet fel kell használni a növeléshez.

2) Adja meg a lendület meghatározását ezen a webhelyen.

Szervercsoport: Válassza ki azt a szervercsoportot, amely indítja el a lendületet.

Boost Tényező: Az a tényező, amely növeli annak a felhasználónak az online / aktív idejét, aki a csoportot birtokolta (példa kétszer). Faktorként decimális szám is lehetséges (1.5. Példa). A tizedes helyeket ponttal kell elválasztani!

Tartam Másodpercben: Határozza meg, mennyi ideig legyen aktív a feltöltés. Az idő lejártakor, az emlékeztető szervercsoport automatikusan eltávolításra kerül az érintett felhasználótól. Az idő akkor fut, amikor a felhasználó megkapja a szervercsoportot. Nem számít, hogy a felhasználó online vagy nem, az időtartam fogy.

3) Adjon egy vagy több felhasználót a TS-kiszolgálón a meghatározott szervercsoporthoz, hogy növeljék őket."; $lang['wiboostdesc'] = "Adjon egy felhasználónak a TeamSpeak szerverén szervercsoportot (manuálisan kell létrehozni), amelyet itt növelő csoportnak lehet nyilvánítani. Adjon meg egy tényezőt is, amelyet használni kell (például kétszer), és egy időt, ameddig a lendületet értékelni kell.
Minél magasabb a tényező, annál gyorsabban eléri a felhasználó a következő magasabb rangot.
Az idő lejártakor, az emlékeztető szervercsoport automatikusan eltávolításra kerül az érintett felhasználótól. Az idő akkor fut, amikor a felhasználó megkapja a szervercsoportot.

Faktorként decimális szám is lehetséges. A tizedes helyeket ponttal kell elválasztani!

szervercsoport ID => tényező => idő (másodpercben)

Minden bejegyzést vesszővel kell elválasztani a következőtől.

Example:
12=>2=>6000,13=>1.25=>2500,14=>5=>600
Itt a 12 szervercsoport felhasználója megkapja a 2-es tényezőt a következő 6000 másodpercre, a 13-as kiszolgálócsoportban lévő felhasználó 1,25-es tényezőt kap 2500 másodpercre, és így tovább..."; $lang['wiboostempty'] = "Nincs bejegyzés. Kattintson a plusz szimbólumra annak meghatározásához!"; $lang['wibot1'] = "A Ranksystem bot leállt. Nézd meg a logot a további információkért!"; @@ -427,13 +428,27 @@ $lang['wiexuiddesc'] = "Vesszővel elválasztott egyedi ügyfél-azonosítók listája, amelyet a Ranksystem vesz figyelembe.
A listában szereplő felhasználót a rangsorolás során figyelmen kívül hagyják."; $lang['wigrpimp'] = "Importálási Mód"; $lang['wigrpt1'] = "Az idő másodpercekben"; -$lang['wigrpt2'] = "Servergroup"; -$lang['wigrpt3'] = "Permanent Group"; +$lang['wigrpt2'] = "Szervercsoport"; +$lang['wigrpt3'] = "Állandó Csoport"; $lang['wigrptime'] = "Rang meghatározás"; $lang['wigrptime2desc'] = "Adja meg azt az időtartamot, amely után a felhasználó automatikusan megkap egy előre meghatározott szervercsoportot.

time in seconds => servergroup ID => permanent flag

Max. érték 999 999 999 másodperc (31 év felett).

A megadott másodperceket „online idő” vagy „aktív idő” besorolásúnak tekintjük, a választott „idő mód” beállításától függően.


A másodpercben megadott időt kumulatív módon kell megadni!

helytelen:

100 másodperc, 100 másodperc, 50 másodperc
helyes:

100 másodperc, 200 másodperc, 250 másodperc
"; -$lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; +$lang['wigrptime3desc'] = "

Állandó Csoport
Ez lehetővé teszi egy szervercsoport megjelölését, amely nem lesz eltávolítva a következő rangemelésnél. A rangsor, amelyet ezzel határozunk meg (= 'ON'), az állandó marad a rangrendszer által.
Alapértelmezés szerint (= 'OFF'). Az aktuális szervercsoport eltávolításra kerül, ha a felhasználó magasabb rangot ér el."; $lang['wigrptimedesc'] = "Itt határozza meg, mely idő elteltével a felhasználónak automatikusan meg kell kapnia egy előre meghatározott szervercsoportot.

time (seconds) => servergroup ID => permanent flag

Max. érték 999 999 999 másodperc (31 év felett).

A megadott másodperceket „online idő” vagy „aktív idő” besorolásúnak tekintjük, a választott „idő mód” beállításától függően.

Minden bejegyzést vesszővel kell elválasztani a következőtől.

Az időt kumulatív módon kell megadni

Példa:
60=>9=>0,120=>10=>0,180=>11=>0
Ebben a példában a felhasználó 60 másodperc után megkapja a 9. szervercsoportot, további 60 másodperc után a 10. szervercsoportot, a 11. szervercsoport további 60 másodperc után."; $lang['wigrptk'] = "halmozott"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Ranglista (Admin-Mód)"; $lang['wihladm0'] = "Funkció leírása (kattints ide)"; $lang['wihladm0desc'] = "Válasszon egy vagy több alaphelyzetbe állítási lehetőséget, majd az indításhoz nyomja meg a \"visszaállítás indítása\" gombot.
Mindegyik lehetőséget önmagában írja le.

A visszaállítási feladat (ok) elindítása után megtekintheti az állapotot ezen a webhelyen.

Az alaphelyzetbe állítási feladat, mint munka elvégzésére kerül.
Szükség van a Ranksystem Bot futtatására.
NE állítsa le vagy indítsa újra a Botot, amikor a visszaállítás folyamatban van!

A visszaállítás futtatásának idején a Ranksystemben szünetel minden más dolgot. A visszaállítás befejezése után a Bot automatikusan folytatja a szokásos munkát.
Ismét NE állítsa le vagy indítsa újra a Botot!

Az összes munka elvégzése után meg kell erősítenie azokat. Ez visszaállítja a feladatok állapotát. Ez lehetővé teszi egy új visszaállítás indítását.

Visszaállítás esetén érdemes lehet a szervercsoportokat elvenni a felhasználóktól. Fontos, hogy ne változtassa meg a 'rangsor meghatározását', még mielőtt elvégezte ezt az alaphelyzetbe állítást. Az alaphelyzetbe állítás után megváltoztathatja a 'rangsor meghatározását', ez biztos!
A szervercsoportok elvétele eltarthat egy ideig. Az aktív 'Query-Slowmode' tovább növeli a szükséges időtartamot. Ajánljuk kikapcsolni a 'Query-Slowmode'-ot!!


Légy tudatában, hogy nincs lehetőség az adatok visszaállítására!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "visszaállítás indítása"; $lang['wihladm36'] = "Állítsa le a Botot a visszaállítás után"; $lang['wihladm36desc'] = "Ha ezt az opciót aktiválta, a Bot leáll, miután az összes visszaállítási művelet megtörtént.

Ez a leállítás pontosan úgy működik, mint a normál 'leállítás' paraméter. Ez azt jelenti, hogy a Bot nem nem indul el az 'ellenőrző' paraméterrel.

A Ranksystem Bot elindításához használja az 'indítás' vagy 'újraindítás' funkciót."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Munkafolyamat státusz"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "elkészült"; $lang['wihladmrs10'] = "Munkafolyamat(ok) sikeresen megerősítve!"; -$lang['wihladmrs11'] = "A rendszer visszaállításának becsült ideje"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Biztos benne, hogy továbbra is vissza szeretné állítani a rendszert?"; $lang['wihladmrs13'] = "Igen, indítsa el az alaphelyzetbe állítást"; $lang['wihladmrs14'] = "Nem, törölje a visszaállítást"; @@ -503,6 +527,7 @@ $lang['winav11'] = "Kérjük, definiáljon egy Bot-Rendszergazdát, aki a Ranksystem adminisztrátora legyen (TeamSpeak -> Bot-Admin). Ez nagyon fontos abban az esetben, ha elvesztette a webes felület bejelentkezési adatait."; $lang['winav12'] = "Kiegészítők"; $lang['winav13'] = "Általános (Stat.)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Adatbázis"; $lang['winav3'] = "Alapvető paraméterek"; $lang['winav4'] = "Egyéb"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "A jelszó visszaállításához a következőkre van szükség:"; $lang['wiselcld'] = "Kliens kiválasztása"; $lang['wiselclddesc'] = "Válassza ki az ügyfeleket az utoljára ismert felhasználónév, egyedi ügyfél-azonosító vagy ügyfél-adatbázis-azonosító alapján.
Több választás is lehetséges."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Oszlop megjelenítése/elrejtése"; $lang['wishcolat'] = "aktív idő"; $lang['wishcoldesc'] = "Kapcsolja be ezt az oszlopot 'be' vagy 'ki', hogy megjelenítse vagy elrejtse a statisztikai oldalon.

Ez lehetővé teszi a List Rankup (stats/list_rankup.php) egyéni konfigurálását."; @@ -567,7 +594,7 @@ $lang['wisttidesc'] = "Adja meg az eléréshez szükséges időt (órákban)."; $lang['wisupidle'] = "Idő mód"; $lang['wisupidledesc'] = "Kétféle mód van, hogyan lehet a felhasználó idejét értékelni.

1) online idő: A szervercsoportokat online idő adja meg. Ebben az esetben az aktív és inaktív időt értékezzük.
(lásd az „összes online idő” oszlopot a „stats / list_rankup.php” részben)

2) aktív idő: A szervercsoportokat aktív idő adja meg. Ebben az esetben az inaktív idő nem lesz besorolva. Az online időt az inaktív idő (= alapjárat) csökkenti és csökkenti az aktív idő felépítéséhez.
(lásd az „összes aktív idő” oszlopot a „stats / list_rankup.php” részben)


Az „időmód” megváltoztatása, a hosszabb futású Ranksystem példányoknál is nem jelent problémát, mivel a Ranksystem helytelen szervercsoportokat javít az ügyfélen."; -$lang['wisvconf'] = "mentés"; +$lang['wisvconf'] = "Mentés"; $lang['wisvinfo1'] = "Figyelem!! A felhasználó IP-címének kivágásának módjának megváltoztatásával szükséges, hogy a felhasználó újonnan csatlakozzon a TS3 szerverhez, különben a felhasználó nem szinkronizálható a statisztika oldallal."; $lang['wisvres'] = "A változások hatályba lépése előtt újra kell indítania a Ranksystem rendszert! %s"; $lang['wisvsuc'] = "A változások sikeresen mentve!"; diff --git a/languages/core_it_Italiano_it.php b/languages/core_it_Italiano_it.php index f094af2..2c9a508 100644 --- a/languages/core_it_Italiano_it.php +++ b/languages/core_it_Italiano_it.php @@ -51,6 +51,7 @@ $lang['factor'] = "Factor"; $lang['highest'] = "È stato raggiunto il rank massimo"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "in Seconds"; $lang['install'] = "Installazione"; $lang['instdb'] = "Installa il database:"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Definisci qui dopo quanto tempo un utente debba ottenere automaticamente un servergroup predefinito.

tempo (IN SECONDI) => servergroup ID => permanent flag

Max. value is 999.999.999 seconds (over 31 years)

Sono importanti per questa impostazione il 'Tempo online' o il 'Tempo di attività' di un utente, dipende da come impostata la modalità.

Ogni voce deve essere separate dalla successive con una virgola. br>
Dovrà essere inserito il tempo cumulativo

Esempio:
60=>9=>0,120=>10=>0,180=>11=>0
Su queste basi un utente ottiene il servergroup 9 dopo 60 secondi, a sua volta il 10 dopo altri 60 secondi e così via..."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Lista Utenti (Modalità Admin)"; $lang['wihladm0'] = "Function description (click)"; $lang['wihladm0desc'] = "Choose one or more reset options and press \"start reset\" to start it.
Each option is described by itself.

After starting the reset job(s), you can view the status on this site.

The reset task will be done about the Ranksystem Bot as a job.
It is necessary the Ranksystem Bot is running.
Do NOT stop or restart the Bot during the reset is in progress!

For the time of running the reset, the Ranksystem will pause all other things. After completing the reset the Bot will automatically go on with the normal work.
Again, do NOT stop or restart the Bot!

When all jobs are done, you need to confirm them. This will reset the status of the jobs. That makes it possible to start a new reset.

In case of a reset you might also want to withdraw servergroups from the users. It is important not to change the 'rank up definition', before you have done this reset. After reset you can change the 'rank up definition', sure!
The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


Be aware, there is no way of return!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "created"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Estimated time to reset the system"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Are you sure, you still want to reset the system?"; $lang['wihladmrs13'] = "Yes, start reset"; $lang['wihladmrs14'] = "No, cancel reset"; @@ -469,8 +493,8 @@ $lang['wihladmrs5'] = "Reset Job(s) successfully created."; $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; -$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the reset is in progress!"; -$lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; +$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the job is in progress!"; +$lang['wihladmrs9'] = "Please %s confirm %s the job(s). This will reset the job status of all jobs. It is needed to be able to start a new one."; $lang['wihlset'] = "impostazioni"; $lang['wiignidle'] = "Ignora Idle"; $lang['wiignidledesc'] = "Definisci un periodo di tempo, fino a che il tempo di inattività di un utente verrà ignorato.

Quando un cliente non fa nulla sul server (=idle), questo tempo viene conteggiato dal Ranksystem. Grazie a questa funzione il tempo di inattività di un utente non sarà conteggiato fino al limite definito. Solo quando il limite definito viene superato, conta da tale data per il Ranksystem come il tempo di inattività.

Questà funzione è compatibile solo con il tempo di attività.

Significato La funzione è ad esempio per valutare il tempo di ascolto in conversazioni come l'attività.

0 = Disabilità la funzione

Esempio:
Ignore idle = 600 (seconds)
Un utente ha un idle di 8 minunti
Conseguenza:
8 minuti in IDLE verranno ignorati e poi il tempo successivo verrà conteggiato come tempo di attività. Se il tempo di inattività ora viene aumentato a oltre 12 minuti (quindi il tempo è più di 10 minuti) 2 minuti verrebbero conteggiati come tempo di inattività."; @@ -503,6 +527,7 @@ $lang['winav11'] = "Per favore digita lo unique Client-ID dell'admin per il Ranksystem (TeamSpeak -> Bot-Admin). Questo è molto importante nel caso perdessi le credenziali di accesso per la webinterface (per effettuarne un reset)."; $lang['winav12'] = "Addons"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Database"; $lang['winav3'] = "Core"; $lang['winav4'] = "Altri"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "I seguenti campi sono necessari per resettare la password:"; $lang['wiselcld'] = "Seleziona gli utenti"; $lang['wiselclddesc'] = "Seleziona gli utenti con il loro nickname, con l'ID Univoco o con il Client-database-ID.
È possibile selezionare più utenti."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "Tempo Attività"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git a/languages/core_nl_Nederlands_nl.php b/languages/core_nl_Nederlands_nl.php index c9f7230..694660e 100644 --- a/languages/core_nl_Nederlands_nl.php +++ b/languages/core_nl_Nederlands_nl.php @@ -51,6 +51,7 @@ $lang['factor'] = "Factor"; $lang['highest'] = "hoogste rank bereikt"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "in Seconds"; $lang['install'] = "Installatie"; $lang['instdb'] = "Installeer database"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Define here, after which time a user should get automatically a predefined servergroup.

time (seconds) => servergroup ID => permanent flag

Max. value is 999.999.999 seconds (over 31 years).

The entered seconds will be rated as 'online time' or 'active time', depending on the setting of the 'time mode' you have chosen.

Each entry has to separate from next with a comma.

The time must be entered cumulative

Example:
60=>9=>0,120=>10=>0,180=>11=>0
On this example a user receives servergroup 9 after 60 seconds, servergroup 10 after another 60 seconds, servergroup 11 after another 60 seconds."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "List Rankup (Admin-Mode)"; $lang['wihladm0'] = "Function description (click)"; $lang['wihladm0desc'] = "Choose one or more reset options and press \"start reset\" to start it.
Each option is described by itself.

After starting the reset job(s), you can view the status on this site.

The reset task will be done about the Ranksystem Bot as a job.
It is necessary the Ranksystem Bot is running.
Do NOT stop or restart the Bot during the reset is in progress!

For the time of running the reset, the Ranksystem will pause all other things. After completing the reset the Bot will automatically go on with the normal work.
Again, do NOT stop or restart the Bot!

When all jobs are done, you need to confirm them. This will reset the status of the jobs. That makes it possible to start a new reset.

In case of a reset you might also want to withdraw servergroups from the users. It is important not to change the 'rank up definition', before you have done this reset. After reset you can change the 'rank up definition', sure!
The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


Be aware, there is no way of return!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "created"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Estimated time to reset the system"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Are you sure, you still want to reset the system?"; $lang['wihladmrs13'] = "Yes, start reset"; $lang['wihladmrs14'] = "No, cancel reset"; @@ -469,8 +493,8 @@ $lang['wihladmrs5'] = "Reset Job(s) successfully created."; $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; -$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the reset is in progress!"; -$lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; +$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the job is in progress!"; +$lang['wihladmrs9'] = "Please %s confirm %s the job(s). This will reset the job status of all jobs. It is needed to be able to start a new one."; $lang['wihlset'] = "instellingen"; $lang['wiignidle'] = "Ignore idle"; $lang['wiignidledesc'] = "Define a period, up to which the idle time of a user will be ignored.

When a client does not do anything on the server (=idle), this time is noted by the Ranksystem. With this feature the idle time of an user will not be counted until the defined limit. Only when the defined limit is exceeded, it counts from that point for the Ranksystem as idle time.

This function matters only in conjunction with the mode 'active time'.

Meaning the function is e.g. to evaluate the time of listening in conversations as activity.

0 Sec. = disable this function

Example:
Ignore idle = 600 (seconds)
A client has an idle of 8 minuntes.
└ 8 minutes idle are ignored and he therefore receives this time as active time. If the idle time now increased to 12 minutes, the time is over 10 minutes and in this case 2 minutes would be counted as idle time, the first 10 minutes as active time."; @@ -503,6 +527,7 @@ $lang['winav11'] = "Please define a Bot-Admin, which should be the administrator of the Ranksystem (TeamSpeak -> Bot-Admin). This is very important in case you lost your login credentials for the webinterface."; $lang['winav12'] = "Addons"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Database"; $lang['winav3'] = "Core"; $lang['winav4'] = "Other"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Following things are required to reset the password:"; $lang['wiselcld'] = "select clients"; $lang['wiselclddesc'] = "Select the clients by their last known username, unique Client-ID or Client-database-ID.
Multiple selections are also possible."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "active time"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git a/languages/core_pl_polski_pl.php b/languages/core_pl_polski_pl.php index bbf7bc9..a6c557d 100644 --- a/languages/core_pl_polski_pl.php +++ b/languages/core_pl_polski_pl.php @@ -51,6 +51,7 @@ $lang['factor'] = "Factor"; $lang['highest'] = "osiągnieto najwyższą range"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "w sekundach"; $lang['install'] = "Instalacja"; $lang['instdb'] = "Zainstaluj bazę danych"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Okresl tutaj, po ktorym czasię uzytkownik powinien automatycznie uzyskac predefiniowaną grupe serwerow.

czas (sekundy) => identyfikator grupy serwerow => permanent flag

Max. value is 999.999.999 seconds (over 31 years)

Wazne w tym przypadku jest 'czas online' lub 'czas aktywnosci' użytkownika, w zaleznosci od ustawienia trybu.

Kazdy wpis musi oddzielac się od nastepnego za pomocą przecinka.

Czas musi byc wprowadzony łącznie

Przykład:
60=>9=>0,120=>10=>0,180=>11=>0
W tym przypadku uzytkownik dostaje po 60 sekundach grupe serwerow 9, po kolei po 60 sekundach grupa serwerow 10 itd."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Lista Rankup (tryb administratora)"; $lang['wihladm0'] = "Opis funkcji (kliknij)"; $lang['wihladm0desc'] = "Choose one or more reset options and press \"start reset\" to start it.
Each option is described by itself.

After starting the reset job(s), you can view the status on this site.

The reset task will be done about the Ranksystem Bot as a job.
It is necessary the Ranksystem Bot is running.
Do NOT stop or restart the Bot during the reset is in progress!

For the time of running the reset, the Ranksystem will pause all other things. After completing the reset the Bot will automatically go on with the normal work.
Again, do NOT stop or restart the Bot!

When all jobs are done, you need to confirm them. This will reset the status of the jobs. That makes it possible to start a new reset.

In case of a reset you might also want to withdraw servergroups from the users. It is important not to change the 'rank up definition', before you have done this reset. After reset you can change the 'rank up definition', sure!
The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


Be aware, there is no way of return!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "created"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Szacowany czas na zresetowanie systemu"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Are you sure, you still want to reset the system?"; $lang['wihladmrs13'] = "Yes, start reset"; $lang['wihladmrs14'] = "No, cancel reset"; @@ -470,7 +494,7 @@ $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; $lang['wihladmrs8'] = "NIE wyłączaj ani nie uruchamiaj ponownie bota podczas resetowania!"; -$lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; +$lang['wihladmrs9'] = "Please %s confirm %s the job(s). This will reset the job status of all jobs. It is needed to be able to start a new one."; $lang['wihlset'] = "Ustawienia"; $lang['wiignidle'] = "Ignoruj bezczynność"; $lang['wiignidledesc'] = "Okresl okres, do ktorego ignorowany bedzie czas bezczynnosci użytkownika.

Gdy klient nie robi niczego na serwerze (= bezczynnosc), ten czas jest zapisywany przez system rangowy. Dzieki tej funkcji czas bezczynnosci użytkownika nie zostanie policzony do okreslonego limitu. Dopiero gdy okreslony limit zostanie przekroczony, liczy się od tej daty dla Systemu Rankow jako czas bezczynnosci.

Ta funkcja odgrywa role tylko w połączeniu z trybem 'aktywny czas'.

Znaczenie funkcji to np. ocenic czas słuchania w rozmowach jako aktywnosc.

0 = wyłącz te funkcje

Przykład:
Ignoruj bezczynnosc = 600 (sekundy)
Klient ma czas bezczynnosci wynoszący 8 minut
consequence:
8 minut bezczynnosci są ignorowane i dlatego otrzymuje ten czas jako czas aktywny. Jesli czas bezczynnosci zwiekszył się teraz do ponad 12 minut, wiec czas wynosi ponad 10 minut, w tym przypadku 2 minuty bedą liczone jako czas bezczynnosci."; @@ -503,6 +527,7 @@ $lang['winav11'] = "Wprowadź unikalny identyfikator klienta administratora systemu Ranksystem (TeamSpeak -> Bot-Admin). Jest to bardzo wazne w przypadku, gdy straciłes dane logowania do interfejsu WWW (aby je zresetowac)."; $lang['winav12'] = "Dodatki"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Baza danych"; $lang['winav3'] = "Rdzeń"; $lang['winav4'] = "Inny"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Nastepujące rzeczy są wymagane, aby zresetowac hasło:"; $lang['wiselcld'] = "Wybierz klientów"; $lang['wiselclddesc'] = "Wybierz klientów według ich ostatniej znanej nazwy użytkownika, unikalnego identyfikatora klienta lub identyfikatora bazy danych klienta.
Mozliwe są rowniez wielokrotne selekcje.

W wiekszych bazach danych wybor ten moze znacznie spowolnic. Zaleca się skopiowanie i wklejenie pełnego pseudonimu zamiast wpisywania go."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "Czas aktywny"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git "a/languages/core_pt_Portugu\303\252s_pt.php" "b/languages/core_pt_Portugu\303\252s_pt.php" index df84bca..86fdf90 100644 --- "a/languages/core_pt_Portugu\303\252s_pt.php" +++ "b/languages/core_pt_Portugu\303\252s_pt.php" @@ -51,6 +51,7 @@ $lang['factor'] = "Fator"; $lang['highest'] = "maior classificação alcançada"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "em Segundos"; $lang['install'] = "Instalação"; $lang['instdb'] = "Instalar o banco de dados"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Defina aqui, após quanto tempo um usuário deve obter automaticamente um grupo de servidores predefinido.

Tempo (em segundos) => ID do grupo do servidor => permanent flag

Max. valor é 999.999.999 segundos (mais de 31 anos)

Importante para este é o 'tempo online' ou o 'tempo ativo' de um usuário, dependendo da configuração do modo.

Cada entrada deve se separar do próximo com uma vírgula.

O tempo deve ser inserido cumulativo

Exemplo:
60=>9=>0,120=>10=>0,180=>11=>0
Neste usuário, pegue após 60 segundos o grupo de servidores 9, por sua vez, após 60 segundos, o grupo de servidores 10 e assim por diante ..."; $lang['wigrptk'] = "comulativo"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Classificação (Modo Admin)"; $lang['wihladm0'] = "Function description (Clique)"; $lang['wihladm0desc'] = "Escolha uma ou mais opções de redefinição e pressione \"iniciar redefinição\" para iniciá-lo.
Cada opção é descrita por si só.

Depois de iniciar o trabalho de redefinição, você pode ver o status neste site.

A tarefa de redefinição será realizada sobre o sistema de ranking como um trabalho.
É necessário que o Ranksystem Bot esteja funcionando.
NÃO pare ou reinicie o bot durante a reinicialização!

Durante o tempo de execução da redefinição, o sistema Ranks fará uma pausa em todas as outras coisas. Depois de concluir a redefinição, o Bot continuará automaticamente com o trabalho normal.
Novamente, NÃO pare ou reinicie o Bot!

Quando todos os trabalhos estiverem concluídos, você precisará confirmá-los. Isso redefinirá o status dos trabalhos. Isso possibilita iniciar uma nova redefinição.

No caso de uma redefinição, você também pode querer retirar grupos de servidor dos usuários. É importante não mudar a 'definição de classificação', antes de você fazer essa redefinição. Após a redefinição, você pode alterar a 'definição de classificação', certo!
A retirada de grupos de servidor pode demorar um pouco. Um 'Query-Slowmode' ativo aumentará ainda mais a duração necessária. Recomendamos um 'Query-Slowmode' desativado !


Esteja ciente de que não há como retornar! "; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "iniciar redefinição"; $lang['wihladm36'] = "parar o Bot depois"; $lang['wihladm36desc'] = "Esta opção está ativada, o bot irá parar depois que todas as redefinições forem feitas.

O Bot irá parar após todas as tarefas de redefinição serem feitas. Essa parada está funcionando exatamente como o parâmetro normal 'parar'. Significa que o Bot não começará com o parâmetro 'checar'.

Para iniciar o sistema de ranking, use o parâmetro 'iniciar' ou 'reiniciar'."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Status do trabalho"; $lang['wihladmrs0'] = "desativado"; $lang['wihladmrs1'] = "criado"; $lang['wihladmrs10'] = "Trabalho confirmado com sucesso!"; -$lang['wihladmrs11'] = "Tempo estimado para redefinir o sistema"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Tem certeza de que ainda deseja redefinir o sistema?"; $lang['wihladmrs13'] = "Sim, inicie a redefinição"; $lang['wihladmrs14'] = "Não, cancelar redefinição"; @@ -503,6 +527,7 @@ $lang['winav11'] = "Digite o ID-Ùnico do administrador do Sistema de ranking (TeamSpeak -> Bot-Admin). Isso é muito importante caso você perdeu seus dados de login para a interface da web (redefinir usando o ID-Ùnico)."; $lang['winav12'] = "Complementos"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "Base de dados"; $lang['winav3'] = "Núcleo"; $lang['winav4'] = "Outras configuraões"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Seguem-se as coisas necessárias para redefinir a senha:"; $lang['wiselcld'] = "selecionar clientes"; $lang['wiselclddesc'] = "Selecione os clientes pelo seu último nome de usuário conhecido, ID-Ùnico ou Cliente-ID do banco de dados. Também são possíveis seleções múltiplas.

Em bases de dados maiores, essa seleção poderia diminuir muito. Recomenda-se copiar e colar o apelido completo no interior, em vez de digitá-lo."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "Tempo ativo"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git "a/languages/core_ro_Rom\303\242n\304\203_ro.php" "b/languages/core_ro_Rom\303\242n\304\203_ro.php" index c3af765..1ad17a0 100644 --- "a/languages/core_ro_Rom\303\242n\304\203_ro.php" +++ "b/languages/core_ro_Rom\303\242n\304\203_ro.php" @@ -51,6 +51,7 @@ $lang['factor'] = "Factor"; $lang['highest'] = "Cel mai înalt rang atins"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "in Seconds"; $lang['install'] = "Instalare"; $lang['instdb'] = "Instalam baza de date:"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Define here, after which time a user should get automatically a predefined servergroup.

time (seconds) => servergroup ID => permanent flag

Max. value is 999.999.999 seconds (over 31 years).

The entered seconds will be rated as 'online time' or 'active time', depending on the setting of the 'time mode' you have chosen.

Each entry has to separate from next with a comma.

The time must be entered cumulative

Example:
60=>9=>0,120=>10=>0,180=>11=>0
On this example a user receives servergroup 9 after 60 seconds, servergroup 10 after another 60 seconds, servergroup 11 after another 60 seconds."; $lang['wigrptk'] = "cumulative"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Lista Rank(Mod Admin)"; $lang['wihladm0'] = "Function description (click)"; $lang['wihladm0desc'] = "Choose one or more reset options and press \"start reset\" to start it.
Each option is described by itself.

After starting the reset job(s), you can view the status on this site.

The reset task will be done about the Ranksystem Bot as a job.
It is necessary the Ranksystem Bot is running.
Do NOT stop or restart the Bot during the reset is in progress!

For the time of running the reset, the Ranksystem will pause all other things. After completing the reset the Bot will automatically go on with the normal work.
Again, do NOT stop or restart the Bot!

When all jobs are done, you need to confirm them. This will reset the status of the jobs. That makes it possible to start a new reset.

In case of a reset you might also want to withdraw servergroups from the users. It is important not to change the 'rank up definition', before you have done this reset. After reset you can change the 'rank up definition', sure!
The withdrawing of servergroups could take a while. An active 'Query-Slowmode' will further increase the required duration. We recommend a disabled 'Query-Slowmode'!


Be aware, there is no way of return!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "start reset"; $lang['wihladm36'] = "stop Bot afterwards"; $lang['wihladm36desc'] = "Is this option activated, the Bot will stop after all reset things are done.

This stop is exactly working like the normal 'stop' parameter. Means, the Bot will not start with the 'check' parameter.

To start the Ranksystem Bot use the 'start' or 'restart' parameter."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Job Status"; $lang['wihladmrs0'] = "disabled"; $lang['wihladmrs1'] = "created"; $lang['wihladmrs10'] = "Job(s) successfully confirmed!"; -$lang['wihladmrs11'] = "Estimated time to reset the system"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Are you sure, you still want to reset the system?"; $lang['wihladmrs13'] = "Yes, start reset"; $lang['wihladmrs14'] = "No, cancel reset"; @@ -469,8 +493,8 @@ $lang['wihladmrs5'] = "Reset Job(s) successfully created."; $lang['wihladmrs6'] = "There is still a reset job active. Please wait until all jobs are finished before you start the next!"; $lang['wihladmrs7'] = "Press %s Refresh %s to monitor the status."; -$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the reset is in progress!"; -$lang['wihladmrs9'] = "Please %s confirm %s the jobs. This will reset the job status of all jobs. It is needed to be able to start a new reset."; +$lang['wihladmrs8'] = "Do NOT stop or restart the Bot during the job is in progress!"; +$lang['wihladmrs9'] = "Please %s confirm %s the job(s). This will reset the job status of all jobs. It is needed to be able to start a new one."; $lang['wihlset'] = "setări"; $lang['wiignidle'] = "Ignora timp afk"; $lang['wiignidledesc'] = "Define a period, up to which the idle time of a user will be ignored.

When a client does not do anything on the server (=idle), this time is noted by the Ranksystem. With this feature the idle time of an user will not be counted until the defined limit. Only when the defined limit is exceeded, it counts from that point for the Ranksystem as idle time.

This function matters only in conjunction with the mode 'active time'.

Meaning the function is e.g. to evaluate the time of listening in conversations as activity.

0 Sec. = disable this function

Example:
Ignore idle = 600 (seconds)
A client has an idle of 8 minuntes.
└ 8 minutes idle are ignored and he therefore receives this time as active time. If the idle time now increased to 12 minutes, the time is over 10 minutes and in this case 2 minutes would be counted as idle time, the first 10 minutes as active time."; @@ -503,6 +527,7 @@ $lang['winav11'] = "Please define a Bot-Admin, which should be the administrator of the Ranksystem (TeamSpeak -> Bot-Admin). This is very important in case you lost your login credentials for the webinterface."; $lang['winav12'] = "Addons"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "baza de date"; $lang['winav3'] = "Core"; $lang['winav4'] = "altele"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Following things are required to reset the password:"; $lang['wiselcld'] = "selecteaza useri"; $lang['wiselclddesc'] = "Select the clients by their last known username, unique Client-ID or Client-database-ID.
Multiple selections are also possible."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "timp activ"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git "a/languages/core_ru_P\321\203\321\201\321\201\320\272\320\270\320\271_ru.php" "b/languages/core_ru_P\321\203\321\201\321\201\320\272\320\270\320\271_ru.php" index f4b2ebe..78d21e9 100644 --- "a/languages/core_ru_P\321\203\321\201\321\201\320\272\320\270\320\271_ru.php" +++ "b/languages/core_ru_P\321\203\321\201\321\201\320\272\320\270\320\271_ru.php" @@ -51,6 +51,7 @@ $lang['factor'] = "коэффициент"; $lang['highest'] = "Достигнут максимальный ранг"; $lang['imprint'] = "Imprint"; +$lang['input'] = "Input Value"; $lang['insec'] = "в секундах"; $lang['install'] = "Установка"; $lang['instdb'] = "Установка базы данных"; @@ -434,6 +435,20 @@ $lang['wigrptime3desc'] = "

Permanent Group
This allows to set a flag for a server group that shouldn't be removed at the next rank increase. The rank line, which is defined with this flag (='ON'), will stay permanent by the Ranksystem.
By default (='OFF'), the current server group will be removed at the time, the user reaches a higher rank."; $lang['wigrptimedesc'] = "Укажите через какой промежуток времени, будут выдаваться группы сервера.

Время (в секундах) => номер группы сервера (ServerGroupID) => permanent flag

К тому же, от выбранного режима будет зависеть.

Каждый параметр должен разделяться запятой.

Так же время должно быть указано по 'нарастающей'

Пример:
60=>9=>0,120=>10=>0,180=>11=>0
По истечению 60 секунд пользователь получает сервер группу под SGID 9, по истечении очередных 120 секунд пользователь получает группу сервера с ID 10, и так далее..."; $lang['wigrptk'] = "общее"; +$lang['wiheadacao'] = "Access-Control-Allow-Origin"; +$lang['wiheadacao1'] = "allow any ressource"; +$lang['wiheadacao3'] = "allow custom URL"; +$lang['wiheadacaodesc'] = "With this you can define the Access-Control-Allow-Origin header. More information you can find here:
%s

To allow a custom origin, enter the URL
Example:
https://ts-ranksystem.com


Muliple origins can be also defined. Seperate this from each other with a comma.
Example:
https://ts-ranksystem.com,https://ts-n.net
"; +$lang['wiheadcontyp'] = "X-Content-Type-Options"; +$lang['wiheadcontypdesc'] = "Enable it to set this header to the option 'nosniff'."; +$lang['wiheaddesc'] = "With this you can define the %s header. More information you can find here:
%s"; +$lang['wiheaddesc1'] = "Choose 'disabled' to not set the header by the Ranksystem."; +$lang['wiheadframe'] = "X-Frame-Options"; +$lang['wiheadxss'] = "X-XSS-Protection"; +$lang['wiheadxss1'] = "disables XSS filtering"; +$lang['wiheadxss2'] = "enables XSS filtering"; +$lang['wiheadxss3'] = "filter XSS parts"; +$lang['wiheadxss4'] = "block full rendering"; $lang['wihladm'] = "Список пользователей (Режим администратора)"; $lang['wihladm0'] = "Описание функции (кликабельно)"; $lang['wihladm0desc'] = "Выберите одну или несколько опций сброса и нажмите \"начать сброс\" для запуска.

После запуска задач(и) сброса вы можете просмотреть статус на этой странице.

Задача будет выполняться ботом системы рангов.
Он должен оставаться запущенным.
НЕ ОСТАНАВЛИВАЙТЕ и НЕ ПЕРЕЗАПУСКАЙТЕ бота во время сброса!

Все процессы системы рангов будут приостановлены на время сброса. После завершения бот автоматически продолжит работу в нормальном режиме.
Ещё раз, НЕ ОСТАНАВЛИВАЙТЕ и НЕ ПЕРЕЗАПУСКАЙТЕ бота!

После завершения всех задач необходимо принять изменения. Статус задач будет сброшен. После этого можно будет создать новые задачи сброса.

В случае сброса вы вероятно так же захотите снять группы сервера с пользователей. До завершения сброса очень важно не изменять настройки повышения ранга.
Снятие серверных групп может занять какое-то время. Активный 'режим замедленного Query' так же замедлит этот процесс. Рекомендуем отключить его на время.!


Будьте осторожны, после запуска сброса обратного пути не будет!"; @@ -453,11 +468,20 @@ $lang['wihladm35'] = "Начать сброс"; $lang['wihladm36'] = "Остановить систему после завершения"; $lang['wihladm36desc'] = "Если эта опция активна - система рангов выключится после завершения сброса.

Команда остановки отработает точно так же как и обычная команда. Это значит что система рангов не запустится заново через параметр запуска 'check'.

После завершения систему рангов необходимо запустить используя команду 'start' или 'restart'."; +$lang['wihladmex'] = "Database Export"; +$lang['wihladmex1'] = "Database Export Job successfully created."; +$lang['wihladmex2'] = "Note:%s The password of the ZIP container is your current TS3 Query-Password:"; +$lang['wihladmex3'] = "File %s successfully deleted."; +$lang['wihladmex4'] = "An error happens on deleting the file %s. Is the file still existing and the permissions to delete them are given?"; +$lang['wihladmex5'] = "download file"; +$lang['wihladmex6'] = "delete file"; +$lang['wihladmex7'] = "Create SQL Export"; +$lang['wihladmexdesc'] = "With this function you can create an export / backup of the Ranksystem database. As output it will be created an SQL file, which will be ZIP compressed.

The export might need a few minutes, depending on how big the database is. It will be done as job by the Ranksystem bot.
Do NOT stop or restart the Ranksystem Bot, while the job is running!

Before you start an export, you might want to configure your webserver, 'ZIP' and 'SQL' files inside your logpath (Webinterface -> Other -> Logpath) are not accessible for clients. This will protect your export, cause there are sensitive data inside, like your TS3 Query credentials. The webserver users still need permissions for these files to access this for the download about the webinterface!

After the download, check the last line of the SQL file, to be sure the file is fully written. It needs to be:
-- Finished export

On PHP version >= 7.2 the export 'ZIP' file will be password protected. As password, we will use the TS3 Query password, you set in TeamSpeak options.

Import the SQL file if needed directly to your database. You can use phpMyAdmin for this, but it is not needed. You can use every way you can run a SQL file on your database.
Be careful by importing the SQL file. All existing data on the chosen database will be deleted due the import."; $lang['wihladmrs'] = "Статус задачи"; $lang['wihladmrs0'] = "отключена"; $lang['wihladmrs1'] = "создана"; $lang['wihladmrs10'] = "Задание успешно подтверждено!"; -$lang['wihladmrs11'] = "Примерное время сброса системы рангов"; +$lang['wihladmrs11'] = "Estimated time until completion the job"; $lang['wihladmrs12'] = "Вы уверены что хотите продолжить? Вся статистика системы рангов будет сброшена!"; $lang['wihladmrs13'] = "Да, начать сброс"; $lang['wihladmrs14'] = "Нет, отменить сброс"; @@ -503,6 +527,7 @@ $lang['winav11'] = "Пожалуйста, укажите себя как Администратора системы рангов в настройках, меню \"TeamSpeak\". Это очень важно, так как в случае утери пароля восстановить его (штатными средствами системы рангов) станет невозможно!"; $lang['winav12'] = "Аддоны"; $lang['winav13'] = "General (Stats)"; +$lang['winav14'] = "You have disabled the navbar of the statistics page. You might want to embed the statistic page with an IFrame into another website? Then have a look in this FAQ:"; $lang['winav2'] = "База данных"; $lang['winav3'] = "Система"; $lang['winav4'] = "Прочее"; @@ -536,6 +561,8 @@ $lang['wirtpw9'] = "Для сброса пароля потребуется следующее:"; $lang['wiselcld'] = "Выбор пользователя"; $lang['wiselclddesc'] = "Укажите пользователя по его последнему никнейму или уникальному идентификатору(UID), или ID в базе данных Teamspeak 3 сервера."; +$lang['wisesssame'] = "Session Cookie 'SameSite'"; +$lang['wisesssamedesc'] = "The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. More information you can find here:
%s

You can define the SameSite attribute here. This might be necessary/useful, when your are embed the Ranksystem with an iframe on another website.

This is only supported with PHP 7.3 or above."; $lang['wishcol'] = "Show/hide column"; $lang['wishcolat'] = "Время активности"; $lang['wishcoldesc'] = "Switch this column 'on' or 'off' to show or hide it on the stats page.

This allows you to configure the List Rankup (stats/list_rankup.php) individually."; diff --git a/libs/combined_wi.js b/libs/combined_wi.js index 9419d32..ff02f3c 100644 --- a/libs/combined_wi.js +++ b/libs/combined_wi.js @@ -13,7 +13,7 @@ var hljs=new function(){function k(v){return v.replace(/&/gm,"&").replace(/< /* Bootstrap Validator */ +function(a){"use strict";function b(b){return b.is('[type="checkbox"]')?b.prop("checked"):b.is('[type="radio"]')?!!a('[name="'+b.attr("name")+'"]:checked').length:a.trim(b.val())}function c(b){return this.each(function(){var c=a(this),e=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b),f=c.data("bs.validator");(f||"destroy"!=b)&&(f||c.data("bs.validator",f=new d(this,e)),"string"==typeof b&&f[b]())})}var d=function(c,e){this.options=e,this.$element=a(c),this.$inputs=this.$element.find(d.INPUT_SELECTOR),this.$btn=a('button[type="submit"], input[type="submit"]').filter('[form="'+this.$element.attr("id")+'"]').add(this.$element.find('input[type="submit"], button[type="submit"]')),e.errors=a.extend({},d.DEFAULTS.errors,e.errors);for(var f in e.custom)if(!e.errors[f])throw new Error("Missing default error message for custom validator: "+f);a.extend(d.VALIDATORS,e.custom),this.$element.attr("novalidate",!0),this.toggleSubmit(),this.$element.on("input.bs.validator change.bs.validator focusout.bs.validator",d.INPUT_SELECTOR,a.proxy(this.onInput,this)),this.$element.on("submit.bs.validator",a.proxy(this.onSubmit,this)),this.$element.find("[data-match]").each(function(){var c=a(this),d=c.data("match");a(d).on("input.bs.validator",function(){b(c)&&c.trigger("input.bs.validator")})})};d.INPUT_SELECTOR=':input:not([type="submit"], button):enabled:visible',d.FOCUS_OFFSET=20,d.DEFAULTS={delay:500,html:!1,disable:!0,focus:!0,custom:{},errors:{match:"Does not match",minlength:"Not long enough"},feedback:{success:"glyphicon-ok",error:"glyphicon-remove"}},d.VALIDATORS={"native":function(a){var b=a[0];return b.checkValidity?b.checkValidity():!0},match:function(b){var c=b.data("match");return!b.val()||b.val()===a(c).val()},minlength:function(a){var b=a.data("minlength");return!a.val()||a.val().length>=b}},d.prototype.onInput=function(b){var c=this,d=a(b.target),e="focusout"!==b.type;this.validateInput(d,e).done(function(){c.toggleSubmit()})},d.prototype.validateInput=function(c,d){var e=b(c),f=c.data("bs.validator.previous"),g=c.data("bs.validator.errors");if(f===e)return a.Deferred().resolve();c.data("bs.validator.previous",e),c.is('[type="radio"]')&&(c=this.$element.find('input[name="'+c.attr("name")+'"]'));var h=a.Event("validate.bs.validator",{relatedTarget:c[0]});if(this.$element.trigger(h),!h.isDefaultPrevented()){var i=this;return this.runValidators(c).done(function(b){c.data("bs.validator.errors",b),b.length?d?i.defer(c,i.showErrors):i.showErrors(c):i.clearErrors(c),g&&b.toString()===g.toString()||(h=b.length?a.Event("invalid.bs.validator",{relatedTarget:c[0],detail:b}):a.Event("valid.bs.validator",{relatedTarget:c[0],detail:g}),i.$element.trigger(h)),i.toggleSubmit(),i.$element.trigger(a.Event("validated.bs.validator",{relatedTarget:c[0]}))})}},d.prototype.runValidators=function(c){function e(a){return c.data(a+"-error")||c.data("error")||"native"==a&&c[0].validationMessage||h.errors[a]}var f=[],g=a.Deferred(),h=this.options;return c.data("bs.validator.deferred")&&c.data("bs.validator.deferred").reject(),c.data("bs.validator.deferred",g),a.each(d.VALIDATORS,a.proxy(function(a,d){if((b(c)||c.attr("required"))&&(c.data(a)||"native"==a)&&!d.call(this,c)){var g=e(a);!~f.indexOf(g)&&f.push(g)}},this)),!f.length&&b(c)&&c.data("remote")?this.defer(c,function(){var d={};d[c.attr("name")]=b(c),a.get(c.data("remote"),d).fail(function(a,b,c){f.push(e("remote")||c)}).always(function(){g.resolve(f)})}):g.resolve(f),g.promise()},d.prototype.validate=function(){var b=this;return a.when(this.$inputs.map(function(){return b.validateInput(a(this),!1)})).then(function(){b.toggleSubmit(),b.focusError()}),this},d.prototype.focusError=function(){if(this.options.focus){var b=a(".has-error:first :input");0!==b.length&&(a(document.body).animate({scrollTop:b.offset().top-d.FOCUS_OFFSET},250),b.focus())}},d.prototype.showErrors=function(b){var c=this.options.html?"html":"text",d=b.data("bs.validator.errors"),e=b.closest(".form-group"),f=e.find(".help-block.with-errors"),g=e.find(".form-control-feedback");d.length&&(d=a("
    ").addClass("list-unstyled").append(a.map(d,function(b){return a("
  • ")[c](b)})),void 0===f.data("bs.validator.originalContent")&&f.data("bs.validator.originalContent",f.html()),f.empty().append(d),e.addClass("has-error has-danger"),e.hasClass("has-feedback")&&g.removeClass(this.options.feedback.success)&&g.addClass(this.options.feedback.error)&&e.removeClass("has-success"))},d.prototype.clearErrors=function(a){var c=a.closest(".form-group"),d=c.find(".help-block.with-errors"),e=c.find(".form-control-feedback");d.html(d.data("bs.validator.originalContent")),c.removeClass("has-error has-danger"),c.hasClass("has-feedback")&&e.removeClass(this.options.feedback.error)&&b(a)&&e.addClass(this.options.feedback.success)&&c.addClass("has-success")},d.prototype.hasErrors=function(){function b(){return!!(a(this).data("bs.validator.errors")||[]).length}return!!this.$inputs.filter(b).length},d.prototype.isIncomplete=function(){function c(){return!b(a(this))}return!!this.$inputs.filter("[required]").filter(c).length},d.prototype.onSubmit=function(a){this.validate(),(this.isIncomplete()||this.hasErrors())&&a.preventDefault()},d.prototype.toggleSubmit=function(){this.options.disable&&this.$btn.toggleClass("disabled",this.isIncomplete()||this.hasErrors())},d.prototype.defer=function(b,c){return c=a.proxy(c,this,b),this.options.delay?(window.clearTimeout(b.data("bs.validator.timeout")),void b.data("bs.validator.timeout",window.setTimeout(c,this.options.delay))):c()},d.prototype.destroy=function(){return this.$element.removeAttr("novalidate").removeData("bs.validator").off(".bs.validator").find(".form-control-feedback").removeClass([this.options.feedback.error,this.options.feedback.success].join(" ")),this.$inputs.off(".bs.validator").removeData(["bs.validator.errors","bs.validator.deferred","bs.validator.previous"]).each(function(){var b=a(this),c=b.data("bs.validator.timeout");window.clearTimeout(c)&&b.removeData("bs.validator.timeout")}),this.$element.find(".help-block.with-errors").each(function(){var b=a(this),c=b.data("bs.validator.originalContent");b.removeData("bs.validator.originalContent").html(c)}),this.$element.find('input[type="submit"], button[type="submit"]').removeClass("disabled"),this.$element.find(".has-error, .has-danger").removeClass("has-error has-danger"),this};var e=a.fn.validator;a.fn.validator=c,a.fn.validator.Constructor=d,a.fn.validator.noConflict=function(){return a.fn.validator=e,this},a(window).on("load",function(){a('form[data-toggle="validator"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery); /* FontAwesome 5.7.2 solid.js */ -!function(){"use strict";var c={},h={};try{"undefined"!=typeof window&&(c=window),"undefined"!=typeof document&&(h=document)}catch(c){}var l=(c.navigator||{}).userAgent,v=void 0===l?"":l,z=c,s=h,M=(z.document,!!s.documentElement&&!!s.head&&"function"==typeof s.addEventListener&&s.createElement,~v.indexOf("MSIE")||v.indexOf("Trident/"),"___FONT_AWESOME___"),m=function(){try{return!0}catch(c){return!1}}();var H=z||{};H[M]||(H[M]={}),H[M].styles||(H[M].styles={}),H[M].hooks||(H[M].hooks={}),H[M].shims||(H[M].shims=[]);var a=H[M];function V(c,v){var h=(2>>0;n--;)e[n]=t[n];return e}function Ct(t){return t.classList?At(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(t){return t})}function Ot(t,e){var n,a=e.split("-"),r=a[0],i=a.slice(1).join("-");return r!==t||""===i||(n=i,~F.indexOf(n))?null:i}function St(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Pt(n){return Object.keys(n||{}).reduce(function(t,e){return t+"".concat(e,": ").concat(n[e],";")},"")}function Nt(t){return t.size!==yt.size||t.x!==yt.x||t.y!==yt.y||t.rotate!==yt.rotate||t.flipX||t.flipY}function Mt(t){var e=t.transform,n=t.containerWidth,a=t.iconWidth,r={transform:"translate(".concat(n/2," 256)")},i="translate(".concat(32*e.x,", ").concat(32*e.y,") "),o="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),c="rotate(".concat(e.rotate," 0 0)");return{outer:r,inner:{transform:"".concat(i," ").concat(o," ").concat(c)},path:{transform:"translate(".concat(a/2*-1," -256)")}}}var zt={x:0,y:0,width:"100%",height:"100%"};function Et(t){var e=!(1").concat(o.map(Zt).join(""),"")}var $t=function(){};function te(t){return"string"==typeof(t.getAttribute?t.getAttribute(G):null)}var ee={replace:function(t){var e=t[0],n=t[1].map(function(t){return Zt(t)}).join("\n");if(e.parentNode&&e.outerHTML)e.outerHTML=n+(J.keepOriginalSource&&"svg"!==e.tagName.toLowerCase()?"\x3c!-- ".concat(e.outerHTML," --\x3e"):"");else if(e.parentNode){var a=document.createElement("span");e.parentNode.replaceChild(a,e),a.outerHTML=n}},nest:function(t){var e=t[0],n=t[1];if(~Ct(e).indexOf(J.replacementClass))return ee.replace(t);var a=new RegExp("".concat(J.familyPrefix,"-.*"));delete n[0].attributes.style,delete n[0].attributes.id;var r=n[0].attributes.class.split(" ").reduce(function(t,e){return e===J.replacementClass||e.match(a)?t.toSvg.push(e):t.toNode.push(e),t},{toNode:[],toSvg:[]});n[0].attributes.class=r.toSvg.join(" ");var i=n.map(function(t){return Zt(t)}).join("\n");e.setAttribute("class",r.toNode.join(" ")),e.setAttribute(G,""),e.innerHTML=i}};function ne(t){t()}function ae(n,t){var a="function"==typeof t?t:$t;if(0===n.length)a();else{var e=ne;J.mutateApproach===P&&(e=g.requestAnimationFrame||ne),e(function(){var t=!0===J.autoReplaceSvg?ee.replace:ee[J.autoReplaceSvg]||ee.replace,e=Yt.begin("mutate");n.map(t),e(),a()})}}var re=!1;function ie(){re=!1}var oe=null;function ce(t){if(l&&J.observeMutations){var r=t.treeCallback,i=t.nodeCallback,o=t.pseudoElementsCallback,e=t.observeMutationsRoot,n=void 0===e?v:e;oe=new l(function(t){re||At(t).forEach(function(t){if("childList"===t.type&&0privilegeKeyCreate($type, $id1, $id2, $description, $customset); } @@ -2062,7 +2062,7 @@ public function tokenCreate($type = TeamSpeak3::TOKEN_SERVERGROUP, $id1, $id2 = * @param string $customset * @return TeamSpeak3_Helper_String */ - public function privilegeKeyCreate($type = TeamSpeak3::TOKEN_SERVERGROUP, $id1, $id2 = 0, $description = null, $customset = null) + public function privilegeKeyCreate($type = TeamSpeak3::TOKEN_SERVERGROUP, $id1 = 0, $id2 = 0, $description = null, $customset = null) { $token = $this->execute("privilegekeyadd", array("tokentype" => $type, "tokenid1" => $id1, "tokenid2" => $id2, "tokendescription" => $description, "tokencustomset" => $customset))->toList(); diff --git a/other/_functions.php b/other/_functions.php new file mode 100644 index 0000000..33a4bc3 --- /dev/null +++ b/other/_functions.php @@ -0,0 +1,481 @@ + true + ); + } else { + $dboptions = array(); + } + try { + $mysqlcon = new PDO($dbserver, $dbuser, $dbpass, $dboptions); + return $mysqlcon; + } catch (PDOException $e) { + echo 'Delivered Parameter: '.$dbserver.'

    '; + echo 'Database Connection failed: '.$e->getMessage().'

    Check:
    - You have already installed the Ranksystem? Run install.php first!
    - Is the database reachable?
    - You have installed all needed PHP extenstions? Have a look here for Windows or Linux?'; $err_lvl = 3; + if($exit!=NULL) exit; + } + } +} + +function enter_logfile($cfg,$loglevel,$logtext,$norotate = false) { + if($loglevel!=9 && $loglevel > $cfg['logs_debug_level']) return; + $file = $cfg['logs_path'].'ranksystem.log'; + switch ($loglevel) { + case 1: $loglevel = " CRITICAL "; break; + case 2: $loglevel = " ERROR "; break; + case 3: $loglevel = " WARNING "; break; + case 4: $loglevel = " NOTICE "; break; + case 5: $loglevel = " INFO "; break; + case 6: $loglevel = " DEBUG "; break; + default:$loglevel = " NONE "; + } + $loghandle = fopen($file, 'a'); + fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n"); + fclose($loghandle); + if($norotate == false && filesize($file) > ($cfg['logs_rotation_size'] * 1048576)) { + $loghandle = fopen($file, 'a'); + fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n"); + fclose($loghandle); + $file2 = "$file.old"; + if(file_exists($file2)) unlink($file2); + rename($file, $file2); + $loghandle = fopen($file, 'a'); + fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s.u ")." NOTICE Rotated logfile...\n"); + fclose($loghandle); + } +} + +function error_handling($msg,$type = NULL) { + if(strstr($type, '#') && strstr($msg, '#####')) { + $type_arr = explode('#', $type); + $msg_arr = explode('#####', $msg); + $cnt = 0; + + foreach($msg_arr as $msg) { + switch ($type_arr[$cnt]) { + case NULL: echo '
    '; break; + case 0: echo '
    '; break; + case 1: echo '
    '; break; + case 2: echo '
    '; break; + case 3: echo '
    '; break; + } + echo '',$msg_arr[$cnt],'
    '; + $cnt++; + } + } else { + switch ($type) { + case NULL: echo '
    '; break; + case 0: echo '
    '; break; + case 1: echo '
    '; break; + case 2: echo '
    '; break; + case 3: echo '
    '; break; + } + echo '',$msg,'
    '; + } +} + +function getclientip() { + if (!empty($_SERVER['HTTP_CLIENT_IP'])) + return $_SERVER['HTTP_CLIENT_IP']; + elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) + return $_SERVER['HTTP_X_FORWARDED_FOR']; + elseif(!empty($_SERVER['HTTP_X_FORWARDED'])) + return $_SERVER['HTTP_X_FORWARDED']; + elseif(!empty($_SERVER['HTTP_FORWARDED_FOR'])) + return $_SERVER['HTTP_FORWARDED_FOR']; + elseif(!empty($_SERVER['HTTP_FORWARDED'])) + return $_SERVER['HTTP_FORWARDED']; + elseif(!empty($_SERVER['REMOTE_ADDR'])) + return $_SERVER['REMOTE_ADDR']; + else + return false; +} + +function getlog($cfg,$number_lines,$filters,$filter2,$inactivefilter = NULL) { + $lines=array(); + if(file_exists($cfg['logs_path']."ranksystem.log")) { + $fp = fopen($cfg['logs_path']."ranksystem.log", "r"); + $buffer=array(); + while($line = fgets($fp, 4096)) { + array_push($buffer, $line); + } + fclose($fp); + $buffer = array_reverse($buffer); + $lastfilter = 'init'; + foreach($buffer as $line) { + if(substr($line, 0, 2) != "20" && in_array($lastfilter, $filters)) { + array_push($lines, $line); + if (count($lines)>$number_lines) { + break; + } + continue; + } + foreach($filters as $filter) { + if(($filter != NULL && strstr($line, $filter) && $filter2 == NULL) || ($filter2 != NULL && strstr($line, $filter2) && $filter != NULL && strstr($line, $filter))) { + if($filter == "CRITICAL" || $filter == "ERROR") { + array_push($lines, ''.$line.''); + } elseif($filter == "WARNING") { + array_push($lines, ''.$line.''); + } else { + array_push($lines, $line); + } + $lastfilter = $filter; + if (count($lines)>$number_lines) { + break 2; + } + break; + } elseif($inactivefilter != NULL) { + foreach($inactivefilter as $defilter) { + if($defilter != NULL && strstr($line, $defilter)) { + $lastfilter = $defilter; + } + } + } + } + } + } else { + $lines[] = "No log entry found...\n"; + $lines[] = "The logfile will be created with next startup.\n"; + } + return $lines; +} + +function get_language($cfg) { + $rspathhex = get_rspath(); + if(isset($_GET["lang"])) { + if(is_dir(substr(__DIR__,0,-5).'languages/')) { + foreach(scandir(substr(__DIR__,0,-5).'languages/') as $file) { + if ('.' === $file || '..' === $file || is_dir($file)) continue; + $sep_lang = preg_split("/[._]/", $file); + if(isset($sep_lang[0]) && $sep_lang[0] == 'core' && isset($sep_lang[1]) && strlen($sep_lang[1]) == 2 && isset($sep_lang[4]) && strtolower($sep_lang[4]) == 'php') { + if(strtolower($_GET["lang"]) == strtolower($sep_lang[1])) { + $_SESSION[$rspathhex.'language'] = $sep_lang[1]; + return $sep_lang[1]; + } + } + } + } + + } + if(isset($_SESSION[$rspathhex.'language'])) { + return $_SESSION[$rspathhex.'language']; + } + if(isset($cfg['default_language'])) { + return $cfg['default_language']; + } + return "en"; +} + +function get_percentage($max_value, $value) { + return (round(($value/$max_value)*100)); +} + +function get_rspath() { + return 'rs_'.dechex(crc32(__DIR__)).'_'; +} + +function human_readable_size($bytes,$lang) { + $size = array($lang['size_byte'],$lang['size_kib'],$lang['size_mib'],$lang['size_gib'],$lang['size_tib'],$lang['size_pib'],$lang['size_eib'],$lang['size_zib'],$lang['size_yib']); + $factor = floor((strlen($bytes) - 1) / 3); + return sprintf("%.2f", $bytes / pow(1024, $factor)) . ' ' . @$size[$factor]; +} + +function mime2extension($mimetype) { + $mimearr = [ + 'image/bmp' => 'bmp', + 'image/x-bmp' => 'bmp', + 'image/x-bitmap' => 'bmp', + 'image/x-xbitmap' => 'bmp', + 'image/x-win-bitmap' => 'bmp', + 'image/x-windows-bmp' => 'bmp', + 'image/ms-bmp' => 'bmp', + 'image/x-ms-bmp' => 'bmp', + 'image/gif' => 'gif', + 'image/jpeg' => 'jpg', + 'image/pjpeg' => 'jpg', + 'image/x-portable-bitmap' => 'pbm', + 'image/x-portable-graymap' => 'pgm', + 'image/png' => 'png', + 'image/x-png' => 'png', + 'image/x-portable-pixmap' => 'ppm', + 'image/svg+xml' => 'svg', + 'image/x-xbitmap' => 'xbm', + 'image/x-xpixmap' => 'xpm' + ]; + return isset($mimearr[$mimetype]) ? $mimearr[$mimetype] : FALSE; +} + +function pagination($keysort,$keyorder,$user_pro_seite,$seiten_anzahl_gerundet,$seite,$getstring) { + $pagination = ''; + return $pagination; +} + +function php_error_handling($err_code, $err_msg, $err_file, $err_line) { + global $cfg; + switch ($err_code) { + case E_USER_ERROR: $loglevel = 2; break; + case E_USER_WARNING: $loglevel = 3; break; + case E_USER_NOTICE: $loglevel = 4; break; + default: $loglevel = 4; + } + if(substr($err_msg, 0, 15) != "password_hash()") { + enter_logfile($cfg,$loglevel,$err_code.": ".$err_msg." on line ".$err_line." in ".$err_file); + } + return true; +} + +function rem_session_ts3() { + $rspathhex = get_rspath(); + 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.'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']); +} + +function set_language($language) { + if(is_dir(substr(__DIR__,0,-5).'languages/')) { + foreach(scandir(substr(__DIR__,0,-5).'languages/') as $file) { + if ('.' === $file || '..' === $file || is_dir($file)) continue; + $sep_lang = preg_split("/[._]/", $file); + if(isset($sep_lang[0]) && $sep_lang[0] == 'core' && isset($sep_lang[1]) && strlen($sep_lang[1]) == 2 && isset($sep_lang[4]) && strtolower($sep_lang[4]) == 'php') { + if(strtolower($language) == strtolower($sep_lang[1])) { + include(substr(__DIR__,0,-5).'languages/core_'.$sep_lang[1].'_'.$sep_lang[2].'_'.$sep_lang[3].'.'.$sep_lang[4]); + $_SESSION[get_rspath().'language'] = $sep_lang[1]; + $required_lang = 1; + break; + } + } + } + } + if(!isset($required_lang)) { + include('../languages/core_en_english_gb.php'); + } + return $lang; +} + +function set_session_ts3($mysqlcon,$cfg,$lang,$dbname) { + $hpclientip = getclientip(); + $rspathhex = get_rspath(); + + $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'] = $lang['stag0016']; + $_SESSION[$rspathhex.'serverport'] = $cfg['teamspeak_voice_port']; + $_SESSION[$rspathhex.'multiple'] = array(); + + if($cfg['rankup_hash_ip_addresses_mode'] == 2) { + $salt = md5(dechex(crc32(substr(__DIR__,0,-5)))); + $hashedip = crypt($hpclientip, '$2y$10$'.$salt.'$'); + } + + foreach ($allclients as $client) { + if(isset($_SESSION[$rspathhex.'uuid_verified']) && $_SESSION[$rspathhex.'uuid_verified'] != $client['uuid']) { + continue; + } + $verify = FALSE; + if($cfg['rankup_hash_ip_addresses_mode'] == 1) { + if (isset($iptable[$client['uuid']]['iphash']) && $iptable[$client['uuid']]['iphash'] != NULL && password_verify($hpclientip, $iptable[$client['uuid']]['iphash'])) { + $verify = TRUE; + } + } elseif($cfg['rankup_hash_ip_addresses_mode'] == 2) { + if (isset($iptable[$client['uuid']]['iphash']) && $hashedip == $iptable[$client['uuid']]['iphash'] && $iptable[$client['uuid']]['iphash'] != NULL) { + $verify = TRUE; + } + } else { + if (isset($iptable[$client['uuid']]['ip']) && $hpclientip == $iptable[$client['uuid']]['ip'] && $iptable[$client['uuid']]['ip'] != NULL) { + $verify = TRUE; + } + } + if ($verify == TRUE) { + $_SESSION[$rspathhex.'tsname'] = htmlspecialchars($client['name']); + if(isset($_SESSION[$rspathhex.'tsuid']) && $_SESSION[$rspathhex.'tsuid'] != $client['uuid']) { + $_SESSION[$rspathhex.'multiple'][$client['uuid']] = htmlspecialchars($client['name']); + $_SESSION[$rspathhex.'tsname'] = "verification needed (multiple)!"; + unset($_SESSION[$rspathhex.'admin']); + } elseif (!isset($_SESSION[$rspathhex.'tsuid'])) { + $_SESSION[$rspathhex.'multiple'][$client['uuid']] = htmlspecialchars($client['name']); + } + $_SESSION[$rspathhex.'tsuid'] = $client['uuid']; + foreach(array_flip($cfg['webinterface_admin_client_unique_id_list']) 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'] = $cfg['default_language']; + } + } +} + +function sendmessage($ts3, $cfg, $uuid, $msg, $targetmode, $targetid=NULL, $erromsg=NULL, $loglevel=NULL, $successmsg=NULL, $nolog=NULL) { + try { + if(strlen($msg) > 1024) { + $fragarr = explode("##*##", wordwrap($msg, 1022, "##*##", TRUE), 1022); + foreach($fragarr as $frag) { + usleep($cfg['teamspeak_query_command_delay']); + if ($targetmode==2 && $targetid!=NULL) { + $ts3->serverGetSelected()->channelGetById($targetid)->message("\n".$frag); + if($nolog==NULL) enter_logfile($cfg,6,"sendmessage fragment to channel (ID: $targetid): ".$frag); + } elseif ($targetmode==3) { + $ts3->serverGetSelected()->message("\n".$frag); + if($nolog==NULL) enter_logfile($cfg,6,"sendmessage fragment to server: ".$frag); + } elseif ($targetmode==1 && $targetid!=NULL) { + $ts3->serverGetSelected()->clientGetById($targetid)->message("\n".$frag); + if($nolog==NULL) enter_logfile($cfg,6,"sendmessage fragment to connectionID $targetid (uuid $uuid): ".$frag); + } else { + $ts3->serverGetSelected()->clientGetByUid($uuid)->message("\n".$frag); + if($nolog==NULL) enter_logfile($cfg,6,"sendmessage fragment to uuid $uuid (connectionID $targetid): ".$frag); + } + } + } else { + usleep($cfg['teamspeak_query_command_delay']); + if ($targetmode==2 && $targetid!=NULL) { + $ts3->serverGetSelected()->channelGetById($targetid)->message($msg); + if($nolog==NULL) enter_logfile($cfg,6,"sendmessage to channel (ID: $targetid): ".$msg); + } elseif ($targetmode==3) { + $ts3->serverGetSelected()->message($msg); + if($nolog==NULL) enter_logfile($cfg,6,"sendmessage to server: ".$msg); + } elseif ($targetmode==1 && $targetid!=NULL) { + $ts3->serverGetSelected()->clientGetById($targetid)->message($msg); + if($nolog==NULL) enter_logfile($cfg,6,"sendmessage to connectionID $targetid (uuid $uuid): ".$msg); + } else { + $ts3->serverGetSelected()->clientGetByUid($uuid)->message($msg); + if($nolog==NULL) enter_logfile($cfg,6,"sendmessage to uuid $uuid (connectionID $targetid): ".$msg); + } + + } + if($successmsg!=NULL) { + enter_logfile($cfg,5,$successmsg); + } + } catch (Exception $e) { + if($loglevel!=NULL) { + enter_logfile($cfg,$loglevel,$erromsg." TS3: ".$e->getCode().': '.$e->getMessage()); + } else { + enter_logfile($cfg,3,"sendmessage: ".$e->getCode().': '.$e->getMessage().", targetmode: $targetmode, targetid: $targetid"); + } + } +} + +function shutdown($mysqlcon,$cfg,$loglevel,$reason,$nodestroypid = TRUE) { + if($nodestroypid === TRUE) { + if (file_exists($cfg['logs_path'].'pid')) { + unlink($cfg['logs_path'].'pid'); + } + } + enter_logfile($cfg,$loglevel,$reason." Shutting down!"); + enter_logfile($cfg,9,"###################################################################"); + if(isset($mysqlcon)) { + $mysqlcon = null; + } + exit; +} + +function start_session($cfg) { + ini_set('session.cookie_httponly', 1); + ini_set('session.use_strict_mode', 1); + ini_set('session.sid_length', 128); + if(isset($cfg['default_header_xss'])) { + header("X-XSS-Protection: ".$cfg['default_header_xss']); + } else { + header("X-XSS-Protection: 1; mode=block"); + } + if(!isset($cfg['default_header_contenttyp']) || $cfg['default_header_contenttyp'] == 1) { + header("X-Content-Type-Options: nosniff"); + } + if(isset($cfg['default_header_frame']) && $cfg['default_header_frame'] != NULL) { + header("X-Frame-Options: ".$cfg['default_header_frame']); + } + + if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") { + $prot = 'https'; + ini_set('session.cookie_secure', 1); + if(!headers_sent()) { + header("Strict-Transport-Security: max-age=31536000; includeSubDomains; preload;"); + } + } else { + $prot = 'http'; + } + + if(isset($cfg['default_header_origin']) && $cfg['default_header_origin'] != NULL && $cfg['default_header_origin'] != 'null') { + if(strstr($cfg['default_header_origin'], ',')) { + $origin_arr = explode(',', $cfg['default_header_origin']); + if(isset($_SERVER['HTTP_ORIGIN']) && in_array($_SERVER['HTTP_ORIGIN'], $origin_arr)) { + header("Access-Control-Allow-Origin: ".$_SERVER['HTTP_ORIGIN']); + } + } else { + header("Access-Control-Allow-Origin: ".$cfg['default_header_origin']); + } + } + + if(version_compare(PHP_VERSION, '7.3.0', '>=')) { + ini_set('session.cookie_samesite', $cfg['default_session_sametime']); + } + + session_start(); + return $prot; +} +?> \ No newline at end of file diff --git a/other/config.php b/other/config.php index 4b8f42a..dd18023 100644 --- a/other/config.php +++ b/other/config.php @@ -1,78 +1,15 @@ true - ); - } else { - $dboptions = array(); - } - try { - $mysqlcon = new PDO($dbserver, $db['user'], $db['pass'], $dboptions); - } catch (PDOException $e) { - echo 'Database Connection failed: '.$e->getMessage().'

    Check:
    - You have already installed the Ranksystem? Run install.php first!
    - Is the database reachable?
    - You have installed all needed PHP extenstions? Have a look here for Windows or Linux?'; $err_lvl = 3; - exit; - } -} + +$mysqlcon = db_connect($db['type'], $db['host'], $db['dbname'], $db['user'], $db['pass']); if (isset($mysqlcon) && ($newcfg = $mysqlcon->query("SELECT * FROM `$dbname`.`cfg_params`"))) { if(isset($newcfg) && $newcfg != NULL) { @@ -106,8 +43,12 @@ function rem_session_ts3($rspathhex) { $cfg['rankup_definition'] = NULL; } else { foreach (explode(',', $cfg['rankup_definition']) as $entry) { - list($time, $group, $keepflag) = explode('=>', $entry); - if($keepflag == NULL) $keepflag = 0; + if(substr_count($entry, '=>') > 1) { + list($time, $group, $keepflag) = explode('=>', $entry); + } else { + list($time, $group) = explode('=>', $entry); + $keepflag = 0; + } $addnewvalue1[$time] = array("time"=>$time,"group"=>$group,"keep"=>$keepflag); $cfg['rankup_definition'] = $addnewvalue1; } @@ -130,39 +71,8 @@ function rem_session_ts3($rspathhex) { $cfg['stats_api_keys'] = $addnewvalue3; } } - if(!isset($_GET["lang"])) { - if(isset($_SESSION[$rspathhex.'language'])) { - $cfg['default_language'] = $_SESSION[$rspathhex.'language']; - } - } else { - if(is_dir(substr(__DIR__,0,-5).'languages/')) { - foreach(scandir(substr(__DIR__,0,-5).'languages/') as $file) { - if ('.' === $file || '..' === $file || is_dir($file)) continue; - $sep_lang = preg_split("/[._]/", $file); - if(isset($sep_lang[0]) && $sep_lang[0] == 'core' && isset($sep_lang[1]) && strlen($sep_lang[1]) == 2 && isset($sep_lang[4]) && strtolower($sep_lang[4]) == 'php') { - if(strtolower($_GET["lang"]) == strtolower($sep_lang[1])) { - $cfg['default_language'] = $sep_lang[1]; - $_SESSION[$rspathhex.'language'] = $sep_lang[1]; - $required_lang = 1; - break; - } - } - } - } - if(!isset($required_lang)) { - $cfg['default_language'] = "en"; - $_SESSION[$rspathhex.'language'] = "en"; - } - } - if(isset($cfg['default_language'])) { - $lang = set_language($cfg['default_language']); - } else { - $lang = set_language("en"); - } unset($addnewvalue1, $addnewvalue2, $newcfg); } -} elseif(!isset($_GET["lang"])) { - $lang = set_language("en"); } if(empty($cfg['logs_debug_level'])) { diff --git a/other/session.php b/other/session.php deleted file mode 100644 index 15a93cb..0000000 --- a/other/session.php +++ /dev/null @@ -1,97 +0,0 @@ -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'] = $lang['stag0016']; - $_SESSION[$rspathhex.'serverport'] = $cfg['teamspeak_voice_port']; - $_SESSION[$rspathhex.'multiple'] = array(); - - if($cfg['rankup_hash_ip_addresses_mode'] == 2) { - $salt = md5(dechex(crc32(substr(__DIR__,0,-5)))); - $hashedip = password_hash($hpclientip, PASSWORD_DEFAULT, array("cost" => 10, "salt" => $salt)); - } - - foreach ($allclients as $client) { - if(isset($_SESSION[$rspathhex.'uuid_verified']) && $_SESSION[$rspathhex.'uuid_verified'] != $client['uuid']) { - continue; - } - $verify = FALSE; - if($cfg['rankup_hash_ip_addresses_mode'] == 1) { - if (isset($iptable[$client['uuid']]['iphash']) && $iptable[$client['uuid']]['iphash'] != NULL && password_verify($hpclientip, $iptable[$client['uuid']]['iphash'])) { - $verify = TRUE; - } - } elseif($cfg['rankup_hash_ip_addresses_mode'] == 2) { - if (isset($iptable[$client['uuid']]['iphash']) && $hashedip == $iptable[$client['uuid']]['iphash'] && $iptable[$client['uuid']]['iphash'] != NULL) { - $verify = TRUE; - } - } else { - if (isset($iptable[$client['uuid']]['ip']) && $hpclientip == $iptable[$client['uuid']]['ip'] && $iptable[$client['uuid']]['ip'] != NULL) { - $verify = TRUE; - } - } - if ($verify == TRUE) { - $_SESSION[$rspathhex.'tsname'] = htmlspecialchars($client['name']); - if(isset($_SESSION[$rspathhex.'tsuid']) && $_SESSION[$rspathhex.'tsuid'] != $client['uuid']) { - $_SESSION[$rspathhex.'multiple'][$client['uuid']] = htmlspecialchars($client['name']); - $_SESSION[$rspathhex.'tsname'] = "verification needed (multiple)!"; - unset($_SESSION[$rspathhex.'admin']); - } elseif (!isset($_SESSION[$rspathhex.'tsuid'])) { - $_SESSION[$rspathhex.'multiple'][$client['uuid']] = htmlspecialchars($client['name']); - } - $_SESSION[$rspathhex.'tsuid'] = $client['uuid']; - foreach(array_flip($cfg['webinterface_admin_client_unique_id_list']) 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'] = $cfg['default_language']; - } - } -} -?> \ No newline at end of file diff --git a/stats/_nav.php b/stats/_nav.php index 1b3ab22..13e7dfa 100644 --- a/stats/_nav.php +++ b/stats/_nav.php @@ -6,6 +6,137 @@ $_SESSION[$rspathhex.'upinfomsg'] = 1; } } + +if(isset($_POST['username'])) { + $_GET["search"] = $_POST['usersuche']; + $_GET["seite"] = 1; +} +$filter = $searchstring = NULL; +if(isset($_GET["search"]) && $_GET["search"] != '') { + $getstring = htmlspecialchars($_GET['search']); +} +if(isset($getstring) && strstr($getstring, 'filter:excepted:')) { + if(str_replace('filter:excepted:','',$getstring)!='') { + $searchstring = str_replace('filter:excepted:','',$getstring); + } + $filter .= " AND `except` IN ('2','3')"; +} elseif(isset($getstring) && strstr($getstring, 'filter:nonexcepted:')) { + if(str_replace('filter:nonexcepted:','',$getstring)!='') { + $searchstring = str_replace('filter:nonexcepted:','',$getstring); + } + $filter .= " AND `except` IN ('0','1')"; +} else { + if(isset($getstring)) { + $searchstring = $getstring; + } else { + $searchstring = ''; + } + if($cfg['stats_show_excepted_clients_switch'] == 0) { + $filter .= " AND `except` IN ('0','1')"; + } +} +if(isset($getstring) && strstr($getstring, 'filter:online:')) { + $searchstring = preg_replace('/filter\:online\:/','',$searchstring); + $filter .= " AND `online`='1'"; +} elseif(isset($getstring) && strstr($getstring, 'filter:nononline:')) { + $searchstring = preg_replace('/filter\:nononline\:/','',$searchstring); + $filter .= " AND `online`='0'"; +} +if(isset($getstring) && strstr($getstring, 'filter:actualgroup:')) { + preg_match('/filter\:actualgroup\:(.*)\:/',$searchstring,$grpvalue); + $searchstring = preg_replace('/filter\:actualgroup\:(.*)\:/','',$searchstring); + $filter .= " AND `grpid`='".$grpvalue[1]."'"; +} +if(isset($getstring) && strstr($getstring, 'filter:country:')) { + preg_match('/filter\:country\:(.*)\:/',$searchstring,$grpvalue); + $searchstring = preg_replace('/filter\:country\:(.*)\:/','',$searchstring); + $filter .= " AND `nation`='".$grpvalue[1]."'"; +} +if(isset($getstring) && strstr($getstring, 'filter:lastseen:')) { + preg_match('/filter\:lastseen\:(.*)\:(.*)\:/',$searchstring,$seenvalue); + $searchstring = preg_replace('/filter\:lastseen\:(.*)\:(.*)\:/','',$searchstring); + if(isset($seenvalue[2]) && is_numeric($seenvalue[2])) { + $lastseen = $seenvalue[2]; + } elseif(isset($seenvalue[2])) { + $r = date_parse_from_format("Y-m-d H-i",$seenvalue[2]); + $lastseen = mktime($r['hour'], $r['minute'], $r['second'], $r['month'], $r['day'], $r['year']); + } else { + $lastseen = 0; + } + if(isset($seenvalue[1]) && ($seenvalue[1] == '<' || $seenvalue[1] == '<')) { + $operator = '<'; + } elseif(isset($seenvalue[1]) && ($seenvalue[1] == '>' || $seenvalue[1] == '>')) { + $operator = '>'; + } elseif(isset($seenvalue[1]) && $seenvalue[1] == '!=') { + $operator = '!='; + } else { + $operator = '='; + } + $filter .= " AND `lastseen`".$operator."'".$lastseen."'"; +} +$searchstring = htmlspecialchars_decode($searchstring); + +if(isset($getstring)) { + $dbdata_full = $mysqlcon->prepare("SELECT COUNT(*) FROM `$dbname`.`user` WHERE (`uuid` LIKE :searchvalue OR `cldbid` LIKE :searchvalue OR `name` LIKE :searchvalue)$filter"); + $dbdata_full->bindValue(':searchvalue', '%'.$searchstring.'%', PDO::PARAM_STR); + $dbdata_full->execute(); + $sumentries = $dbdata_full->fetch(PDO::FETCH_NUM); + $getstring = rawurlencode($getstring); +} else { + $getstring = ''; + $sumentries = $mysqlcon->query("SELECT COUNT(*) FROM `$dbname`.`user`")->fetch(PDO::FETCH_NUM); +} + +if(!isset($_GET["seite"])) { + $seite = 1; +} else { + $_GET["seite"] = preg_replace('/\D/', '', $_GET["seite"]); + if($_GET["seite"] > 0) { + $seite = $_GET["seite"]; + } else { + $seite = 1; + } +} +$adminlogin = 0; +$sortarr = array_flip(array("active","cldbid","count","grpid","grpsince","idle","lastseen","name","nation","nextup","platform","rank","uuid","version")); + +if(isset($_GET['sort']) && isset($sortarr[$_GET['sort']])) { + $keysort = $_GET['sort']; +} else { + $keysort = $cfg['stats_column_default_sort']; +} +if(isset($_GET['order']) && $_GET['order'] == 'desc') { + $keyorder = 'desc'; +} elseif(isset($_GET['order']) && $_GET['order'] == 'asc') { + $keyorder = 'asc'; +} else { + $keyorder = $cfg['stats_column_default_order']; +} + +if(isset($_GET['admin'])) { + if($_SESSION[$rspathhex.'username'] == $cfg['webinterface_user'] && $_SESSION[$rspathhex.'password'] == $cfg['webinterface_pass'] && $_SESSION[$rspathhex.'clientip'] == getclientip()) { + $adminlogin = 1; + } +} + +if(!isset($_GET["user"])) { + $user_pro_seite = 25; +} elseif($_GET['user'] == "all") { + if($sumentries[0] > 1000) { + $user_pro_seite = 1000; + } else { + $user_pro_seite = $sumentries[0]; + } +} else { + $_GET["user"] = preg_replace('/\D/', '', $_GET["user"]); + if($_GET["user"] > 1000) { + $user_pro_seite = 1000; + } elseif($_GET["user"] > 0) { + $user_pro_seite = $_GET["user"]; + } else { + $user_pro_seite = 25; + } +} ?> @@ -189,12 +320,16 @@
  • diff --git a/webinterface/_preload.php b/webinterface/_preload.php index cf0c623..36e093e 100644 --- a/webinterface/_preload.php +++ b/webinterface/_preload.php @@ -1,89 +1,31 @@ $cfg['logs_debug_level']) return; - $file = $cfg['logs_path'].'ranksystem.log'; - switch ($loglevel) { - case 1: $loglevel = " CRITICAL "; break; - case 2: $loglevel = " ERROR "; break; - case 3: $loglevel = " WARNING "; break; - case 4: $loglevel = " NOTICE "; break; - case 5: $loglevel = " INFO "; break; - case 6: $loglevel = " DEBUG "; break; - default:$loglevel = " NONE "; - } - $loghandle = fopen($file, 'a'); - fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n"); - fclose($loghandle); - if($norotate == false && filesize($file) > ($cfg['logs_rotation_size'] * 1048576)) { - $loghandle = fopen($file, 'a'); - fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n"); - fclose($loghandle); - $file2 = "$file.old"; - if(file_exists($file2)) unlink($file2); - rename($file, $file2); - $loghandle = fopen($file, 'a'); - fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($cfg['logs_timezone']))->format("Y-m-d H:i:s.u ")." NOTICE Rotated logfile...\n"); - fclose($loghandle); - } -} +$prot = start_session($cfg); +$lang = set_language(get_language($cfg)); -function getclientip() { - if (!empty($_SERVER['HTTP_CLIENT_IP'])) - return $_SERVER['HTTP_CLIENT_IP']; - elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) - return $_SERVER['HTTP_X_FORWARDED_FOR']; - elseif(!empty($_SERVER['HTTP_X_FORWARDED'])) - return $_SERVER['HTTP_X_FORWARDED']; - elseif(!empty($_SERVER['HTTP_FORWARDED_FOR'])) - return $_SERVER['HTTP_FORWARDED_FOR']; - elseif(!empty($_SERVER['HTTP_FORWARDED'])) - return $_SERVER['HTTP_FORWARDED']; - elseif(!empty($_SERVER['REMOTE_ADDR'])) - return $_SERVER['REMOTE_ADDR']; - else - return false; -} +error_reporting(E_ALL); +ini_set("log_errors", 1); +set_error_handler("php_error_handling"); +ini_set("error_log", $cfg['logs_path'].'ranksystem.log'); -function error_handling($msg,$type = NULL) { - switch ($type) { - case NULL: echo '
    '; break; - case 1: echo '
    '; break; - case 2: echo '
    '; break; - case 3: echo '
    '; break; - } - echo '',$msg,'
    '; -} +try { + require_once('../other/phpcommand.php'); -if (isset($_POST['logout'])) { - echo "logout"; - rem_session_ts3($rspathhex); - header("Location: $prot://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')); - exit; -} + if (isset($_POST['logout'])) { + echo "logout"; + rem_session_ts3(); + header("Location: $prot://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')); + exit; + } -if (basename($_SERVER['SCRIPT_NAME']) != "index.php" && basename($_SERVER['SCRIPT_NAME']) != "resetpassword.php" && (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $cfg['webinterface_user'] || $_SESSION[$rspathhex.'password'] != $cfg['webinterface_pass'] || $_SESSION[$rspathhex.'clientip'] != getclientip())) { - header("Location: $prot://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')); - exit; -} + if (basename($_SERVER['SCRIPT_NAME']) != "index.php" && basename($_SERVER['SCRIPT_NAME']) != "resetpassword.php" && (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $cfg['webinterface_user'] || $_SESSION[$rspathhex.'password'] != $cfg['webinterface_pass'] || $_SESSION[$rspathhex.'clientip'] != getclientip())) { + rem_session_ts3(); + header("Location: $prot://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')); + exit; + } -$csrf_token = bin2hex(openssl_random_pseudo_bytes(32)); + $csrf_token = bin2hex(openssl_random_pseudo_bytes(32)); +} catch(Throwable $ex) { } ?> \ No newline at end of file diff --git a/webinterface/addon_assign_groups.php b/webinterface/addon_assign_groups.php index c6d2742..35ce4c6 100644 --- a/webinterface/addon_assign_groups.php +++ b/webinterface/addon_assign_groups.php @@ -1,249 +1,253 @@ exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} + if ($mysqlcon->exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} + if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if(($groupslist = $mysqlcon->query("SELECT * FROM `$dbname`.`groups` ORDER BY `sortid`,`sgidname` ASC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} + if(($groupslist = $mysqlcon->query("SELECT * FROM `$dbname`.`groups` ORDER BY `sortid`,`sgidname` ASC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -$assign_groups_active = 0; -if (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']]) && isset($_POST['assign_groups_active']) && !isset($_POST['assign_groups_groupids']) && !isset($_POST['assign_groups_excepted_groupids'])) { - $err_msg = $lang['stag0010']; - $err_lvl = 3; -} elseif (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { - $assign_groups_limit = $_POST['assign_groups_limit']; - $assign_groups_groupids = ''; - if (isset($_POST['assign_groups_groupids']) && $_POST['assign_groups_groupids'] != NULL) { - foreach ($_POST['assign_groups_groupids'] as $group) { - $assign_groups_groupids .= $group.','; + $assign_groups_active = 0; + if (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']]) && isset($_POST['assign_groups_active']) && !isset($_POST['assign_groups_groupids']) && !isset($_POST['assign_groups_excepted_groupids'])) { + $err_msg = $lang['stag0010']; + $err_lvl = 3; + } elseif (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { + $assign_groups_limit = $_POST['assign_groups_limit']; + $assign_groups_groupids = ''; + if (isset($_POST['assign_groups_groupids']) && $_POST['assign_groups_groupids'] != NULL) { + foreach ($_POST['assign_groups_groupids'] as $group) { + $assign_groups_groupids .= $group.','; + } } - } - $assign_groups_groupids = substr($assign_groups_groupids, 0, -1); - if (isset($_POST['assign_groups_excepted_groupids']) && $_POST['assign_groups_excepted_groupids'] != NULL) { - foreach ($_POST['assign_groups_excepted_groupids'] as $group) { - $assign_groups_excepted_groupids .= $group.','; + $assign_groups_groupids = substr($assign_groups_groupids, 0, -1); + if (isset($_POST['assign_groups_excepted_groupids']) && $_POST['assign_groups_excepted_groupids'] != NULL) { + foreach ($_POST['assign_groups_excepted_groupids'] as $group) { + $assign_groups_excepted_groupids .= $group.','; + } + } + $assign_groups_excepted_groupids = substr($assign_groups_excepted_groupids, 0, -1); + if (isset($_POST['assign_groups_active'])) $assign_groups_active = 1; + if ($mysqlcon->exec("UPDATE `$dbname`.`addons_config` SET `value` = CASE `param` WHEN 'assign_groups_active' THEN '{$assign_groups_active}' WHEN 'assign_groups_limit' THEN '{$assign_groups_limit}' WHEN 'assign_groups_groupids' THEN '{$assign_groups_groupids}' WHEN 'assign_groups_excepted_groupids' THEN '{$assign_groups_excepted_groupids}' END WHERE `param` IN ('assign_groups_active','assign_groups_groupids','assign_groups_limit','assign_groups_excepted_groupids')") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } else { + $err_msg = $lang['wisvsuc']; + $err_lvl = NULL; } + $addons_config['assign_groups_groupids']['value'] = $assign_groups_groupids; + $addons_config['assign_groups_excepted_groupids']['value'] = $assign_groups_excepted_groupids; + $addons_config['assign_groups_limit']['value'] = $_POST['assign_groups_limit']; + $addons_config['assign_groups_active']['value'] = $assign_groups_active; + } elseif(isset($_POST['update'])) { + echo '
    ',$lang['errcsrf'],'
    '; + rem_session_ts3(); + exit; } - $assign_groups_excepted_groupids = substr($assign_groups_excepted_groupids, 0, -1); - if (isset($_POST['assign_groups_active'])) $assign_groups_active = 1; - if ($mysqlcon->exec("UPDATE `$dbname`.`addons_config` SET `value` = CASE `param` WHEN 'assign_groups_active' THEN '{$assign_groups_active}' WHEN 'assign_groups_limit' THEN '{$assign_groups_limit}' WHEN 'assign_groups_groupids' THEN '{$assign_groups_groupids}' WHEN 'assign_groups_excepted_groupids' THEN '{$assign_groups_excepted_groupids}' END WHERE `param` IN ('assign_groups_active','assign_groups_groupids','assign_groups_limit','assign_groups_excepted_groupids')") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; - } else { - $err_msg = $lang['wisvsuc']; - $err_lvl = NULL; - } - $addons_config['assign_groups_groupids']['value'] = $assign_groups_groupids; - $addons_config['assign_groups_excepted_groupids']['value'] = $assign_groups_excepted_groupids; - $addons_config['assign_groups_limit']['value'] = $_POST['assign_groups_limit']; - $addons_config['assign_groups_active']['value'] = $assign_groups_active; -} elseif(isset($_POST['update'])) { - echo '
    ',$lang['errcsrf'],'
    '; - rem_session_ts3($rspathhex); - exit; -} -?> -
    - -
    -
    -
    -

    - -

    -
    -
    -
    - -
    + ?> +
    + +
    -
    -
    - -
    +
    +

    + +

    +
    +
    + + +
    +
    +
    +
    + +
    +
    -
    -
    -
    -
    -
    -
    -
    - -
    - '; - } else { - echo ''; - } ?> +
    +
    +
    +
    +
    +
    + +
    + '; + } else { + echo ''; + } ?> +
    -
    -
     
    -
     
    -
    - -
    - + $groupParam) { + if (in_array($groupID, $assign_groups_groupids)) $selected=" selected"; else $selected=""; + if (isset($groupParam['iconid']) && $groupParam['iconid'] != 0) $iconid=$groupParam['iconid']."."; else $iconid="placeholder.png"; + if ($groupParam['type'] == 0 || $groupParam['type'] == 2) $disabled=" disabled"; else $disabled=""; + if ($groupParam['type'] == 0) $grouptype=" [TEMPLATE GROUP]"; else $grouptype=""; + if ($groupParam['type'] == 2) $grouptype=" [QUERY GROUP]"; + if ($groupID != 0) { + echo ''; + } } - } - ?> - + ?> + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
    - -
    - + $groupParam) { + if (in_array($groupID, $assign_groups_excepted_groupids)) $selected=" selected"; else $selected=""; + if (isset($groupParam['iconid']) && $groupParam['iconid'] != 0) $iconid=$groupParam['iconid']."."; else $iconid="placeholder.png"; + if ($groupParam['type'] == 0 || $groupParam['type'] == 2) $disabled=" disabled"; else $disabled=""; + if ($groupParam['type'] == 0) $grouptype=" [TEMPLATE GROUP]"; else $grouptype=""; + if ($groupParam['type'] == 2) $grouptype=" [QUERY GROUP]"; + if ($groupID != 0) { + echo ''; + } } - } - ?> - + ?> + +
    -
    -
     
    -
    -
    - +
     
    +
    +
    + +
    +
     
    -
     
    +
    -
    + - - - - - - - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/webinterface/admin_addtime.php b/webinterface/admin_addtime.php index cc3d21e..293f9a1 100644 --- a/webinterface/admin_addtime.php +++ b/webinterface/admin_addtime.php @@ -1,231 +1,236 @@ exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} +try { + require_once('_nav.php'); -if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} - -if(!isset($_POST['number']) || $_POST['number'] == "yes") { - $_SESSION[$rspathhex.'showexcepted'] = "yes"; - $filter = " WHERE `except`='0'"; -} else { - $_SESSION[$rspathhex.'showexcepted'] = "no"; - $filter = ""; -} + if ($mysqlcon->exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if(($user_arr = $mysqlcon->query("SELECT `uuid`,`cldbid`,`name` FROM `$dbname`.`user` $filter ORDER BY `name` ASC")->fetchAll(PDO::FETCH_ASSOC)) === false) { - $err_msg = "DB Error1: ".print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; -} + if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { - $setontime = 0; - if($_POST['setontime_day']) { $setontime = $setontime + $_POST['setontime_day'] * 86400; } - if($_POST['setontime_hour']) { $setontime = $setontime + $_POST['setontime_hour'] * 3600; } - if($_POST['setontime_min']) { $setontime = $setontime + $_POST['setontime_min'] * 60; } - if($_POST['setontime_sec']) { $setontime = $setontime + $_POST['setontime_sec']; } - if($setontime == 0) { - $err_msg = $lang['errseltime']; $err_lvl = 3; - } elseif($_POST['user'] == NULL) { - $err_msg = $lang['errselusr']; $err_lvl = 3; + if(!isset($_POST['number']) || $_POST['number'] == "yes") { + $_SESSION[$rspathhex.'showexcepted'] = "yes"; + $filter = " WHERE `except`='0'"; } else { - $allinsertdata = ''; - $succmsg = ''; - $nowtime = time(); - foreach($_POST['user'] as $uuid) { - $allinsertdata .= "('".$uuid."', ".$nowtime.", ".$setontime."),"; - $succmsg .= sprintf($lang['sccupcount'],$setontime,$uuid)."
    "; - } - $allinsertdata = substr($allinsertdata, 0, -1); - if($mysqlcon->exec("INSERT INTO `$dbname`.`admin_addtime` (`uuid`,`timestamp`,`timecount`) VALUES $allinsertdata;") === 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) { - $err_msg = $lang['isntwidbmsg'].print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; + $_SESSION[$rspathhex.'showexcepted'] = "no"; + $filter = ""; + } + + if(($user_arr = $mysqlcon->query("SELECT `uuid`,`cldbid`,`name` FROM `$dbname`.`user` $filter ORDER BY `name` ASC")->fetchAll(PDO::FETCH_ASSOC)) === false) { + $err_msg = "DB Error1: ".print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; + } + + if (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { + $setontime = 0; + if($_POST['setontime_day']) { $setontime = $setontime + $_POST['setontime_day'] * 86400; } + if($_POST['setontime_hour']) { $setontime = $setontime + $_POST['setontime_hour'] * 3600; } + if($_POST['setontime_min']) { $setontime = $setontime + $_POST['setontime_min'] * 60; } + if($_POST['setontime_sec']) { $setontime = $setontime + $_POST['setontime_sec']; } + if($setontime == 0) { + $err_msg = $lang['errseltime']; $err_lvl = 3; + } elseif($_POST['user'] == NULL) { + $err_msg = $lang['errselusr']; $err_lvl = 3; } else { - $err_msg = substr($succmsg,0,-4); $err_lvl = NULL; + $allinsertdata = ''; + $succmsg = ''; + $nowtime = time(); + foreach($_POST['user'] as $uuid) { + $allinsertdata .= "('".$uuid."', ".$nowtime.", ".$setontime."),"; + $succmsg .= sprintf($lang['sccupcount'],$setontime,$uuid)."
    "; + } + $allinsertdata = substr($allinsertdata, 0, -1); + if($mysqlcon->exec("INSERT INTO `$dbname`.`admin_addtime` (`uuid`,`timestamp`,`timecount`) VALUES $allinsertdata;") === 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) { + $err_msg = $lang['isntwidbmsg'].print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; + } else { + $err_msg = substr($succmsg,0,-4); $err_lvl = NULL; + } } + } elseif(isset($_POST['update'])) { + echo '
    ',$lang['errcsrf'],'
    '; + rem_session_ts3(); + exit; } -} elseif(isset($_POST['update'])) { - echo '
    ',$lang['errcsrf'],'
    '; - rem_session_ts3($rspathhex); - exit; -} -?> -
    - -
    -
    -
    -

    - -

    -
    -
    -
    - -
    + ?> +
    + +
    -
    -
    - -
    +
    +

    + +

    +
    +
    + + +
    +
    +
    +
    + +
    +
    -
    -
    -
    -
    -
    -
    -
    - -
    - +
    +
    +
    +
    +
    +
    + +
    + +
    -
    -
    - -
    - +
    + +
    + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
     
    -
    -
    - +
     
    +
    +
    + +
    +
     
    -
     
    +
    -
    + + + - - - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/webinterface/admin_remtime.php b/webinterface/admin_remtime.php index cabd743..c0758a9 100644 --- a/webinterface/admin_remtime.php +++ b/webinterface/admin_remtime.php @@ -1,232 +1,237 @@ exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} +try { + require_once('_nav.php'); -if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} - -if(!isset($_POST['number']) || $_POST['number'] == "yes") { - $_SESSION[$rspathhex.'showexcepted'] = "yes"; - $filter = " WHERE `except`='0'"; -} else { - $_SESSION[$rspathhex.'showexcepted'] = "no"; - $filter = ""; -} + if ($mysqlcon->exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if(($user_arr = $mysqlcon->query("SELECT `uuid`,`cldbid`,`name` FROM `$dbname`.`user` $filter ORDER BY `name` ASC")->fetchAll(PDO::FETCH_ASSOC)) === false) { - $err_msg = "DB Error: ".print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; -} + if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { - $setontime = 0; - if($_POST['setontime_day']) { $setontime = $setontime + $_POST['setontime_day'] * 86400; } - if($_POST['setontime_hour']) { $setontime = $setontime + $_POST['setontime_hour'] * 3600; } - if($_POST['setontime_min']) { $setontime = $setontime + $_POST['setontime_min'] * 60; } - if($_POST['setontime_sec']) { $setontime = $setontime + $_POST['setontime_sec']; } - if($setontime == 0) { - $err_msg = $lang['errseltime']; $err_lvl = 3; - } elseif($_POST['user'] == NULL) { - $err_msg = $lang['errselusr']; $err_lvl = 3; + if(!isset($_POST['number']) || $_POST['number'] == "yes") { + $_SESSION[$rspathhex.'showexcepted'] = "yes"; + $filter = " WHERE `except`='0'"; } else { - $allinsertdata = ''; - $succmsg = ''; - $nowtime = time(); - $setontime = $setontime * -1; - foreach($_POST['user'] as $uuid) { - $allinsertdata .= "('".$uuid."', ".$nowtime.", ".$setontime."),"; - $succmsg .= sprintf($lang['sccupcount'],$setontime,$uuid)."
    "; - } - $allinsertdata = substr($allinsertdata, 0, -1); - if($mysqlcon->exec("INSERT INTO `$dbname`.`admin_addtime` (`uuid`,`timestamp`,`timecount`) VALUES $allinsertdata;") === 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) { - $err_msg = $lang['isntwidbmsg'].print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; + $_SESSION[$rspathhex.'showexcepted'] = "no"; + $filter = ""; + } + + if(($user_arr = $mysqlcon->query("SELECT `uuid`,`cldbid`,`name` FROM `$dbname`.`user` $filter ORDER BY `name` ASC")->fetchAll(PDO::FETCH_ASSOC)) === false) { + $err_msg = "DB Error: ".print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; + } + + if (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { + $setontime = 0; + if($_POST['setontime_day']) { $setontime = $setontime + $_POST['setontime_day'] * 86400; } + if($_POST['setontime_hour']) { $setontime = $setontime + $_POST['setontime_hour'] * 3600; } + if($_POST['setontime_min']) { $setontime = $setontime + $_POST['setontime_min'] * 60; } + if($_POST['setontime_sec']) { $setontime = $setontime + $_POST['setontime_sec']; } + if($setontime == 0) { + $err_msg = $lang['errseltime']; $err_lvl = 3; + } elseif($_POST['user'] == NULL) { + $err_msg = $lang['errselusr']; $err_lvl = 3; } else { - $err_msg = substr($succmsg,0,-4); $err_lvl = NULL; + $allinsertdata = ''; + $succmsg = ''; + $nowtime = time(); + $setontime = $setontime * -1; + foreach($_POST['user'] as $uuid) { + $allinsertdata .= "('".$uuid."', ".$nowtime.", ".$setontime."),"; + $succmsg .= sprintf($lang['sccupcount'],$setontime,$uuid)."
    "; + } + $allinsertdata = substr($allinsertdata, 0, -1); + if($mysqlcon->exec("INSERT INTO `$dbname`.`admin_addtime` (`uuid`,`timestamp`,`timecount`) VALUES $allinsertdata;") === 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) { + $err_msg = $lang['isntwidbmsg'].print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; + } else { + $err_msg = substr($succmsg,0,-4); $err_lvl = NULL; + } } + } elseif(isset($_POST['update'])) { + echo '
    ',$lang['errcsrf'],'
    '; + rem_session_ts3(); + exit; } -} elseif(isset($_POST['update'])) { - echo '
    ',$lang['errcsrf'],'
    '; - rem_session_ts3($rspathhex); - exit; -} -?> -
    - -
    -
    -
    -

    - -

    -
    -
    -
    - -
    + ?> +
    + +
    -
    -
    - -
    +
    +

    + +

    +
    +
    + + +
    +
    +
    +
    + +
    +
    -
    -
    -
    -
    -
    -
    -
    - -
    - +
    +
    +
    +
    +
    +
    + +
    + +
    -
    -
    - -
    - +
    + +
    + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
     
    -
    -
    - +
     
    +
    +
    + +
    +
     
    -
     
    +
    -
    + + + - - - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/webinterface/api.php b/webinterface/api.php index b6d0d0e..fc8c88f 100644 --- a/webinterface/api.php +++ b/webinterface/api.php @@ -1,234 +1,243 @@ exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} +try { + require_once('_nav.php'); -if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} - -if (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { - $stats_api_keys = $err_msg = ""; - - if (isset($_POST['apikey']) && isset($_POST['desc'])) { - $apidefinition = []; - foreach($_POST['apikey'] as $rowid => $apikey) { - $desc = isset($_POST["desc"][$rowid]) ? $_POST["desc"][$rowid] : null; - $apidefinition[] = "$apikey=>$desc"; - } - - $stats_api_keys = implode(",", $apidefinition); - - $cfg['stats_api_keys'] = $stats_api_keys; + if ($mysqlcon->exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; } - if ($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('stats_api_keys','{$cfg['stats_api_keys']}') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`); DELETE FROM `$dbname`.`csrf_token` WHERE `token`='{$_POST['csrf_token']}'") === false) { + if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { $err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; - } else { - $err_msg = $lang['wisvsuc']; - $err_lvl = NULL; } - if(empty($stats_api_keys)) { - $cfg['stats_api_keys'] = NULL; - } else { - $keyarr = explode(',', $stats_api_keys); - foreach ($keyarr as $entry) { - list($key, $value) = explode('=>', $entry); - $addnewvalue[$key] = $value; - $cfg['stats_api_keys'] = $addnewvalue; + if (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { + $stats_api_keys = $err_msg = ""; + + if (isset($_POST['apikey']) && isset($_POST['desc'])) { + $apidefinition = []; + foreach($_POST['apikey'] as $rowid => $apikey) { + $desc = isset($_POST["desc"][$rowid]) ? $_POST["desc"][$rowid] : null; + $apidefinition[] = "$apikey=>$desc"; + } + + $stats_api_keys = implode(",", $apidefinition); + + $cfg['stats_api_keys'] = $stats_api_keys; + } else { + $cfg['stats_api_keys'] = NULL; } + + if ($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('stats_api_keys','{$cfg['stats_api_keys']}') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`); DELETE FROM `$dbname`.`csrf_token` WHERE `token`='{$_POST['csrf_token']}'") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } else { + $err_msg = $lang['wisvsuc']; + $err_lvl = NULL; + } + + if(empty($stats_api_keys)) { + $cfg['stats_api_keys'] = NULL; + } else { + $keyarr = explode(',', $stats_api_keys); + foreach ($keyarr as $entry) { + list($key, $value) = explode('=>', $entry); + $addnewvalue[$key] = $value; + $cfg['stats_api_keys'] = $addnewvalue; + } + } + } elseif(isset($_POST['update'])) { + echo '
    ',$lang['errcsrf'],'
    '; + rem_session_ts3(); + exit; } -} elseif(isset($_POST['update'])) { - echo '
    ',$lang['errcsrf'],'
    '; - rem_session_ts3($rspathhex); - exit; -} -?> -
    - -
    - -
    -
    -
    -

    - -

    + ?> +
    + +
    + + +
    +
    +

    + +

    +
    -
    - -
    -
    -
    - -
    -
     
    -
     
    -
    -
    - -
    -
    - -
    -
    -
    - -
    - - - - \ No newline at end of file + $(document).on("click", ".delete", function(){ + $(this).parent().remove(); + }); + function openurl(url) { + window.open(url,'_blank'); + } + function copyurl(url) { + navigator.clipboard.writeText(url).then(function() { }); + } + + + + \ No newline at end of file diff --git a/webinterface/boost.php b/webinterface/boost.php index 0bcd138..d516ef9 100644 --- a/webinterface/boost.php +++ b/webinterface/boost.php @@ -1,409 +1,414 @@ exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} +try { + require_once('_nav.php'); -if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} + if ($mysqlcon->exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if(($groupslist = $mysqlcon->query("SELECT * FROM `$dbname`.`groups` ORDER BY `sortid`,`sgidname` ASC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} + if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if(!isset($groupslist) || $groupslist == NULL) { - $err_msg = 'No servergroups found inside the Ranksystem cache!

    Please connect the Ranksystem Bot to the TS server. The Ranksystem will download the servergroups when it is connected to the server.
    Give it a few minutes and reload this page. The dropdown field should contain your groups after.'; - $err_lvl = 1; -} + if(($groupslist = $mysqlcon->query("SELECT * FROM `$dbname`.`groups` ORDER BY `sortid`,`sgidname` ASC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if (isset($_POST['update_old']) && isset($db_csrf[$_POST['csrf_token']])) { - if(empty($_POST['rankup_boost_definition'])) { - $grouparr_old = null; - } else { - foreach (explode(',', $_POST['rankup_boost_definition']) as $entry) { - list($key, $value1, $value2) = explode('=>', $entry); - $grouparr_old[$key] = array("group"=>$key,"factor"=>$value1,"time"=>$value2); - $cfg['rankup_boost_definition'] = $grouparr_old; - } + if(!isset($groupslist) || $groupslist == NULL) { + $err_msg = 'No servergroups found inside the Ranksystem cache!

    Please connect the Ranksystem Bot to the TS server. The Ranksystem will download the servergroups when it is connected to the server.
    Give it a few minutes and reload this page. The dropdown field should contain your groups after.'; + $err_lvl = 1; } - - if(isset($cfg['rankup_boost_definition']) && $cfg['rankup_boost_definition'] != NULL) { - foreach($cfg['rankup_boost_definition'] as $groupid => $value) { - if(!isset($groupslist[$groupid]) && $groupid != NULL) { - $err_msg .= sprintf($lang['upgrp0001'], $groupid, $lang['wiboost']).'
    '; - $err_lvl = 3; - $errcnf++; + + if (isset($_POST['update_old']) && isset($db_csrf[$_POST['csrf_token']])) { + if(empty($_POST['rankup_boost_definition'])) { + $grouparr_old = null; + } else { + foreach (explode(',', $_POST['rankup_boost_definition']) as $entry) { + list($key, $value1, $value2) = explode('=>', $entry); + $grouparr_old[$key] = array("group"=>$key,"factor"=>$value1,"time"=>$value2); + $cfg['rankup_boost_definition'] = $grouparr_old; } } - } - - $cfg['rankup_boost_definition'] = $_POST['rankup_boost_definition']; + + if(isset($cfg['rankup_boost_definition']) && $cfg['rankup_boost_definition'] != NULL) { + foreach($cfg['rankup_boost_definition'] as $groupid => $value) { + if(!isset($groupslist[$groupid]) && $groupid != NULL) { + $err_msg .= sprintf($lang['upgrp0001'], $groupid, $lang['wiboost']).'
    '; + $err_lvl = 3; + $errcnf++; + } + } + } + + $cfg['rankup_boost_definition'] = $_POST['rankup_boost_definition']; - if($errcnf == 0) { - if ($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('rankup_boost_definition','{$cfg['rankup_boost_definition']}') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`); DELETE FROM `$dbname`.`csrf_token` WHERE `token`='{$_POST['csrf_token']}'") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; + if($errcnf == 0) { + if ($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('rankup_boost_definition','{$cfg['rankup_boost_definition']}') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`); DELETE FROM `$dbname`.`csrf_token` WHERE `token`='{$_POST['csrf_token']}'") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } else { + $err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], '  
    '); + $err_lvl = NULL; + } } else { - $err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], '  
    '); - $err_lvl = NULL; + $err_msg .= "
    ".$lang['errgrpid']; } - } else { - $err_msg .= "
    ".$lang['errgrpid']; - } - - if(empty($_POST['rankup_boost_definition'])) { - $cfg['rankup_boost_definition'] = NULL; - } else { - foreach (explode(',', $_POST['rankup_boost_definition']) as $entry) { - list($key, $value1, $value2) = explode('=>', $entry); - $addnewvalue2[$key] = array("group"=>$key,"factor"=>$value1,"time"=>$value2); - $cfg['rankup_boost_definition'] = $addnewvalue2; + + if(empty($_POST['rankup_boost_definition'])) { + $cfg['rankup_boost_definition'] = NULL; + } else { + foreach (explode(',', $_POST['rankup_boost_definition']) as $entry) { + list($key, $value1, $value2) = explode('=>', $entry); + $addnewvalue2[$key] = array("group"=>$key,"factor"=>$value1,"time"=>$value2); + $cfg['rankup_boost_definition'] = $addnewvalue2; + } } - } -} elseif (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { - $rankup_boost_definition = $err_msg = ""; - $errcnf = 0; + } elseif (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { + $rankup_boost_definition = $err_msg = ""; + $errcnf = 0; - if (isset($_POST['boostduration']) && !isset($_POST['boostgroup']) && isset($_POST['boostfactor'])) { - $errcnf++; - $err_msg = "Missing servergroup in your defintion!
    "; - $err_lvl = 3; - $cfg['rankup_boost_definition'] = null; - } elseif (isset($_POST['boostduration']) && isset($_POST['boostgroup']) && isset($_POST['boostfactor'])) { - $boostdefinition = []; - foreach($_POST['boostgroup'] as $rowid => $groupid) { - $factor = isset($_POST["boostfactor"][$rowid]) ? floatval($_POST["boostfactor"][$rowid]) : 1; - $duration = isset($_POST["boostduration"][$rowid]) ? intval($_POST["boostduration"][$rowid]) : 1; - $boostdefinition[] = "$groupid=>$factor=>$duration"; - } + if (isset($_POST['boostduration']) && !isset($_POST['boostgroup']) && isset($_POST['boostfactor'])) { + $errcnf++; + $err_msg = "Missing servergroup in your defintion!
    "; + $err_lvl = 3; + $cfg['rankup_boost_definition'] = null; + } elseif (isset($_POST['boostduration']) && isset($_POST['boostgroup']) && isset($_POST['boostfactor'])) { + $boostdefinition = []; + foreach($_POST['boostgroup'] as $rowid => $groupid) { + $factor = isset($_POST["boostfactor"][$rowid]) ? floatval($_POST["boostfactor"][$rowid]) : 1; + $duration = isset($_POST["boostduration"][$rowid]) ? intval($_POST["boostduration"][$rowid]) : 1; + $boostdefinition[] = "$groupid=>$factor=>$duration"; + } - $rankup_boost_definition = implode(",", $boostdefinition); + $rankup_boost_definition = implode(",", $boostdefinition); - $grouparr = []; - foreach(explode(',', $rankup_boost_definition) as $entry) { - list($groupid, $factor, $duration) = explode('=>', $entry); - $grouparr[$groupid] = $factor; - } + $grouparr = []; + foreach(explode(',', $rankup_boost_definition) as $entry) { + list($groupid, $factor, $duration) = explode('=>', $entry); + $grouparr[$groupid] = $factor; + } - if(isset($groupslist) && $groupslist != NULL) { - foreach($grouparr as $groupid => $time) { - if((!isset($groupslist[$groupid]) && $groupid != NULL) || $groupid == 0) { - $err_msg .= sprintf($lang['upgrp0001'], $groupid, $lang['wigrptime']).'
    '; - $err_lvl = 3; - $errcnf++; + if(isset($groupslist) && $groupslist != NULL) { + foreach($grouparr as $groupid => $time) { + if((!isset($groupslist[$groupid]) && $groupid != NULL) || $groupid == 0) { + $err_msg .= sprintf($lang['upgrp0001'], $groupid, $lang['wigrptime']).'
    '; + $err_lvl = 3; + $errcnf++; + } } } - } - $cfg['rankup_boost_definition'] = $rankup_boost_definition; - } else { - $cfg['rankup_boost_definition'] = null; - if ($mysqlcon->exec("UPDATE `$dbname`.`user` SET `boosttime`=0;") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; + $cfg['rankup_boost_definition'] = $rankup_boost_definition; + } else { + $cfg['rankup_boost_definition'] = null; + if ($mysqlcon->exec("UPDATE `$dbname`.`user` SET `boosttime`=0;") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } } - } - if($errcnf == 0) { - if ($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('rankup_boost_definition','{$cfg['rankup_boost_definition']}') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`); DELETE FROM `$dbname`.`csrf_token` WHERE `token`='{$_POST['csrf_token']}'") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; + if($errcnf == 0) { + if ($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('rankup_boost_definition','{$cfg['rankup_boost_definition']}') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`); DELETE FROM `$dbname`.`csrf_token` WHERE `token`='{$_POST['csrf_token']}'") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } else { + $err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], '  
    '); + $err_lvl = NULL; + } } else { - $err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], '  
    '); - $err_lvl = NULL; + $err_msg .= "
    ".$lang['errgrpid']; } - } else { - $err_msg .= "
    ".$lang['errgrpid']; - } - if(empty($rankup_boost_definition)) { - $cfg['rankup_boost_definition'] = NULL; - } else { - $boostexp = explode(',', $rankup_boost_definition); - foreach ($boostexp as $entry) { - list($key, $value1, $value2) = explode('=>', $entry); - $addnewvalue2[$key] = array("group"=>$key,"factor"=>$value1,"time"=>$value2); - $cfg['rankup_boost_definition'] = $addnewvalue2; + if(empty($rankup_boost_definition)) { + $cfg['rankup_boost_definition'] = NULL; + } else { + $boostexp = explode(',', $rankup_boost_definition); + foreach ($boostexp as $entry) { + list($key, $value1, $value2) = explode('=>', $entry); + $addnewvalue2[$key] = array("group"=>$key,"factor"=>$value1,"time"=>$value2); + $cfg['rankup_boost_definition'] = $addnewvalue2; + } } - } -} elseif(isset($_POST['update']) || isset($_POST['update_old'])) { - echo '
    ',$lang['errcsrf'],'
    '; - rem_session_ts3($rspathhex); - exit; -} -?> -
    - -
    - -
    -
    -
    -

    - -
    - -
    -

    -
    -
    - -
    -
    -
    - -
    -
     
    -
     
    -
    -
    - -
    -
    - -
    -
    - -
    -
    + } elseif(isset($_POST['update']) || isset($_POST['update_old'])) { + echo '
    ',$lang['errcsrf'],'
    '; + rem_session_ts3(); + exit; + } + ?> +
    + +
    + + +
    +
    +

    + +
    +
    -

    +
    +
    + +
    +
    +
    + +
    +
     
    +
     
    +
    +
    + +
    +
    + +
    +
    + +
    +
    -
    -
    -
    - -
    + -
    + if(isset($cfg['rankup_boost_definition'])) { + foreach($cfg['rankup_boost_definition'] as $boost) { + ?> +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    ',$lang['wiboostempty'],'
    '; - } else { - echo '
    '; - }?> -
    - - - + } + } + ?> +
    +
    ',$lang['wiboostempty'],'
    '; + } else { + echo '
    '; + }?> +
    + + + +
    +
    -
    -
    -
     
    -
    -
    - +
     
    +
    +
    + +
    -
    -
     
    - - -
    -
    - - - - - \ No newline at end of file + $(".boostduration").TouchSpin({ + min: 1, + max: 999999999, + verticalbuttons: true, + prefix: 'Sec.:' + }); + $(".boostfactor").TouchSpin({ + min: 0, + max: 999999999, + decimals: 9, + step: 0.000000001, + verticalbuttons: true, + prefix: ':' + }); + function addboostgroup() { + var $clone = $("div[name='template']").last().clone(); + $clone.removeClass("hidden"); + $clone.attr('name','boostgroup'); + $clone.insertBefore("#addboostgroup"); + $clone.find('.bootstrap-select').replaceWith(function() { return $('select', this); }); + $clone.find('select').selectpicker('val', ''); + $("select[name='tempboostgroup[]']").last().attr('name', 'boostgroup[]'); + $("input[name='tempboostfactor[]']").last().attr('name', 'boostfactor[]'); + $("input[name='tempboostduration[]']").last().attr('name', 'boostduration[]'); + $('.delete').removeClass("hidden"); + if (document.contains(document.getElementById("noentry"))) { + document.getElementById("noentry").remove(); + } + $clone.find('.bootstrap-touchspin').replaceWith(function() { return $('input', this); });; + $clone.find('.boostfactor').TouchSpin({min: 0,max: 999999999,decimals: 9,step: 0.000000001,verticalbuttons: true,prefix: ':'}); + $clone.find('.boostduration').TouchSpin({min: 1,max: 999999999,verticalbuttons: true,prefix: 'Sec.:'}); + }; + $(document).on("click", ".delete", function(){ + $(this).parent().remove(); + }); + $('#switchexpert1').on('switchChange.bootstrapSwitch', function() { + document.getElementById("new").classList.add("hidden"); + document.getElementById("old").classList.remove("hidden"); + $('#switchexpert2').bootstrapSwitch('state', true, false); + }); + $('#switchexpert2').on('switchChange.bootstrapSwitch', function() { + document.getElementById("new").classList.remove("hidden"); + document.getElementById("old").classList.add("hidden"); + $('#switchexpert1').bootstrapSwitch('state', false, false); + }); + + + + \ No newline at end of file diff --git a/webinterface/bot.php b/webinterface/bot.php index 04b4010..2c10188 100644 --- a/webinterface/bot.php +++ b/webinterface/bot.php @@ -1,342 +1,299 @@ $number_lines) { - break; - } - continue; - } - foreach($filters as $filter) { - if(($filter != NULL && strstr($line, $filter) && $filter2 == NULL) || ($filter2 != NULL && strstr($line, $filter2) && $filter != NULL && strstr($line, $filter))) { - if($filter == "CRITICAL" || $filter == "ERROR") { - array_push($lines, ''.$line.''); - } else { - array_push($lines, $line); - } - $lastfilter = $filter; - if (count($lines)>$number_lines) { - break 2; - } - break; - } elseif($inactivefilter != NULL) { - foreach($inactivefilter as $defilter) { - if($defilter != NULL && strstr($line, $defilter)) { - $lastfilter = $defilter; - } - } - } - } - } - } else { - $lines[] = "No log entry found...\n"; - $lines[] = "The logfile will be created with next startup.\n"; + $_SESSION[$rspathhex.'number_lines'] = $number_lines; + } elseif (isset($_SESSION[$rspathhex.'number_lines'])) { + $number_lines = $_SESSION[$rspathhex.'number_lines']; } - return $lines; -} -$number_lines = 20; -if (isset($_POST['number'])) { - if($_POST['number'] == 20) { - $number_lines = 20; - } elseif($_POST['number'] == 50) { - $number_lines = 50; - } elseif($_POST['number'] == 100) { - $number_lines = 100; - } elseif($_POST['number'] == 200) { - $number_lines = 200; - } elseif($_POST['number'] == 500) { - $number_lines = 500; - } elseif($_POST['number'] == 2000) { - $number_lines = 2000; - } elseif($_POST['number'] == 9999) { - $number_lines = 9999; + if(isset($_SESSION[$rspathhex.'logfilter2'])) { + $filter2 = $_SESSION[$rspathhex.'logfilter2']; } else { - $number_lines = 20; + $filter2 = ''; + } + $filters = ''; + $inactivefilter = ''; + if(isset($_POST['logfilter']) && in_array('critical', $_POST['logfilter'])) { + $filters .= "CRITICAL,"; + } elseif(isset($_POST['logfilter'])) { + $inactivefilter .= "CRITICAL,"; + } + if(isset($_POST['logfilter']) && in_array('error', $_POST['logfilter'])) { + $filters .= "ERROR,"; + } elseif(isset($_POST['logfilter'])) { + $inactivefilter .= "ERROR,"; + } + if(isset($_POST['logfilter']) && in_array('warning', $_POST['logfilter'])) { + $filters .= "WARNING,"; + } elseif(isset($_POST['logfilter'])) { + $inactivefilter .= "WARNING,"; + } + if(isset($_POST['logfilter']) && in_array('notice', $_POST['logfilter'])) { + $filters .= "NOTICE,"; + } elseif(isset($_POST['logfilter'])) { + $inactivefilter .= "NOTICE,"; + } + if(isset($_POST['logfilter']) && in_array('info', $_POST['logfilter'])) { + $filters .= "INFO,"; + } elseif(isset($_POST['logfilter'])) { + $inactivefilter .= "INFO,"; + } + if(isset($_POST['logfilter']) && in_array('debug', $_POST['logfilter'])) { + $filters .= "DEBUG,"; + } elseif(isset($_POST['logfilter'])) { + $inactivefilter .= "DEBUG,"; + } + if(isset($_POST['logfilter'][0])) { + $filter2 = htmlspecialchars($_POST['logfilter'][0]); + $_SESSION[$rspathhex.'logfilter2'] = $filter2; } - $_SESSION[$rspathhex.'number_lines'] = $number_lines; -} elseif (isset($_SESSION[$rspathhex.'number_lines'])) { - $number_lines = $_SESSION[$rspathhex.'number_lines']; -} - -if(isset($_SESSION[$rspathhex.'logfilter2'])) { - $filter2 = $_SESSION[$rspathhex.'logfilter2']; -} else { - $filter2 = ''; -} -$filters = ''; -$inactivefilter = ''; -if(isset($_POST['logfilter']) && in_array('critical', $_POST['logfilter'])) { - $filters .= "CRITICAL,"; -} elseif(isset($_POST['logfilter'])) { - $inactivefilter .= "CRITICAL,"; -} -if(isset($_POST['logfilter']) && in_array('error', $_POST['logfilter'])) { - $filters .= "ERROR,"; -} elseif(isset($_POST['logfilter'])) { - $inactivefilter .= "ERROR,"; -} -if(isset($_POST['logfilter']) && in_array('warning', $_POST['logfilter'])) { - $filters .= "WARNING,"; -} elseif(isset($_POST['logfilter'])) { - $inactivefilter .= "WARNING,"; -} -if(isset($_POST['logfilter']) && in_array('notice', $_POST['logfilter'])) { - $filters .= "NOTICE,"; -} elseif(isset($_POST['logfilter'])) { - $inactivefilter .= "NOTICE,"; -} -if(isset($_POST['logfilter']) && in_array('info', $_POST['logfilter'])) { - $filters .= "INFO,"; -} elseif(isset($_POST['logfilter'])) { - $inactivefilter .= "INFO,"; -} -if(isset($_POST['logfilter']) && in_array('debug', $_POST['logfilter'])) { - $filters .= "DEBUG,"; -} elseif(isset($_POST['logfilter'])) { - $inactivefilter .= "DEBUG,"; -} -if(isset($_POST['logfilter'][0])) { - $filter2 = htmlspecialchars($_POST['logfilter'][0]); - $_SESSION[$rspathhex.'logfilter2'] = $filter2; -} -if($filters != '') { - $_SESSION[$rspathhex.'logfilter'] = $filters; -} + if($filters != '') { + $_SESSION[$rspathhex.'logfilter'] = $filters; + } -if($inactivefilter != '') { - $_SESSION[$rspathhex.'inactivefilter'] = $inactivefilter; -} -if(isset($_SESSION[$rspathhex.'inactivefilter']) && $_SESSION[$rspathhex.'inactivefilter'] != NULL) { - $inactivefilter = explode(',', $_SESSION[$rspathhex.'inactivefilter']); -} + if($inactivefilter != '') { + $_SESSION[$rspathhex.'inactivefilter'] = $inactivefilter; + } + if(isset($_SESSION[$rspathhex.'inactivefilter']) && $_SESSION[$rspathhex.'inactivefilter'] != NULL) { + $inactivefilter = explode(',', $_SESSION[$rspathhex.'inactivefilter']); + } -if (!isset($_SESSION[$rspathhex.'logfilter'])) { - $_SESSION[$rspathhex.'logfilter'] = "CRITICAL,ERROR,WARNING,NOTICE,INFO,DEBUG,"; -} + if (!isset($_SESSION[$rspathhex.'logfilter'])) { + $_SESSION[$rspathhex.'logfilter'] = "CRITICAL,ERROR,WARNING,NOTICE,INFO,DEBUG,"; + } -$filters = explode(',', ($_SESSION[$rspathhex.'logfilter'].'NONE')); + $filters = explode(',', ($_SESSION[$rspathhex.'logfilter'].'NONE')); -require_once('_nav.php'); + require_once('_nav.php'); -if ($mysqlcon->exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} + if ($mysqlcon->exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} + if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if ((isset($_POST['start']) || isset($_POST['stop']) || isset($_POST['restart']) || isset($_POST['logfilter'])) && !isset($db_csrf[$_POST['csrf_token']])) { - echo '
    ',$lang['errcsrf'],'
    '; - rem_session_ts3($rspathhex); - exit; -} + if ((isset($_POST['start']) || isset($_POST['stop']) || isset($_POST['restart']) || isset($_POST['logfilter'])) && !isset($db_csrf[$_POST['csrf_token']])) { + echo '
    ',$lang['errcsrf'],'
    '; + rem_session_ts3(); + exit; + } -$logoutput = getlog($cfg,$number_lines,$filters,$filter2,$inactivefilter); + $logoutput = getlog($cfg,$number_lines,$filters,$filter2,$inactivefilter); -if (isset($_POST['start']) && isset($db_csrf[$_POST['csrf_token']])) { - if(!is_writable($cfg['logs_path'])) { - $err_msg = "!!!! Logs folder is not writable !!!!
    Cancel start request!"; $err_lvl = 3; - } else { - $output = ''; - exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start", $resultexec); - if (file_exists($cfg['logs_path']."autostart_deactivated")) { - unlink($cfg['logs_path']."autostart_deactivated"); + if (isset($_POST['start']) && isset($db_csrf[$_POST['csrf_token']])) { + if(!is_writable($cfg['logs_path'])) { + $err_msg = "!!!! Logs folder is not writable !!!!
    Cancel start request!"; $err_lvl = 3; + } else { + $output = ''; + exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start", $resultexec); + if (file_exists($cfg['logs_path']."autostart_deactivated")) { + unlink($cfg['logs_path']."autostart_deactivated"); + } + foreach($resultexec as $line) $output .= print_r($line, true).'
    '; + $err_msg = $lang['wibot2'].'

    Result of worker.php:
    '.$output.'
    '; + $err_lvl = 1; + usleep(80000); + $logoutput = getlog($cfg,$number_lines,$filters,$filter2,$inactivefilter); } - foreach($resultexec as $line) $output .= print_r($line, true).'
    '; - $err_msg = $lang['wibot2'].'

    Result of worker.php:
    '.$output.'
    '; - $err_lvl = 1; - usleep(80000); - $logoutput = getlog($cfg,$number_lines,$filters,$filter2,$inactivefilter); } -} -if (isset($_POST['stop']) && isset($db_csrf[$_POST['csrf_token']])) { - if(!is_writable($cfg['logs_path'])) { - $err_msg = "!!!! Logs folder is not writable !!!!
    Cancel start request!"; $err_lvl = 3; - } else { - $output = ''; - exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php stop", $resultexec); - file_put_contents(substr(__DIR__,0,-12)."logs/autostart_deactivated",""); - foreach($resultexec as $line) $output .= print_r($line, true).'
    '; - $err_msg = $lang['wibot1'].'

    Result of worker.php:
    '.$output.'
    ';; - $err_lvl = 1; - usleep(80000); - $logoutput = getlog($cfg,$number_lines,$filters,$filter2,$inactivefilter); + if (isset($_POST['stop']) && isset($db_csrf[$_POST['csrf_token']])) { + if(!is_writable($cfg['logs_path'])) { + $err_msg = "!!!! Logs folder is not writable !!!!
    Cancel stop request!"; $err_lvl = 3; + } else { + $output = ''; + exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php stop", $resultexec); + file_put_contents($cfg['logs_path']."autostart_deactivated",""); + foreach($resultexec as $line) $output .= print_r($line, true).'
    '; + $err_msg = $lang['wibot1'].'

    Result of worker.php:
    '.$output.'
    ';; + $err_lvl = 1; + usleep(80000); + $logoutput = getlog($cfg,$number_lines,$filters,$filter2,$inactivefilter); + } } -} -if (isset($_POST['restart']) && isset($db_csrf[$_POST['csrf_token']])) { - if(!is_writable($cfg['logs_path'])) { - $err_msg = "!!!! Logs folder is not writable !!!!
    Cancel restart request!"; $err_lvl = 3; - } else { - $output = ''; - exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php restart", $resultexec); - if (file_exists($cfg['logs_path']."autostart_deactivated")) { - unlink($cfg['logs_path']."autostart_deactivated"); + if (isset($_POST['restart']) && isset($db_csrf[$_POST['csrf_token']])) { + if(!is_writable($cfg['logs_path'])) { + $err_msg = "!!!! Logs folder is not writable !!!!
    Cancel restart request!"; $err_lvl = 3; + } else { + $output = ''; + exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php restart", $resultexec); + if (file_exists($cfg['logs_path']."autostart_deactivated")) { + unlink($cfg['logs_path']."autostart_deactivated"); + } + foreach($resultexec as $line) $output .= print_r($line, true).'
    '; + $err_msg = $lang['wibot3'].'

    Result of worker.php:
    '.$output.'
    '; + $err_lvl = 1; + usleep(80000); + $logoutput = getlog($cfg,$number_lines,$filters,$filter2,$inactivefilter); } - foreach($resultexec as $line) $output .= print_r($line, true).'
    '; - $err_msg = $lang['wibot3'].'

    Result of worker.php:
    '.$output.'
    '; - $err_lvl = 1; - usleep(80000); - $logoutput = getlog($cfg,$number_lines,$filters,$filter2,$inactivefilter); } -} -$disabled = ''; -if($cfg['teamspeak_host_address'] == NULL || $cfg['teamspeak_query_port'] == NULL || $cfg['teamspeak_voice_port'] == NULL || $cfg['teamspeak_query_user'] == NULL || $cfg['teamspeak_query_pass'] == NULL || $cfg['teamspeak_query_nickname'] == NULL || $cfg['rankup_definition'] == NULL || $cfg['logs_path'] == NULL) { - $disabled = 1; - $err_msg = $lang['wibot9']; - $err_lvl = 2; -} -?> -
    - -
    -
    -
    -

    - -

    -
    -
    -
    - -
     
    + $disabled = ''; + if($cfg['teamspeak_host_address'] == NULL || $cfg['teamspeak_query_port'] == NULL || $cfg['teamspeak_voice_port'] == NULL || $cfg['teamspeak_query_user'] == NULL || $cfg['teamspeak_query_pass'] == NULL || $cfg['teamspeak_query_nickname'] == NULL || $cfg['rankup_definition'] == NULL || $cfg['logs_path'] == NULL) { + $disabled = 1; + $err_msg = $lang['wibot9']; + $err_lvl = 2; + } + ?> +
    + +
    -
    - +
    +

    + +

    -
     
    - -
    - -
     
    -
    -
    - + + +
     
    +
    +
    + +
    -
    -
     
    - -
    - +
     
    +
    +
    + +
     
    +
    +
    + +
    +
    +
     
    +
    +
    + +
     
    +
    +
    + +
    +
    +
     
    +
     
    -
    - +
    +

    + +

    -
    -
     
    - -
     
    -
    -
    -

    - -

    -
    -
    - -
    -
    - - - - - + + +
    +
    + + + + + +
    -
    -
    -
    - +
    +
    + +
    -
    -
    -
    - +
    +
    + +
    -
    -
    -
    - +
    +
    + +
    -
    -
    -
    - +
    +
    + +
    -
    -
    -
    - +
    +
    + +
    -
    -
    -
    - +
    +
    + +
    -
    -
    -
    - +
    +
    + +
    +
    - -
    -
    -
    -
    +
    +
    +
    +
    -
    - - \ No newline at end of file + + + \ No newline at end of file diff --git a/webinterface/changepassword.php b/webinterface/changepassword.php index 9ae61c1..a44462f 100644 --- a/webinterface/changepassword.php +++ b/webinterface/changepassword.php @@ -1,74 +1,77 @@ exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} +try { + require_once('_nav.php'); -if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); - $err_lvl = 3; -} + if ($mysqlcon->exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } + + if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); + $err_lvl = 3; + } -if (isset($_POST['changepw']) && isset($db_csrf[$_POST['csrf_token']])) { - if (!password_verify($_POST['oldpwd'], $cfg['webinterface_pass'])) { - $err_msg = $lang['wichpw1']; $err_lvl = 3; - } else { - $cfg['webinterface_pass'] = password_hash($_POST['newpwd1'], PASSWORD_DEFAULT); - if ($_POST['newpwd1'] != $_POST['newpwd2'] || $_POST['newpwd1'] == NULL) { - $err_msg = $lang['wichpw2']; $err_lvl = 3; - } elseif($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('webinterface_pass','{$cfg['webinterface_pass']}') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`)") === false) { - $err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; + if (isset($_POST['changepw']) && isset($db_csrf[$_POST['csrf_token']])) { + if (!password_verify($_POST['oldpwd'], $cfg['webinterface_pass'])) { + $err_msg = $lang['wichpw1']; $err_lvl = 3; } else { - enter_logfile($cfg,3,sprintf($lang['wichpw3'],getclientip())); - $err_msg = $lang['wisvsuc']; $err_lvl = NULL; + $cfg['webinterface_pass'] = password_hash($_POST['newpwd1'], PASSWORD_DEFAULT); + if ($_POST['newpwd1'] != $_POST['newpwd2'] || $_POST['newpwd1'] == NULL) { + $err_msg = $lang['wichpw2']; $err_lvl = 3; + } elseif($mysqlcon->exec("INSERT INTO `$dbname`.`cfg_params` (`param`,`value`) VALUES ('webinterface_pass','{$cfg['webinterface_pass']}') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`)") === false) { + $err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; + } else { + enter_logfile($cfg,3,sprintf($lang['wichpw3'],getclientip())); + $err_msg = $lang['wisvsuc']; $err_lvl = NULL; + } } + } elseif(isset($_POST['changepw'])) { + echo '
    ',$lang['errcsrf'],'
    '; + rem_session_ts3(); + exit; } -} elseif(isset($_POST['changepw'])) { - echo '
    ',$lang['errcsrf'],'
    '; - rem_session_ts3($rspathhex); - exit; -} -?> -
    - -
    -