mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
implemented automatical forwarding into eGW after a login was necessary, because no session existed
This commit is contained in:
parent
b7890a9ba4
commit
dfdfaad414
13
home.php
13
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')
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
23
login.php
23
login.php
@ -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();
|
||||
}
|
||||
$forward = isset($_GET['phpgw_forward']) ? urldecode($_GET['phpgw_forward']) : @$_POST['phpgw_forward'];
|
||||
if (!$forward)
|
||||
{
|
||||
$extra_vars['cd'] = 'yes';
|
||||
|
||||
$GLOBALS['phpgw']->redirect_link('/home.php', $extra_vars);
|
||||
$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);
|
||||
}
|
||||
|
||||
/********************************************************\
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user