From 040df3c922947c297aaf8c07f354cb9859e3e18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 May 2015 10:32:20 +0200 Subject: [PATCH] Change low level access verification to a better high level one --- htdocs/public/test/test_arrays.php | 10 +++------- htdocs/public/test/test_forms.php | 7 ++----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 2f0e903b8c5a5..e08eb5715c438 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -2,16 +2,12 @@ //define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. - require '../../main.inc.php'; -if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') -{ - print "Page available only from remote address 127.0.0.1"; - exit; +if ($dolibarr_main_prod) { + accessforbidden(); } - $usedolheader=1; // 1 = Test inside a dolibarr page, 0 = Use hard coded header @@ -358,4 +354,4 @@ function(){ - \ No newline at end of file + diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index e8841eea580b8..86db08fe1487d 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -6,13 +6,10 @@ require '../../main.inc.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') -{ - print "Page available only from remote address 127.0.0.1"; - exit; +if ($dolibarr_main_prod) { + accessforbidden(); } - llxHeader(); ?>