Merge branch 'kevin-prototype' into 'master'

Redirect to 404 from profile and group

See merge request !190
This commit was merged in pull request #194.
This commit is contained in:
Lars van Hijfte
2017-02-02 16:47:06 +01:00
4 changed files with 25 additions and 11 deletions

View File

@@ -13,9 +13,16 @@
include_once("../queries/group_page.php");
$group = selectGroupByName($_GET["groupname"]);
if(!$group = selectGroupByName($_GET["groupname"])) {
header("HTTP/1.0 404 Not Found");
header("Location: error/404.php");
die();
}
$members = selectGroupMembers($group["groupID"]);
/*
* This view adds the main layout over the screen.
* Header, menu, footer.

View File

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