From dd90648b098203e933cc6d7117beb1d346aab9e2 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sun, 22 Oct 2017 13:21:36 +0200 Subject: [PATCH] fix: immediate finish of all building progress redirects correctly --- GameEngine/Building.php | 6 +++--- Templates/Plus/7.tpl | 3 +-- build.php | 3 +-- todo.txt | 1 + 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/GameEngine/Building.php b/GameEngine/Building.php index 938c8157..6fdaf992 100755 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -765,7 +765,7 @@ class Building { return false; } - public function finishAll() { + public function finishAll($redirect_url = '') { global $database,$session,$logging,$village,$bid18,$bid10,$bid11,$technology,$_SESSION; if($session->access!=BANNED){ $finish = 0; @@ -832,13 +832,13 @@ class Building { } } } - header("Location: ".$session->referrer); + header("Location: ".($redirect_url ? $redirect_url : $session->referrer)); exit; }else{ header("Location: banned.php"); exit; } - } + } public function resourceRequired($id,$tid,$plus=1) { $name = "bid".$tid; diff --git a/Templates/Plus/7.tpl b/Templates/Plus/7.tpl index 00d74b59..5553a9be 100644 --- a/Templates/Plus/7.tpl +++ b/Templates/Plus/7.tpl @@ -1,7 +1,6 @@ access!=BANNED){ - $building->finishAll(); - header("Location: plus.php?id=3"); + $building->finishAll('plus.php?id=3'); exit; }else{ header("Location: banned.php"); diff --git a/build.php b/build.php index 9f05b095..6eecbcb1 100644 --- a/build.php +++ b/build.php @@ -369,8 +369,7 @@ if(isset($_GET['id']) or isset($_GET['gid']) or $route == 1 or isset($_GET['rout } if($_GET['buildingFinish'] == 1) { if($session->gold >= 2) { - $building->finishAll(); - header("Location: build.php?gid=".$_GET['id']."&ty=".$_GET['ty']); + $building->finishAll("build.php?gid=".$_GET['id']."&ty=".$_GET['ty']); exit; } } diff --git a/todo.txt b/todo.txt index 8c0ac5ba..24d784bf 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,5 @@ - allow sending Mass Message + System Message from Admin +- send mass message as Support rather than Multihunter - fix editing current task from Taskmaster -> number never match the edited quest after save - cannot delete a single medal in admin - add back buttons to Admin where there are not (like editing a user)