From 19b0087f52978eec570825736756f08230756ac1 Mon Sep 17 00:00:00 2001 From: vbracco Date: Fri, 24 Oct 2008 23:19:31 +0000 Subject: [PATCH] If the user is not logged redirect after login to the correct edition screen. --- admin/bm.php | 3 ++- login.php | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/admin/bm.php b/admin/bm.php index f7e4442..f3f9277 100644 --- a/admin/bm.php +++ b/admin/bm.php @@ -222,6 +222,7 @@ if ($user->isAdmin()) { urlGelato."/login.php"); + $target = (isset($_GET["url"]))? "/login.php?redirect_url=".$_GET["url"]."&sel=".$_GET["sel"] : "/login.php"; + header("Location: ".$conf->urlGelato.$target); } ?> \ No newline at end of file diff --git a/login.php b/login.php index b3fb7f0..86222c2 100644 --- a/login.php +++ b/login.php @@ -21,9 +21,14 @@ if ($user->isAuthenticated()) { header("Location: ".$conf->urlGelato."/admin/index.php"); } else { if (isset($_POST["pass"]) && isset($_POST["login"])) { - if ($user->validateUser($_POST['login'], md5($_POST['pass']))) { - header("Location: ".$conf->urlGelato."/admin/index.php"); - exit(); + if ($user->validateUser($_POST['login'], md5($_POST['pass']))) { + if(isset($_POST["url_redirect"])){ + header("Location: ".$conf->urlGelato."/admin/bm.php?url=".$_POST["url_redirect"]."&sel=".$_POST["sel"]); + exit(); + } else { + header("Location: ".$conf->urlGelato."/admin/index.php"); + exit(); + } } else { header("Location: ".$conf->urlGelato."/login.php?error=1"); exit(); @@ -82,6 +87,7 @@ if ($user->isAuthenticated()) {
+ " : ""; ?>