diff --git a/profile.php b/profile.php index 09d7247..5f8fa1a 100755 --- a/profile.php +++ b/profile.php @@ -4,17 +4,9 @@ require_once("config.inc.php"); $yaptc_pagename = "Profile"; require_once($yaptc_inc . "header.inc.php"); require_once($yaptc_inc . "menu.inc.php"); -// Is user logged in? If not, they shouldn't be here - kill all variables and redirect to login... -if (!isset($_SESSION['user_id']) || !isset($_SESSION['signature']) || !isset($_SESSION['loggedIn']) || $_SESSION['loggedIn'] != true || $_SESSION['signature'] != md5($_SESSION['user_id'] . $_SERVER['HTTP_USER_AGENT'])) -{ -session_start(); -session_unset(); -session_destroy(); -header ("Refresh:3; url=login.php", true, 303); -echo "

You are not logged in!!!

"; -} -else -{ +if (getSessionStatus() == false) { +killSession(); +} else { //********** BEGIN CONTENT **********// $query = "SELECT users.id, users.password, users.created, users.username, users.firstname, users.lastname, users.email, usertypes.typename AS usertype FROM users, usertypes WHERE users.id = :id"; diff --git a/punchlog.php b/punchlog.php index aec760c..4f360a7 100755 --- a/punchlog.php +++ b/punchlog.php @@ -4,18 +4,11 @@ require_once("config.inc.php"); $yaptc_pagename = "Punch Log"; require_once($yaptc_inc . "header.inc.php"); require_once($yaptc_inc . "menu.inc.php"); -// Is user logged in? If not, they shouldn't be here - kill all variables and redirect to login... -if (!isset($_SESSION['user_id']) || !isset($_SESSION['signature']) || !isset($_SESSION['loggedIn']) || $_SESSION['loggedIn'] != true || $_SESSION['signature'] != md5($_SESSION['user_id'] . $_SERVER['HTTP_USER_AGENT'])) -{ -session_start(); -session_unset(); -session_destroy(); -header ("Refresh:3; url=login.php", true, 303); -echo "

You are not logged in!!!

"; -} -else -{ +if (getSessionStatus() == false) { +killSession(); +} else { //********** BEGIN CONTENT **********// + $userid = $_SESSION['user_id']; $timenow = date('Y-m-d H:i'); diff --git a/reports.php b/reports.php index 7b2fe8d..cb3a299 100755 --- a/reports.php +++ b/reports.php @@ -4,17 +4,9 @@ require_once("config.inc.php"); $yaptc_pagename = "Reports"; require_once($yaptc_inc . "header.inc.php"); require_once($yaptc_inc . "menu.inc.php"); -// Is user logged in? If not, they shouldn't be here - kill all variables and redirect to login... -if (!isset($_SESSION['user_id']) || !isset($_SESSION['signature']) || !isset($_SESSION['loggedIn']) || $_SESSION['loggedIn'] != true || $_SESSION['signature'] != md5($_SESSION['user_id'] . $_SERVER['HTTP_USER_AGENT'])) -{ -session_start(); -session_unset(); -session_destroy(); -header ("Refresh:3; url=login.php", true, 303); -echo "

You are not logged in!!!

"; -} -else -{ +if (getSessionStatus() == false) { +killSession(); +} else { //********** BEGIN CONTENT **********// echo "

Punch History

";