From f7d7aedc5a45eaf913a70c84e51cede96b5d9abc Mon Sep 17 00:00:00 2001 From: Newcomer1989 Date: Wed, 1 Feb 2023 20:44:58 +0100 Subject: [PATCH] release 1.3.22 --- api/index.php | 96 ++- install.php | 368 +++++++++- jobs/addon_assign_groups.php | 8 +- jobs/addon_channelinfo_toplist.php | 18 +- jobs/bot.php | 258 +++---- jobs/calc_serverstats.php | 82 ++- jobs/calc_user.php | 48 +- jobs/calc_user_snapshot.php | 6 +- jobs/calc_userstats.php | 63 +- jobs/check_db.php | 214 +++--- jobs/clean.php | 42 +- jobs/db_ex_imp.php | 42 +- jobs/event_userenter.php | 18 +- jobs/get_avatars.php | 22 +- jobs/handle_messages.php | 83 ++- jobs/reset_rs.php | 157 ++-- jobs/server_usage.php | 8 +- jobs/update_channel.php | 12 +- jobs/update_groups.php | 52 +- jobs/update_rs.php | 124 ++-- languages/core_ar_العربية_arab.php | 22 +- languages/core_az_Azərbaycan_az.php | 22 +- languages/core_cz_Čeština_cz.php | 16 +- languages/core_de_Deutsch_de.php | 14 +- languages/core_en_english_gb.php | 10 + languages/core_es_español_es.php | 23 +- languages/core_fr_français_fr.php | 22 +- languages/core_hu_Hungary_hu.php | 22 +- languages/core_it_Italiano_it.php | 22 +- languages/core_nl_Nederlands_nl.php | 22 +- languages/core_pl_polski_pl.php | 10 + languages/core_pt_Português_pt.php | 22 +- languages/core_ro_Română_ro.php | 22 +- languages/core_ru_Pусский_ru.php | 22 +- libs/combined_st.css | 3 +- libs/combined_wi.css | 19 +- libs/combined_wi.js | 4 +- libs/statsindex.js | 2 +- other/_functions.php | 607 ++++++++++++++-- other/config.php | 46 +- other/phpcommand.php | 2 +- other/session_handling.php | 10 + stats/_footer.php | 8 +- stats/_nav.php | 96 ++- stats/_preload.php | 13 +- stats/assign_groups.php | 2 +- stats/imprint.php | 2 +- stats/index.php | 55 +- stats/info.php | 19 +- stats/list_rankup.php | 189 +---- stats/my_stats.php | 2 +- stats/nations.php | 14 +- stats/platforms.php | 4 +- stats/privacy_policy.php | 2 +- stats/top_all.php | 84 ++- stats/top_month.php | 93 +-- stats/top_week.php | 97 +-- stats/verify.php | 4 +- stats/versions.php | 4 +- styles/TSN_CosmicBlueClassic/ST.css | 606 ++++++++++++++++ styles/TSN_CosmicBlueClassic/ST.js | 20 + styles/TSN_CosmicBlueClassic/WI.css | 606 ++++++++++++++++ styles/TSN_CosmicBlueClassic/WI.js | 20 + .../files/gfx/cosmicblue-branding.png | Bin 0 -> 1508 bytes styles/TSN_CosmicBlueModern/ST.css | 680 +++++++++++++++++ styles/TSN_CosmicBlueModern/ST.js | 130 ++++ styles/TSN_CosmicBlueModern/WI.css | 686 ++++++++++++++++++ styles/TSN_CosmicBlueModern/WI.js | 135 ++++ .../files/fonts/UniversRegular.ttf | Bin 0 -> 76764 bytes .../files/gfx/cosmicblue-branding.png | Bin 0 -> 1508 bytes styles/TSN_DarkReader/ST.css | 1 + styles/TSN_DarkReader/WI.css | 1 + styles/_README.php | 25 + webinterface/_nav.php | 125 ++-- webinterface/_preload.php | 13 +- webinterface/addon_assign_groups.php | 14 +- webinterface/addon_channelinfo_toplist.php | 6 +- webinterface/admin_addtime.php | 10 +- webinterface/admin_delclient.php | 8 +- webinterface/admin_remtime.php | 8 +- webinterface/api.php | 60 +- webinterface/boost.php | 12 +- webinterface/bot.php | 40 +- webinterface/changepassword.php | 8 +- webinterface/core.php | 56 +- webinterface/db.php | 10 +- webinterface/download_file.php | 8 +- webinterface/except.php | 45 +- webinterface/export.php | 35 +- webinterface/imprint.php | 4 +- webinterface/index.php | 24 +- webinterface/msg.php | 14 +- webinterface/other.php | 90 ++- webinterface/rank.php | 13 +- webinterface/ranklist.php | 152 +++- webinterface/reset.php | 40 +- webinterface/resetpassword.php | 6 +- webinterface/stats.php | 4 +- webinterface/ts.php | 46 +- worker.php | 11 +- 100 files changed, 5710 insertions(+), 1435 deletions(-) create mode 100644 other/session_handling.php create mode 100644 styles/TSN_CosmicBlueClassic/ST.css create mode 100644 styles/TSN_CosmicBlueClassic/ST.js create mode 100644 styles/TSN_CosmicBlueClassic/WI.css create mode 100644 styles/TSN_CosmicBlueClassic/WI.js create mode 100644 styles/TSN_CosmicBlueClassic/files/gfx/cosmicblue-branding.png create mode 100644 styles/TSN_CosmicBlueModern/ST.css create mode 100644 styles/TSN_CosmicBlueModern/ST.js create mode 100644 styles/TSN_CosmicBlueModern/WI.css create mode 100644 styles/TSN_CosmicBlueModern/WI.js create mode 100644 styles/TSN_CosmicBlueModern/files/fonts/UniversRegular.ttf create mode 100644 styles/TSN_CosmicBlueModern/files/gfx/cosmicblue-branding.png create mode 100644 styles/TSN_DarkReader/ST.css create mode 100644 styles/TSN_DarkReader/WI.css create mode 100644 styles/_README.php diff --git a/api/index.php b/api/index.php index 2b1859b..7644ae5 100644 --- a/api/index.php +++ b/api/index.php @@ -3,11 +3,12 @@ require_once('../other/_functions.php'); require_once('../other/config.php'); start_session($cfg); +$lang = set_language(get_language()); error_reporting(E_ALL); ini_set("log_errors", 1); set_error_handler("php_error_handling"); -ini_set("error_log", $cfg['logs_path'].'ranksystem.log'); +ini_set("error_log", $GLOBALS['logfile']); header("Content-Type: application/json; charset=UTF-8"); @@ -48,7 +49,93 @@ $sort = (isset($_GET['sort'])) ? htmlspecialchars_decode($_GET['sort']) : '1'; $order = (isset($_GET['order']) && strtolower($_GET['order']) == 'desc') ? 'DESC' : 'ASC'; $part = (isset($_GET['part']) && is_numeric($_GET['part']) && $_GET['part'] > 0) ? (($_GET['part'] - 1) * $limit) : 0; -if (isset($_GET['groups'])) { +if (isset($_GET['bot'])) { + if(!isset($_GET['check']) && !isset($_GET['restart']) && !isset($_GET['start']) && !isset($_GET['stop'])) { + $json = array( + "usage" => array( + "_desc" => array( + "0" => "You are able to use bot commands with this function (start, stop, ..).", + "1" => "Use the Parameter, which are described below!", + "2" => "", + "3" => "Return values are:", + "4" => "- 'rc'", + "5" => "- 'msg'", + "6" => "- 'ranksystemlog'", + "7" => "", + "8" => "# RC", + "9" => "The return Code of the transaction (i.e. start process):", + "10" => "0 - EXIT_SUCCESS", + "11" => "1 - EXIT_FAILURE", + "12" => "", + "13" => "# MSG", + "14" => "An additional message of the process. In case of EXIT_FAILURE, you will receive here an error message.", + "15" => "", + "16" => "# RANKSYSTEMLOG", + "17" => "A short log extract of the last rows of the Ranksystem logfile to get more information about the Bot itself.", + ), + "check" => array( + "desc" => "Check the Ranksystem Bot is running. If not, it will be started with this.", + "usage" => "Use \$_GET parameter 'check' without any value", + "example" => "/api/?bot&check" + ), + "restart" => array( + "desc" => "Restarts the Ranksystem Bot.", + "usage" => "Use \$_GET parameter 'restart' without any value", + "example" => "/api/?bot&restart" + ), + "start" => array( + "desc" => "Starts the Ranksystem Bot.", + "usage" => "Use \$_GET parameter 'start' without any value", + "example" => "/api/?bot&start" + ), + "stop" => array( + "desc" => "Stops the Ranksystem Bot", + "usage" => "Use \$_GET parameter 'stop' without any value", + "example" => "/api/?bot&stop" + ) + ) + ); + } else { + $check_permission = 0; + foreach($cfg['stats_api_keys'] as $apikey => $desc) { + if (hash_equals($apikey, $_GET['apikey']) && $desc['perm_bot'] == 1) { + $check_permission = 1; + break; + } + } + if ($check_permission == 1) { + if(isset($_GET['check'])) { + $result = bot_check(); + } elseif(isset($_GET['restart'])) { + $result = bot_restart(); + } elseif(isset($_GET['start'])) { + $result = bot_start(); + } elseif(isset($_GET['stop'])) { + $result = bot_stop(); + } + if(isset($result['log']) && $result['log'] != NULL) { + $ranksystemlog = $result['log']; + } else { + $ranksystemlog = "NULL"; + } + $json = array( + "rc" => $result['rc'], + "msg" => $result['msg'], + "ranksystemlog" => $ranksystemlog + ); + } else { + $json = array( + "Error" => array( + "invalid" => array( + "permissions" => "API Key is not permitted to start/stop the Ranksystem Bot" + ) + ) + ); + echo json_encode($json); + exit; + } + } +} elseif (isset($_GET['groups'])) { $sgidname = $all = '----------_none_selected_----------'; $sgid = -1; if(isset($_GET['all'])) $all = 1; @@ -463,6 +550,11 @@ if (isset($_GET['groups'])) { } else { $json = array( "usage" => array( + "bot" => array( + "desc" => "Use this to trigger Bot commands as starting or stopping the Ranksystem Bot.", + "usage" => "Use \$_GET parameter 'bot'", + "example" => "/api/?bot" + ), "groups" => array( "desc" => "Get details about the TeamSpeak servergroups", "usage" => "Use \$_GET parameter 'groups'", diff --git a/install.php b/install.php index 034c8e1..c244bd3 100644 --- a/install.php +++ b/install.php @@ -1,5 +1,5 @@