From e963752b0e6b27c4f2368f50db04e1104510c54e Mon Sep 17 00:00:00 2001 From: Pentium44 Date: Wed, 3 Feb 2021 15:44:37 -0800 Subject: [PATCH] Call this V1.2 --- README.md | 3 +++ config.php | 23 ++++++++++++----------- index.php | 38 +++++++++++++++++++++++++++++++------- text/about.txt | 6 ++++++ version.php | 5 +++++ 5 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 version.php diff --git a/README.md b/README.md index ada73db5..5b1123d9 100755 --- a/README.md +++ b/README.md @@ -56,6 +56,9 @@ Mods / Gamepacks ChangeLog ---- +2/03/2021 - v1.2 +* Can disable and enable registration tokens for register in config.php + 2/03/2021 - v1.1b * CSS clean-up * Admin configuration of server max slots -> config.php diff --git a/config.php b/config.php index a6d06245..742a2953 100755 --- a/config.php +++ b/config.php @@ -2,19 +2,20 @@ /////// // MTSM - Minetest Server Manager // (C) Chris Dorman, CC-BY-SA v3.0 (2021) -// https://github.com/Pentium44/MTSM -// Version: 1.0 +// https://notabug.org/Pentium44/MTSM /////// -$mtsmtitle = "webpanel ~ panel.edgy1.net"; // MTSM Title -$desc = "Simple, ad-free, and lightweight Minetest hosting solution that's number one for YOU! " +include_once("version.php"); + +$mtsmtitle = "free.minetest.host"; // MTSM Title +$desc = "Simple, ad-free, and lightweight Minetest hosting service, FREE to use and free of charge! " . $mtsmtitle . " is powered by MTSM."; // Description of the panel. -$domain = "https://panel.edgy1.net"; // where is MTSM operating? -$version = "1.1b"; // version of MTSM -$defaultip = "fi.edgy1.net"; // Default IP for user servers -$maxservers = "100"; // max server count. +$domain = "https://free.minetest.host"; // where is MTSM operating? +$defaultip = "free.minetest.host"; // Default IP for user servers +$maxservers = "50"; // max server count. $portrange = "30"; // xxx example 30, would be 30001 for port usage on the first user -$max_slot_count = "50"; // Maximum amount of slots per servers of a user, set in minetest.conf +$max_slot_count = "8"; // Maximum amount of slots per servers of a user, set in minetest.conf +$reg_token_required = "false"; // Require token provided by admin for registration (nice for paid servers) // Default "admin" account password $admin_passwd = "ChangeM3!"; @@ -25,7 +26,7 @@ $allowed_file_extension = "zip"; // Allowed archive extension type. // File mimetype is checked by the index upload-modzip function // IRC settings, for IRC plugin -$default_irc_server = "irc.edgy1.net"; -$default_irc_port = "6667"; +$default_irc_server = "irc.cddo.cc"; +$default_irc_port = "1337"; ?> diff --git a/index.php b/index.php index 290d0638..ecdb6048 100755 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ // MTSM - Minetest Server Manager - Server management frontend // (C) Chris Dorman, 2021 // License: CC-BY-SA version 3.0 -// http://github.com/Pentium44/MTSM +// http://notabug.org/Pentium44/MTSM session_start(); include "config.php"; @@ -617,13 +617,18 @@ else if(isset($_GET['do'])) echo "

Enable mods from local repository

"; modsForm(); - echo "

Enable user available mods

"; - // In case someone fucks there shit up - echo "Delete user mods
"; - userModsForm($username); + // Disable user uploads of zip files when given to general public. + if($reg_token_required == "true") { - echo "

Personal mod upload

"; - modUploadForm(); + echo "

Enable user available mods

"; + // In case someone fucks there shit up + echo "Delete user mods
"; + userModsForm($username); + + echo "

Personal mod upload

"; + modUploadForm(); + + } } } else { echo "ERROR: Server not found!"; @@ -793,6 +798,9 @@ else if(isset($_GET['do'])) { if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { include_once("mtm_db/token.php"); + // Enable registration tokens via config.php now! + if($reg_token_required == "true") { + if(stripslashes(htmlentities($_POST['codeword'])) == $reg_token) { $servercount = $servercount + 1; if ($servercount < 10) { @@ -813,6 +821,22 @@ else if(isset($_GET['do'])) { echo "ERROR: Registration code incorrect, please try again!"; } + + } else { // Else we aren't using registration codes! FREE SERVERS + + $servercount = $servercount + 1; + if ($servercount < 10) { + $usergenid = "00" . $servercount; + } else if ($servercount < 100) { + $usergenid = "0" . $servercount; + } else { + $usergenid = $servercount; + } + + file_put_contents("mtm_db/users/usercount", $servercount); + file_put_contents("mtm_db/users/" . stripslashes(htmlentities($_POST['username'])) . ".php", " + free.minetest.host is a 100% cost-free, ad-free Minetest / Multicraft Server Hosting platform! + With the ability to casually click mods you'd wish to use, which gamepack to start with, and more! + You're provided with a full user control panel and can operate your server in an easy-to-use fashion! +

+
diff --git a/version.php b/version.php new file mode 100644 index 00000000..32ec6867 --- /dev/null +++ b/version.php @@ -0,0 +1,5 @@ +