implemented automatical forwarding into eGW after a login was necessary, because no session existed

This commit is contained in:
Ralf Becker 2004-04-14 11:52:16 +00:00
parent b7890a9ba4
commit dfdfaad414
4 changed files with 25 additions and 39 deletions

View File

@ -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')
{

View File

@ -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;
}

View File

@ -54,15 +54,15 @@
$deny_msg=lang('Oops! You caught us in the middle of system maintainance.<br/>
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);
}
/********************************************************\

View File

@ -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');