<?
/******************************************************************************
Epiware: Project and Document Management
http://www.epiware.com
Copyright (C) 2006 James Kern
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Epiware, Inc. and Praxis Inc, hereby disclaims all copyright
interest in the program 'Epiware' written
by James Kern, Edward Kline, Ryan Gilfether, Ray Gorospe, Patrick Waddingham
06 September 2006
James Kern, President of Epiware
Jack Chapman, President of Praxis
*****************************************************************************/
//This file will make sure that the user_id is set and that the user is active
//if not, then the user will be redirected to the appropriate page
if(!($user_id > 0))
{
$url = "./expired.php";
$param = "message=session_expired";
$url = create_url($url,$param);
header("Location: $url");
exit;
}//end of if user_id not set
else
{
//check user for password reset
$sql = "select status from users where user_id=$user_id";
if($result = $db->perform_looping_query($sql))
{
if($row = $db->get_next_row($result,MYSQL_ASSOC))
{
$dstatus = $row["status"];
}//end of while loop through row
$db->free_result_set($result);
if($dstatus == 2)
{
$page = "./password_reset.php";
$param = "pass_user_id=$user_id";
$url = create_url($page,$param);
print "<html><head><meta http-equiv=\"refresh\" content=\"0;URL=$url\"></head></html>";
exit;
}
else if($dstatus < 0)
{
$url = "./";
print "<html><head><meta http-equiv=\"refresh\" content=\"0;URL=$url\"></head></html>";
exit;
}//end of if user has been made inactive
}//end of if resutl
}//end of if user_id > 0
?>