diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 330fe39b756..10875551b23 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -102,7 +102,10 @@ if ($_REQUEST["action"] == 'gotodemo') if ($disablestring) { - header("Location: ".DOL_URL_ROOT.'/index.php?disablemodules='.$disablestring); + $url=DOL_URL_ROOT.'/index.php?disablemodules='.$disablestring; + if (! empty($_REQUEST["urlfrom"])) $url.='&urlfrom='.$_REQUEST["urlfrom"]; + if (! empty($conf->global->MAIN_DEMO)) $url.='&username='.urlencode($conf->global->MAIN_DEMO); + header("Location: ".$url); exit; } } @@ -207,7 +210,7 @@ foreach ($demoprofiles as $profilarray) { if ($profilarray['default'] >= 0) { - $url=$_SERVER["PHP_SELF"].'?action=gotodemo&demochoice='.$profilarray['key']; + $url=$_SERVER["PHP_SELF"].'?action=gotodemo&demochoice='.$profilarray['key'].'&urlfrom='.urlencode($_SERVER["PHP_SELF"]); //if ($i % $NBOFCOLS == 0) print '