diff --git a/home.php b/home.php index 90b479974f..f8826e9d68 100755 --- a/home.php +++ b/home.php @@ -38,19 +38,6 @@ include('header.inc.php'); $GLOBALS['phpgw_info']['flags']['app_header']=lang('home'); - if ($_GET['phpgw_forward']) - { - foreach($_GET as $name => $value) - { - if (ereg('phpgw_',$name)) - { - $extra_vars .= '&' . $name . '=' . urlencode($value); - } - } - $GLOBALS['phpgw']->redirect_link($_GET['phpgw_forward'],$extra_vars); - exit; - } - // anonymous user should never get a home-page if ($GLOBALS['phpgw']->session->session_flags == 'A') { diff --git a/index.php b/index.php index dc7ce21174..b062a43322 100755 --- a/index.php +++ b/index.php @@ -21,7 +21,8 @@ $GLOBALS['sessionid'] = isset($_GET['sessionid']) ? $_GET['sessionid'] : @$_COOKIE['sessionid']; if(!$GLOBALS['sessionid']) { - Header('Location: login.php'); + Header('Location: login.php'. + (isset($_SERVER['QUERY_STRING']) ? '?phpgw_forward='.urlencode('/index.php?'.$_SERVER['QUERY_STRING']):'')); exit; } diff --git a/login.php b/login.php index ed2ab1eb75..0f43a5b75d 100755 --- a/login.php +++ b/login.php @@ -54,15 +54,15 @@ $deny_msg=lang('Oops! You caught us in the middle of system maintainance.
Please, check back with us shortly.'); - $tmpl->set_file(array - ( - 'login_form' => 'login_denylogin.tpl' - )); + $tmpl->set_file(array + ( + 'login_form' => 'login_denylogin.tpl' + )); - $tmpl->set_var('template_set','default'); - $tmpl->set_var('deny_msg',$deny_msg); - $tmpl->pfp('loginout','login_form'); - exit; + $tmpl->set_var('template_set','default'); + $tmpl->set_var('deny_msg',$deny_msg); + $tmpl->pfp('loginout','login_form'); + exit; } $tmpl->set_file(array('login_form' => 'login.tpl')); @@ -224,25 +224,18 @@ { $GLOBALS['phpgw']->preferences->add('common','lang',$_POST['lang'],'session'); } - $forward = get_var('phpgw_forward', array('GET', 'POST'), 0); - if($forward) - { - $extra_vars['phpgw_forward'] = $forward; - foreach($_GET as $name => $value) - { - if(ereg('phpgw_',$name)) - { - $extra_vars[$name] = urlencode($value); - } - } - } + if(!$GLOBALS['phpgw_info']['server']['disable_autoload_langfiles']) { $GLOBALS['phpgw']->translation->autoload_changed_langfiles(); } - $extra_vars['cd'] = 'yes'; - - $GLOBALS['phpgw']->redirect_link('/home.php', $extra_vars); + $forward = isset($_GET['phpgw_forward']) ? urldecode($_GET['phpgw_forward']) : @$_POST['phpgw_forward']; + if (!$forward) + { + $extra_vars['cd'] = 'yes'; + $forward = '/home.php'; + } + $GLOBALS['phpgw']->redirect_link($forward,$extra_vars); } } else @@ -325,7 +318,7 @@ if($extra_vars) { - $extra_vars = '?' . substr($extra_vars,1,strlen($extra_vars)); + $extra_vars = '?' . substr($extra_vars,1); } /********************************************************\ diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index 2c9a35da6b..f99e2e3ac8 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -293,7 +293,12 @@ { if (! $GLOBALS['phpgw']->session->verify()) { - $GLOBALS['phpgw']->redirect_link('/login.php','cd=10'); + list(,$relpath) = explode($GLOBALS['phpgw_info']['server']['webserver_url'],$_SERVER['PHP_SELF'],2); + $args = array( + 'cd' => 10, + 'phpgw_forward' => urlencode('/'.$relpath.(isset($_SERVER['QUERY_STRING']) ? '?'.$_SERVER['QUERY_STRING'] : '')) + ); + $GLOBALS['phpgw']->redirect_link('/login.php',$args); } $GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.datetime');