From e0e723bb9f87dd9f7068239404569ca08222e9a5 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 May 2019 12:28:41 -0400 Subject: [PATCH] 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 --- add_user_modal.php | 6 +++--- check_login.php | 10 ++++++++-- client_side_nav.php | 4 +++- login.php | 10 ++++++++-- logout.php | 3 --- post.php | 3 ++- test.php | 19 +++++++++++++++++++ users.php | 5 +++++ 8 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 test.php diff --git a/add_user_modal.php b/add_user_modal.php index a61c90b9..17dcfa00 100644 --- a/add_user_modal.php +++ b/add_user_modal.php @@ -16,8 +16,8 @@
- + - + 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']; diff --git a/client_side_nav.php b/client_side_nav.php index c897c5e1..f7a37652 100644 --- a/client_side_nav.php +++ b/client_side_nav.php @@ -6,7 +6,8 @@

- + + 0){ ?> +