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