Redirect to 404 from profile and group
This commit is contained in:
@@ -13,9 +13,16 @@
|
|||||||
|
|
||||||
include_once("../queries/group_page.php");
|
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"]);
|
$members = selectGroupMembers($group["groupID"]);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This view adds the main layout over the screen.
|
* This view adds the main layout over the screen.
|
||||||
* Header, menu, footer.
|
* Header, menu, footer.
|
||||||
|
|||||||
@@ -25,7 +25,12 @@ if(empty($_GET["username"])) {
|
|||||||
$userID = getUserID($_GET["username"]);
|
$userID = getUserID($_GET["username"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$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_friends = selectAllFriends($userID);
|
||||||
$profile_groups = selectAllUserGroups($userID);
|
$profile_groups = selectAllUserGroups($userID);
|
||||||
$showProfile = $user["showProfile"] || ($user["status"] == 'confirmed') || $_SESSION["userID"] == $userID;
|
$showProfile = $user["showProfile"] || ($user["status"] == 'confirmed') || $_SESSION["userID"] == $userID;
|
||||||
|
|||||||
@@ -33,7 +33,12 @@ function selectGroupByName($name) {
|
|||||||
if (!$stmt->execute()) {
|
if (!$stmt->execute()) {
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
return $stmt->fetch();
|
$row = $stmt->fetch();
|
||||||
|
if($row["groupID"] == null) {
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectGroupRole(int $groupID) {
|
function selectGroupRole(int $groupID) {
|
||||||
|
|||||||
@@ -101,7 +101,9 @@ function selectUser($me, $other) {
|
|||||||
|
|
||||||
$stmt->bindParam(':me', $me, PDO::PARAM_INT);
|
$stmt->bindParam(':me', $me, PDO::PARAM_INT);
|
||||||
$stmt->bindParam(':other', $other, PDO::PARAM_INT);
|
$stmt->bindParam(':other', $other, PDO::PARAM_INT);
|
||||||
$stmt->execute();
|
if(!$stmt->execute() || $stmt->rowCount() == 0) {
|
||||||
|
return False;
|
||||||
|
}
|
||||||
return $stmt->fetch();
|
return $stmt->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user