remember the login referer. That allows us to redirect to this page, after login the user out.

This commit is contained in:
Lars Kneschke 2006-08-23 13:50:02 +00:00
parent f01ec5bd3f
commit 74b9b2c9fa
2 changed files with 13 additions and 2 deletions

View File

@ -306,6 +306,12 @@
list($forward,$extra_vars) = explode('?',$forward,2);
}
if(strpos($_SERVER['HTTP_REFERER'], $_SERVER['REQUEST_URI']) === false) {
// login requuest does not come from login.php
// redirect to referer on logout
$GLOBALS['egw']->session->appsession('referer', 'login', $_SERVER['HTTP_REFERER']);
}
// Check for save passwd
if($GLOBALS['egw_info']['server']['check_save_passwd'] && $GLOBALS['egw']->acl->check('changepassword', 1, 'preferences') && $unsave_msg = $GLOBALS['egw']->auth->crackcheck($passwd))
{

View File

@ -26,6 +26,11 @@
$GLOBALS['kp3'] = get_var('kp3',array('GET','COOKIE'));
$verified = $GLOBALS['egw']->session->verify();
if(!$redirectTarget = $GLOBALS['egw']->session->appsession('referer', 'login')) {
$redirectTarget = $GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=1&domain='.$GLOBALS['egw_info']['user']['domain'];
}
if ($verified)
{
if (file_exists($GLOBALS['egw_info']['server']['temp_dir'] . SEP . $GLOBALS['sessionid']))
@ -63,6 +68,6 @@
{
$GLOBALS['egw']->session->phpgw_setcookie(EGW_PHPSESSID);
}
$GLOBALS['egw']->redirect($GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=1&domain='.$GLOBALS['egw_info']['user']['domain']);
$GLOBALS['egw']->redirect($redirectTarget);
?>