From 47f8750fd7fb18c2583b603090282b63de7170f5 Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Mon, 10 Aug 2020 17:48:53 +0100 Subject: [PATCH] :bug: Fix deciding if user is authorised Signed-off-by: Luke Tainton --- app/public/actions/addsub.php | 6 +++++- app/public/actions/delsub.php | 6 +++++- app/public/editsub.php | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/public/actions/addsub.php b/app/public/actions/addsub.php index df448ed..9007390 100644 --- a/app/public/actions/addsub.php +++ b/app/public/actions/addsub.php @@ -4,7 +4,11 @@ $request = get_request($db, $_POST['rid']); $authorised_users = get_subscribers($db, $request); - $is_authorised = if ($_SESSION['uuid'] == $request['created_by']) {return true} else {return false}; + if ($_SESSION['uuid'] == $request['created_by']) { + $is_authorised = true; + } else { + $is_authorised = false; + }; // Add subscriber if ($is_authorised == true) { diff --git a/app/public/actions/delsub.php b/app/public/actions/delsub.php index f88787e..dade70c 100644 --- a/app/public/actions/delsub.php +++ b/app/public/actions/delsub.php @@ -4,7 +4,11 @@ $request = get_request($db, $_POST['rid']); $authorised_users = get_subscribers($db, $request); - $is_authorised = if ($_SESSION['uuid'] == $request['created_by']) {return true} else {return false}; + if ($_SESSION['uuid'] == $request['created_by']) { + $is_authorised = true; + } else { + $is_authorised = false; + }; if (!empty($_POST['delSubSelector'])) { $subs_to_remove = implode(",", $_POST['delSubSelector']); diff --git a/app/public/editsub.php b/app/public/editsub.php index 1280be6..83d6216 100644 --- a/app/public/editsub.php +++ b/app/public/editsub.php @@ -4,7 +4,11 @@ $request = get_request($db, $_GET['rid']); $authorised_users = get_subscribers($db, $request); - $is_authorised = if ($_SESSION['uuid'] == $request['created_by']) {return true} else {return false}; + if ($_SESSION['uuid'] == $request['created_by']) { + $is_authorised = true; + } else { + $is_authorised = false; + }; $all_users = get_all_users($db);