diff --git a/home.php b/home.php index fb55d57d03..90b479974f 100755 --- a/home.php +++ b/home.php @@ -20,7 +20,7 @@ exit; } - $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : $_COOKIE['sessionid']; + $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : @$_COOKIE['sessionid']; if (!isset($GLOBALS['sessionid']) || !$GLOBALS['sessionid']) { Header('Location: login.php'); @@ -51,6 +51,20 @@ exit; } + // anonymous user should never get a home-page + if ($GLOBALS['phpgw']->session->session_flags == 'A') + { + if ($_SERVER['HTTP_REFERER'] && strstr($_SERVER['HTTP_REFERER'],'home.php') === False) + { + $GLOBALS['phpgw']->redirect($_SERVER['HTTP_REFERER']); + } + else + { + header('HTTP/1.0 404 Not found'); + } + exit; + } + if ($GLOBALS['phpgw_info']['server']['force_default_app'] && $GLOBALS['phpgw_info']['server']['force_default_app'] != 'user_choice') { $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] = $GLOBALS['phpgw_info']['server']['force_default_app'];