diff --git a/website/public/edit_friendship.php b/website/public/API/edit_friendship.php similarity index 86% rename from website/public/edit_friendship.php rename to website/public/API/edit_friendship.php index d88e264..52aacf5 100644 --- a/website/public/edit_friendship.php +++ b/website/public/API/edit_friendship.php @@ -1,7 +1,8 @@ prepare(" + SELECT + `email`, + `role` + FROM + `user` + WHERE + `userID` = :userID + "); + $checkHash->bindParam(":userID", $_GET["u"]); + $checkHash->execute(); + $result = $checkHash->fetch(); + $email = $result["email"]; + $role = $result["role"]; + if ($role == "unconfirmed") { + doActivate($email); + } else { + echo "Ongeldige link."; + } + +} else { + echo "Ongeldige link."; +} + +function doActivate(string $email) { + if (password_verify($email, $_GET["h"])) { + $confirmUser = $GLOBALS["db"]->prepare(" + UPDATE + `user` + SET + `role` = :role + WHERE + `userID` = :userID + "); + $confirmUser->bindValue(":role", "user"); + $confirmUser->bindParam(":userID", $_GET["u"]); + $confirmUser->execute(); + if ($confirmUser->rowCount()) { + echo "Email bevestigd
+ U wordt automatisch doorgestuurd naar de login pagina over 5 seconden. "; + header("refresh:5;url=login.php"); + } + } else { + echo "Ongeldige link."; + } +} \ No newline at end of file diff --git a/website/public/js/notifications.js b/website/public/js/notifications.js index e3476b2..afcaca0 100644 --- a/website/public/js/notifications.js +++ b/website/public/js/notifications.js @@ -1,8 +1,18 @@ function showFriendNotifications(notifications) { $("#friendrequestslist").html(""); for (i in notifications) { + var outgoing = ""; + if (notifications[i].friend_state == "3") { + outgoing = " \ + \ + "; + } + $("#friendrequestslist").append(" \ -
  • \ +
  • \
    \ \
    \ +
    \ +
    \ + \ + "+ outgoing +" \ + \ + \ +
    \
  • \ "); } @@ -22,10 +44,10 @@ function showChatNotifications(notifications) { $("#unreadChatlist").html(""); for (i in notifications) { $("#unreadChatlist").append(" \ -
  • \ +
  • \ \
  • - "; + "; + } + + $chatID = $_GET["chatID"]; + if (isset($chatID) && $chatID != "") { + echo ""; } ?> diff --git a/website/views/loadFriends.php b/website/views/loadFriends.php new file mode 100644 index 0000000..b4cbaca --- /dev/null +++ b/website/views/loadFriends.php @@ -0,0 +1,3 @@ +fetchAll()); \ No newline at end of file diff --git a/website/views/login_head.php b/website/views/login_head.php index e983fab..e831cd2 100644 --- a/website/views/login_head.php +++ b/website/views/login_head.php @@ -7,7 +7,7 @@ - - + + diff --git a/website/views/profile.php b/website/views/profile.php index d74f999..3719ff1 100644 --- a/website/views/profile.php +++ b/website/views/profile.php @@ -5,6 +5,7 @@
    +

    diff --git a/website/views/register-view.php b/website/views/register-view.php index 4c660c9..f970a6f 100644 --- a/website/views/register-view.php +++ b/website/views/register-view.php @@ -96,7 +96,7 @@
    - +