Update of /cvsroot/openfirst/forum
In directory sc8-pr-cvs1:/tmp/cvs-serv7182/forum
Modified Files:
thread.php
Log Message:
Critical fix - put security checks removed in the previous audits back in. This bug would allow anyone to view an admin-only conversation :)
Index: thread.php
===================================================================
RCS file: /cvsroot/openfirst/forum/thread.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** thread.php 1 Jan 2004 21:55:57 -0000 1.7
--- thread.php 6 Jan 2004 14:38:20 -0000 1.8
***************
*** 52,55 ****
--- 52,66 ----
$sub = $forum;
+
+ //check to see if this forum is private
+ $qh = ofirst_dbquery("SELECT hidden FROM ofirst_forum WHERE name='".$forum."'");
+ if (ofirst_dbnum_rows($qh) != 0){
+ $hide = ofirst_dbfetch_object($qh);
+ if (($hide->hidden==1)&&($admin==false)){
+ echo("</p>You do not have permission to view this thread</p>");
+ die(include($footer));
+ }
+ }
+
$res = "";
while ($sub != "") {
***************
*** 78,85 ****
if(function_exists("emoticon_translate")){
echo(emoticon_translate($msg->Message));
! echo('<div><br><hr width=200 align=left>'.emoticon_translate($usersig).'</div>');
}else{
echo($msg->Message);
! echo('<div><br><hr width=200 align=left>'.$usersig.'</div>');
}
echo "</td></tr>";
--- 89,100 ----
if(function_exists("emoticon_translate")){
echo(emoticon_translate($msg->Message));
! if($usersig!=""){
! echo('<div><br><hr width=200 align=left>'.emoticon_translate($usersig).'</div>');
! }
}else{
echo($msg->Message);
! if($usersig!=""){
! echo('<div><br><hr width=200 align=left>'.$usersig.'</div>');
! }
}
echo "</td></tr>";
***************
*** 108,111 ****
--- 123,127 ----
if ($num != 0) {
+ echo('<div><a href="'.$basepath.'/forum/newpost.php?forumid='.urlencode($forum).'&replyto='.$reply.'">New Reply</a></div><br>');
echo("<table width=600><tr><th colspan=2>");
***************
*** 133,140 ****
if(function_exists("emoticon_translate")){
echo(emoticon_translate($msg->Message));
! echo('<div><br><hr width=200 align=left>'.emoticon_translate($usersig).'</div>');
}else{
echo($msg->Message);
! echo('<div><br><hr width=200 align=left>'.$usersig.'</div>');
}
echo "</div></td></tr>";
--- 149,160 ----
if(function_exists("emoticon_translate")){
echo(emoticon_translate($msg->Message));
! if($usersig!=""){
! echo('<div><br><hr width=200 align=left>'.emoticon_translate($usersig).'</div>');
! }
}else{
echo($msg->Message);
! if($usersig!=""){
! echo('<div><br><hr width=200 align=left>'.$usersig.'</div>');
! }
}
echo "</div></td></tr>";
|