From 354917850583128bee7b569b1d6ed43036e73030 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Thu, 21 Feb 2002 12:27:56 +0000 Subject: [PATCH] Add referer capability - arrives via HTTP_GET_VARS, saved in appsession --- admin/inc/class.uiconfig.inc.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/admin/inc/class.uiconfig.inc.php b/admin/inc/class.uiconfig.inc.php index 247749cf49..35e13c55fa 100644 --- a/admin/inc/class.uiconfig.inc.php +++ b/admin/inc/class.uiconfig.inc.php @@ -18,6 +18,23 @@ 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']) { case 'admin': @@ -39,7 +56,7 @@ case 'phpgwapi': case '': /* 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; default: $appname = $GLOBALS['HTTP_GET_VARS']['appname']; @@ -64,7 +81,7 @@ if ($GLOBALS['HTTP_POST_VARS']['cancel']) { - Header('Location: '.$GLOBALS['phpgw']->link('/admin/index.php')); + Header('Location: ' . $_redir); } if ($GLOBALS['HTTP_POST_VARS']['submit']) @@ -118,7 +135,8 @@ 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(); } }