From 9a98fb8da8ecec22d59ce9f896a292334b0c6cf7 Mon Sep 17 00:00:00 2001 From: dave Date: Fri, 16 Nov 2007 08:00:40 +0000 Subject: [PATCH] - Don't let the user see the login page if they're already login, instead, provide them with a message indicating how to logout. --- user_login.php | 6 ++++++ volunteer_main.php | 3 +++ 2 files changed, 9 insertions(+) diff --git a/user_login.php b/user_login.php index a96413b..6ba63a3 100644 --- a/user_login.php +++ b/user_login.php @@ -60,7 +60,13 @@ * logged in. */ $type = false; if(isset($_SESSION['users_type'])) { + /* They're already logged in */ $type = $_SESSION['users_type']; + /* If they're not trying to logout, don't let them see the login page */ + if($_GET['action'] != 'logout') { + header("location: {$type}_main.php?notice=already_logged_in"); + exit; + } } else { $type = $_GET['type']; /* user_types is in user.inc.php */ diff --git a/volunteer_main.php b/volunteer_main.php index b417ad8..0dcd584 100644 --- a/volunteer_main.php +++ b/volunteer_main.php @@ -36,6 +36,9 @@ case 'password_changed': echo happy(i18n('Your password has been successfully updated')); break; + case 'already_logged_in': + echo error(i18n('You are already logged in, please use the [Logout] link in the upper right to logout')); + break; } //only display the named greeting if we have their name