Add referer capability - arrives via HTTP_GET_VARS, saved in appsession

This commit is contained in:
Miles Lott 2002-02-21 12:27:56 +00:00
parent d9c78866ac
commit 3549178505

View File

@ -18,6 +18,23 @@
function index() function index()
{ {
$referer = urldecode($GLOBALS['HTTP_GET_VARS']['referer']);
if($referer)
{
$_redir = $referer;
$GLOBALS['phpgw']->session->appsession('session_data','admin_config',$referer);
}
else
{
$referer = $GLOBALS['phpgw']->session->appsession('session_data','admin_config');
if($referer == '-1')
{
$referer = '';
}
$_redir = $referer ? $referer : $GLOBALS['phpgw']->link('/admin/index.php');
}
switch($GLOBALS['HTTP_GET_VARS']['appname']) switch($GLOBALS['HTTP_GET_VARS']['appname'])
{ {
case 'admin': case 'admin':
@ -39,7 +56,7 @@
case 'phpgwapi': case 'phpgwapi':
case '': case '':
/* This keeps the admin from getting into what is a setup-only config */ /* This keeps the admin from getting into what is a setup-only config */
Header('Location: '.$GLOBALS['phpgw']->link('/admin/index.php')); Header('Location: ' . $_redir);
break; break;
default: default:
$appname = $GLOBALS['HTTP_GET_VARS']['appname']; $appname = $GLOBALS['HTTP_GET_VARS']['appname'];
@ -64,7 +81,7 @@
if ($GLOBALS['HTTP_POST_VARS']['cancel']) if ($GLOBALS['HTTP_POST_VARS']['cancel'])
{ {
Header('Location: '.$GLOBALS['phpgw']->link('/admin/index.php')); Header('Location: ' . $_redir);
} }
if ($GLOBALS['HTTP_POST_VARS']['submit']) if ($GLOBALS['HTTP_POST_VARS']['submit'])
@ -118,7 +135,8 @@
if(!$errors) if(!$errors)
{ {
Header('Location: '.$GLOBALS['phpgw']->link('/admin/index.php')); $GLOBALS['phpgw']->session->appsession('session_data','admin_config',-1);
Header('Location: ' . $_redir);
$GLOBALS['phpgw']->common->phpgw_exit(); $GLOBALS['phpgw']->common->phpgw_exit();
} }
} }