diff --git a/README.md b/README.md index 8a1fb82..8973e4d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Arionum (ARO) cryptocurrency node Requires php 7.1 and php-gmp +This app should only be run in the main directory of the domain/subdomain, ex: http://111.111.111.111/ Official website: https://www.arionum.com diff --git a/include/init.inc.php b/include/init.inc.php index 5b66b6f..22fc401 100755 --- a/include/init.inc.php +++ b/include/init.inc.php @@ -8,6 +8,13 @@ date_default_timezone_set("Europe/Amsterdam"); //error_reporting(E_ALL & ~E_NOTICE); error_reporting(0); ini_set('display_errors',"off"); + + +if(php_sapi_name() !== 'cli'&&substr_count($_SERVER['PHP_SELF'],"/")>1){ + die("This application should only be run in the main directory /"); +} + + require_once("include/config.inc.php"); require_once("include/db.inc.php"); require_once("include/functions.inc.php"); @@ -45,9 +52,11 @@ if(file_exists("tmp/db-update")){ $res=unlink("tmp/db-update"); if($res){ + echo "Updating db schema! Please refresh!\n"; require_once("include/schema.inc.php"); exit; } + echo "Could not access the tmp/db-update file. Please give full permissions to this file\n"; } if($_config['dbversion']<2) exit;