Fix: Try a fix for the lost mainmenu session.
This commit is contained in:
parent
a9c03aa01e
commit
3a2caa3e46
@ -163,6 +163,13 @@ $sessiontimeout='DOLSESSTIMEOUT_'.$prefix;
|
|||||||
if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
|
if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
|
||||||
session_name($sessionname);
|
session_name($sessionname);
|
||||||
session_start();
|
session_start();
|
||||||
|
if (ini_get('register_globals')) // To solve bug in using $_SESSION
|
||||||
|
{
|
||||||
|
foreach ($_SESSION as $key=>$value)
|
||||||
|
{
|
||||||
|
if (isset($GLOBALS[$key])) unset($GLOBALS[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Init the 5 global objects
|
// Init the 5 global objects
|
||||||
// This include will set: $conf, $db, $langs, $user, $mysoc objects
|
// This include will set: $conf, $db, $langs, $user, $mysoc objects
|
||||||
@ -433,7 +440,7 @@ if (! defined('NOLOGIN'))
|
|||||||
dol_syslog('User not found, connexion refused');
|
dol_syslog('User not found, connexion refused');
|
||||||
session_destroy();
|
session_destroy();
|
||||||
session_name($sessionname);
|
session_name($sessionname);
|
||||||
session_start();
|
session_start(); // Fixing the bug of register_globals here is useless since session is empty
|
||||||
|
|
||||||
if ($resultFetchUser == 0)
|
if ($resultFetchUser == 0)
|
||||||
{
|
{
|
||||||
@ -475,7 +482,7 @@ if (! defined('NOLOGIN'))
|
|||||||
dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=".$login, LOG_WARNING);
|
dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=".$login, LOG_WARNING);
|
||||||
session_destroy();
|
session_destroy();
|
||||||
session_name($sessionname);
|
session_name($sessionname);
|
||||||
session_start();
|
session_start(); // Fixing the bug of register_globals here is useless since session is empty
|
||||||
|
|
||||||
if ($resultFetchUser == 0)
|
if ($resultFetchUser == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -22,8 +22,17 @@
|
|||||||
* \brief Page with Paypal init var.
|
* \brief Page with Paypal init var.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (session_id() == "") session_start();
|
if (session_id() == "")
|
||||||
|
{
|
||||||
|
session_start();
|
||||||
|
if (ini_get('register_globals')) // To solve bug in using $_SESSION
|
||||||
|
{
|
||||||
|
foreach ($_SESSION as $key=>$value)
|
||||||
|
{
|
||||||
|
if (isset($GLOBALS[$key])) unset($GLOBALS[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ==================================
|
// ==================================
|
||||||
// PayPal Express Checkout Module
|
// PayPal Express Checkout Module
|
||||||
|
|||||||
@ -70,8 +70,6 @@ if ($action == 'validatenewpassword' && $username && $passwordmd5)
|
|||||||
{
|
{
|
||||||
$newpassword=$edituser->setPassword($user,$edituser->pass_temp,0);
|
$newpassword=$edituser->setPassword($user,$edituser->pass_temp,0);
|
||||||
dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database");
|
dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database");
|
||||||
//session_start();
|
|
||||||
//$_SESSION["loginmesg"]=$langs->trans("PasswordChanged");
|
|
||||||
header("Location: ".DOL_URL_ROOT.'/');
|
header("Location: ".DOL_URL_ROOT.'/');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user