From 4c8dc1ba5b2979b5c18651038a372c577576a1ed Mon Sep 17 00:00:00 2001 From: bafbes Date: Sat, 18 Apr 2015 15:26:33 +0100 Subject: [PATCH] NEW : dev feature : replace conf filename with "conf" parameter on url by GET --- htdocs/filefunc.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 15bee891775..48d662774ae 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -66,6 +66,14 @@ $conffiletoshow = "htdocs/conf/conf.php"; //$conffile = "/etc/dolibarr/conf.php"; //$conffiletoshow = "/etc/dolibarr/conf.php"; +//replace conf filename with "conf" parameter on url by GET +if (!empty($_GET['conf'])) { + setcookie('dolconf', $_GET['conf'],0,'/'); + $conffile = 'conf/' . $_GET['conf'] . '.php'; +} else { + $conffile = 'conf/' . (!empty($_COOKIE['dolconf']) ? $_COOKIE['dolconf'] : 'conf') . '.php'; +} + // Include configuration $result=@include_once $conffile; // Keep @ because with some error reporting this break the redirect