From 142bae139b8ca9ee93329aae1c2fb28c0d49e84d Mon Sep 17 00:00:00 2001 From: "K. Nobel" Date: Fri, 20 Jan 2017 12:14:05 +0100 Subject: [PATCH] Profile will now show the current users page when a username is not given in a get request. --- website/public/profile.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/website/public/profile.php b/website/public/profile.php index e35935b..f3f499b 100644 --- a/website/public/profile.php +++ b/website/public/profile.php @@ -42,12 +42,11 @@ function nicetime($date) { } if(empty($_GET["username"])) { - echo "User does not exist!"; - return; + $userID = $_SESSION["userID"]; +} else { + $userID = getUserID($_GET["username"]); } -$userID = getUserID($_GET["username"]); - $user = selectUser($userID); $profile_friends = selectAllFriends($userID); $profile_groups = selectAllUserGroups($userID);