Fixed bug (not showing profile when on own profile)

This commit is contained in:
K. Nobel
2017-02-02 14:20:17 +01:00
parent 328ce69144
commit 4a7a91ecd9

View File

@@ -21,19 +21,14 @@ include_once("../queries/calcAge.php");
if(empty($_GET["username"])) { if(empty($_GET["username"])) {
$userID = $_SESSION["userID"]; $userID = $_SESSION["userID"];
$showProfile = True;
} else { } else {
$userID = getUserID($_GET["username"]); $userID = getUserID($_GET["username"]);
$showProfile = False;
} }
$user = selectUser($_SESSION["userID"], $userID); $user = selectUser($_SESSION["userID"], $userID);
$profile_friends = selectAllFriends($userID); $profile_friends = selectAllFriends($userID);
$profile_groups = selectAllUserGroups($userID); $profile_groups = selectAllUserGroups($userID);
$showProfile = $showProfile || $user["showProfile"] || ($user["status"] == 'confirmed'); $showProfile = $user["showProfile"] || ($user["status"] == 'confirmed') || $_SESSION["userID"] == $userID;
echo " friendship status: " . $user["status"];
echo " showprofile: $showProfile";
echo " userID: " . $user["userID"];
if ($userID == $_SESSION["userID"]) { if ($userID == $_SESSION["userID"]) {