mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-10 22:56:07 +00:00
Alliance fixes part 2
+Public forums are now displayed for every player on the server +Fixed some security bugs that permitted to create thread and posts to private forums +Fixed some general bugs
This commit is contained in:
+6
-34
@@ -29,42 +29,14 @@ if(isset($_GET['newdid'])) {
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['s'])){
|
||||
$automation->isWinner();
|
||||
}
|
||||
if(isset($_GET['s'])) $automation->isWinner();
|
||||
|
||||
if(isset($_GET['fid'])){
|
||||
$fid = preg_replace("/[^0-9]/","",$_GET['fid']);
|
||||
$forum = mysqli_query($database->dblink,"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid."");
|
||||
$forum_type = mysqli_fetch_array($forum);
|
||||
if(!empty($forum_type['forum_name']) && $forum_type['forum_area'] == 0){
|
||||
if($forum_type['alliance'] != $session->alliance){
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}else if(isset($_GET['fid2'])){
|
||||
$fid = preg_replace("/[^0-9]/","",$_GET['fid2']);
|
||||
$forum = mysqli_query($database->dblink,"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid."");
|
||||
if (!empty($forum)) {
|
||||
$forum_type = mysqli_fetch_array($forum);
|
||||
if(isset($_GET['fid']) || isset($_GET['fid2'])){
|
||||
$fid = preg_replace("/[^0-9]/","",!empty($_GET['fid']) ? $_GET['fid'] : $_GET['fid2']);
|
||||
$forum_type = reset($database->ForumCatEdit($fid));
|
||||
if (!empty($forum_type)) {
|
||||
if(!empty($forum_type['forum_name']) && $forum_type['forum_area'] != 1){
|
||||
if($forum_type['forum_area'] == 0){
|
||||
if($forum_type['alliance'] != $session->alliance){
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
}
|
||||
}else if($forum_type['forum_area'] == 2){
|
||||
if($forum_type['alliance'] != $session->alliance){
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
}
|
||||
}else if($forum_type['forum_area'] == 3){
|
||||
if($forum_type['alliance'] != $session->alliance){
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
if($forum_type['alliance'] != $session->alliance){
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user