. * * index.php * * The index file. * * @author Daniele Bonini * @copyrights (c) 2016, 2024, 5 Mode * @license https://opensource.org/licenses/BSD-3-Clause */ require "../Private/core/init.inc"; //use fivemode\fivemode\Class; // FUNCTION AND VARIABLE DECLARATIONS $scriptPath = APP_SCRIPT_PATH; // PARAMETERS VALIDATION $url = strtolower(trim(substr(filter_input(INPUT_GET, "url", FILTER_SANITIZE_STRING), 0, 300), "/")); switch ($url) { case "action": $scriptPath = APP_AJAX_PATH; define("SCRIPT_NAME", "action"); define("SCRIPT_FILENAME", "action.php"); break; case "script": define("SCRIPT_NAME", "script"); define("SCRIPT_FILENAME", "scriptContent.php"); break; case "": $bsdha = strtolower(substr(filter_input(INPUT_GET, "bsdha", FILTER_SANITIZE_STRING), 0, 64)); // SALT LOGIC $SALT = ""; // Authentication $myhash = hash("sha256", APP_PASSWORD . $SALT, false); if ($myhash === $bsdha) { $auth = true; } else { $auth = false; } $bsdto = trim(substr(filter_input(INPUT_GET, "bsdto", FILTER_SANITIZE_STRING), 0, 100), " "); $bsdsu = trim(substr(filter_input(INPUT_GET, "bsdsu", FILTER_SANITIZE_STRING), 0, 300), " "); $bsdbo = trim(substr(filter_input(INPUT_GET, "bsdbo", FILTER_SANITIZE_STRING), 0, 5000), " "); if (!$auth || ($bsdto===PHP_STR) || ($bsdsu===PHP_STR) || ($bsdbo===PHP_STR)) { echo("Param error."); exit(-1); } else { define("SCRIPT_NAME", "m"); define("SCRIPT_FILENAME", "m.php"); } break; default: $scriptPath = APP_ERROR_PATH; define("SCRIPT_NAME", "err-404"); define("SCRIPT_FILENAME", "err-404.php"); } if (SCRIPT_NAME==="err-404") { header("HTTP/1.1 404 Not Found"); } require $scriptPath . "/" . SCRIPT_FILENAME;