diff --git a/sections/forums/get_post.php b/sections/forums/get_post.php index 08e44d6b..496efd44 100644 --- a/sections/forums/get_post.php +++ b/sections/forums/get_post.php @@ -21,14 +21,15 @@ // Mainly $DB->query("SELECT - p.Body - FROM forums_posts as p - JOIN forums_topics as t on p.TopicID = t.ID - JOIN forums as f ON t.ForumID=f.ID - WHERE - p.ID='$PostID' AND - f.MinClassRead<='$LoggedUser[Class]'"); -list($Body) = $DB->next_record(MYSQLI_NUM); + p.Body, t.ForumID + FROM forums_posts as p JOIN forums_topics as t on p.TopicID = t.ID + WHERE p.ID='$PostID'"); +list($Body, $ForumID) = $DB->next_record(MYSQLI_NUM); + +// Is the user allowed to view the post? +if(!check_forumperm($ForumID)) { + error(0); +} // This gets sent to the browser, which echoes it wherever diff --git a/sections/user/takeedit.php b/sections/user/takeedit.php index a8953e0a..439d8ca1 100644 --- a/sections/user/takeedit.php +++ b/sections/user/takeedit.php @@ -247,6 +247,7 @@ $SQL .= "m.Paranoia='".db_string(serialize($Paranoia))."'"; if($ResetPassword) { + $ChangerIP = db_string($LoggedUser['IP']); $Secret=make_secret(); $PassHash=make_hash($_POST['new_pass_1'],$Secret); $SQL.=",m.Secret='".db_string($Secret)."',m.PassHash='".db_string($PassHash)."'";