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

@@ -33,7 +33,12 @@ function selectGroupByName($name) {
if (!$stmt->execute()) {
return False;
}
return $stmt->fetch();
$row = $stmt->fetch();
if($row["groupID"] == null) {
return False;
}
return $row;
}
function selectGroupRole(int $groupID) {

View File

@@ -101,7 +101,9 @@ function selectUser($me, $other) {
$stmt->bindParam(':me', $me, PDO::PARAM_INT);
$stmt->bindParam(':other', $other, PDO::PARAM_INT);
$stmt->execute();
if(!$stmt->execute() || $stmt->rowCount() == 0) {
return False;
}
return $stmt->fetch();
}
@@ -120,7 +122,7 @@ function selectAllUserGroups($userID) {
`group_page`.`groupID` = `group_member`.`groupID`
WHERE
`userID` = :userID AND
`role` = 'member'
`role` IN ('member', 'mod', 'admin')
");
$stmt->bindParam(':userID', $userID, PDO::PARAM_INT);