Skip to content
Snippets Groups Projects
Commit f3950768 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

A better demo home page

parent 2fd6bde5
No related branches found
No related tags found
No related merge requests found
......@@ -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 '<tr>';
print '<tr>';
print '<td align="left">';
......
......@@ -33,6 +33,9 @@ if ($_SESSION["dol_authmode"] == 'forceuser'
include_once("../conf/conf.php");
require_once("../main.inc.php");
// Define url to go after disconnect
$urlfrom=empty($_SESSION["urlfrom"])?'':$_SESSION["urlfrom"];
// Module Phenix
if ($conf->phenix->enabled && $conf->phenix->cookie)
{
......@@ -56,5 +59,13 @@ dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id()
session_unregister("dol_login");
header("Location: ".DOL_URL_ROOT."/index.php");
// Define url to go
$url=DOL_URL_ROOT."/index.php"; // By default go to login page
if ($urlfrom)
{
$url=DOL_URL_ROOT.$urlfrom;
}
header("Location: ".$url);
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment