diff --git a/website/public/API/deletePost.php b/website/public/API/deletePost.php index fffadf5..37f89a1 100644 --- a/website/public/API/deletePost.php +++ b/website/public/API/deletePost.php @@ -3,10 +3,10 @@ session_start(); require_once "../../queries/post.php"; require_once "../../queries/user.php"; - -if (isset($_SESSION["userID"]) and - getRoleByID($_SESSION["userID"]) != 'frozen' and - getRoleByID($_SESSION["userID"]) != 'banned') { +if (!isset($_SESSION["userID"])) { + echo "logged out"; +} else if (getRoleByID($_SESSION["userID"]) != 'frozen' and + getRoleByID($_SESSION["userID"]) != 'banned') { if (empty($_POST["postID"]) or empty($_SESSION["userID"])) { header('HTTP/1.1 500 Non enough arguments'); diff --git a/website/public/API/postComment.php b/website/public/API/postComment.php index 3864cc8..c9f8a53 100644 --- a/website/public/API/postComment.php +++ b/website/public/API/postComment.php @@ -7,10 +7,10 @@ require_once("../../queries/connect.php"); require_once("../../queries/checkInput.php"); require_once("../../queries/user.php"); - -if (isset($_SESSION["userID"]) && - getRoleByID($_SESSION["userID"]) != 'frozen' && - getRoleByID($_SESSION["userID"]) != 'banned') { +if (!isset($_SESSION["userID"])) { + echo "logged out"; +} else if (getRoleByID($_SESSION["userID"]) != 'frozen' && + getRoleByID($_SESSION["userID"]) != 'banned') { if ($_POST['button'] == 'reaction') { if (empty($_POST['newcomment-content'])) { echo 0; diff --git a/website/public/API/postPost.php b/website/public/API/postPost.php index 241bda6..2d703d3 100644 --- a/website/public/API/postPost.php +++ b/website/public/API/postPost.php @@ -8,9 +8,10 @@ require_once("../../queries/connect.php"); require_once("../../queries/checkInput.php"); require_once("../../queries/user.php"); -if (isset($_SESSION["userID"]) && - getRoleByID($_SESSION["userID"]) != 'frozen' && - getRoleByID($_SESSION["userID"]) != 'banned') { +if (!isset($_SESSION["userID"])) { + echo "logged out"; +} else if (getRoleByID($_SESSION["userID"]) != 'frozen' && + getRoleByID($_SESSION["userID"]) != 'banned') { if (empty($_SESSION["userID"])) { header('HTTP/1.1 500 Non enough arguments'); diff --git a/website/public/API/sendMessage.php b/website/public/API/sendMessage.php index c6e3231..a2d411b 100644 --- a/website/public/API/sendMessage.php +++ b/website/public/API/sendMessage.php @@ -7,9 +7,10 @@ require_once("../../queries/checkInput.php"); require_once("../../queries/user.php"); // Check if the user is allowed to send a message. -if (isset($_SESSION["userID"]) && - getRoleByID($_SESSION["userID"]) != 'frozen' && - getRoleByID($_SESSION["userID"]) != 'banned') { +if (!isset($_SESSION["userID"])) { + echo "logged out"; +} else if (getRoleByID($_SESSION["userID"]) != 'frozen' && + getRoleByID($_SESSION["userID"]) != 'banned') { if (!empty(test_input($_POST["destination"])) && !empty(test_input($_POST["content"])) ) { diff --git a/website/public/js/chat.js b/website/public/js/chat.js index a3ff430..f431b91 100644 --- a/website/public/js/chat.js +++ b/website/public/js/chat.js @@ -43,6 +43,8 @@ function sendMessage() { ).done(function(response) { if (response == "frozen") { alert("Je account is bevroren, dus je kan niet chat berichten versturen. Contacteer een admin als je denkt dat dit onjuist is."); + } else if (response == "logged out") { + window.location.href = "login.php?url=" + window.location.pathname; } // Load messages if the message has been send, so it shows in the chat. loadMessages(); diff --git a/website/public/js/friendButtons.js b/website/public/js/friendButtons.js index 47c476a..87222e9 100644 --- a/website/public/js/friendButtons.js +++ b/website/public/js/friendButtons.js @@ -19,24 +19,24 @@ function placeFriendButtons() { case "0": value1 = "request"; class1 = "green"; - text1 = "Bevriend"; - icon1 = "fa-handshake-o"; + text1 = "Word vrienden"; + icon1 = "fa-user-plus"; break; case "1": value1 = userID; class1 = "green"; text1 = "Chat"; - icon1 = "fa-comment-o"; + icon1 = "fa-comment"; value2 = "delete"; class2 = "red"; - text2 = "Verwijder"; - icon2 = "fa-times"; + text2 = "Ontvriend"; + icon2 = "fa-user-times"; break; case "2": value1 = "delete"; class1 = "red"; text1 = "Trek verzoek in"; - icon1 = "fa-cross"; + icon1 = "fa-times"; break; case "3": value1 = "accept"; @@ -51,16 +51,18 @@ function placeFriendButtons() { } $buttonContainer.append( - ""); + "
"); $buttonContainer.append( - ""); + ""); - $buttonContainer.children().click(function() { + $buttonContainer.find("button").click(function() { if (isNaN(this.value)) editFriendship(userID, this.value); else if (this.value != "") diff --git a/website/public/js/groupButtons.js b/website/public/js/groupButtons.js index 549277d..caf3ab8 100644 --- a/website/public/js/groupButtons.js +++ b/website/public/js/groupButtons.js @@ -5,23 +5,23 @@ function placeGroupButtons() { if (data == 'none') { $buttonContainer.append( - "