From 088b82ba757203b4c1ca6331d969b373271d64d0 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 7 Jul 2010 17:10:32 +0100 Subject: [PATCH] If we don't need authentication and have a target URL, redirect there. --- horde/login.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/horde/login.php b/horde/login.php index 012d6e3ec..443b0c936 100644 --- a/horde/login.php +++ b/horde/login.php @@ -233,10 +233,18 @@ if ($error_reason) { } /* If we currently are authenticated, and are not trying to authenticate to - * an application, redirect to initial page. This is done in index.php. */ -if ($is_auth && !$vars->app) { - require HORDE_BASE . '/index.php'; - exit; + * an application, redirect to initial page. This is done in index.php. + * If we are trying to authenticate to an application, but don't have to, + * redirect to the requesting URL. */ +if ($is_auth) { + if (!$vars->app) { + require HORDE_BASE . '/index.php'; + exit; + } elseif ($url_in && + $registry->isAuthenticated(array('app' => $vars->app))) { + header('Location: ' . _addAnchor($url_in, 'param', null, $url_anchor)); + exit; + } } /* Redirect the user if an alternate login page has been specified. */ -- 2.11.0