The start of client logins has begun, now can link a user with a client to allow client logins, clients can only view client.php there is more work to be done

This commit is contained in:
root
2019-05-27 12:28:41 -04:00
parent 889a749d88
commit e0e723bb9f
8 changed files with 48 additions and 12 deletions

View File

@@ -3,9 +3,15 @@
session_start();
if(!$_SESSION['logged']){
header("Location: login.php");
header("Location: logout.php");
die;
}
//Check to see if its a client if so sandbox them to just post.php or client.php.
if($_SESSION['client_id'] > 0 AND basename($_SERVER['PHP_SELF']) !== 'client.php' AND basename($_SERVER['PHP_SELF']) !== 'post.php'){
header("Location: logout.php");
die;
}
$session_user_id = $_SESSION['user_id'];
@@ -13,6 +19,7 @@
$row = mysqli_fetch_array($sql);
$session_name = $row['name'];
$session_avatar = $row['avatar'];
$session_client_id = $row['client_id'];
//Detects if using an apple device and uses apple maps instead of google
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
@@ -26,7 +33,6 @@
}
//Get unAcked Alert Count for the badge on the top nav
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('alert_id') AS num FROM alerts WHERE alert_ack_date = 0"));
$num_alerts = $row['num'];