From 0e425f512facf992eeaa145dc333bcee00bd1aae Mon Sep 17 00:00:00 2001 From: Catalin Novgorodschi Date: Tue, 9 Jun 2026 08:04:17 +0300 Subject: [PATCH] Fix deletion user Fix deletion user code backend --- Admin/Templates/deletion.tpl | 46 ++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/Admin/Templates/deletion.tpl b/Admin/Templates/deletion.tpl index 081976c2..e17059e9 100644 --- a/Admin/Templates/deletion.tpl +++ b/Admin/Templates/deletion.tpl @@ -18,15 +18,24 @@ ## --------------------------------------------------------------------------- ## ################################################################################# include_once("../GameEngine/Ranking.php"); -if($_GET['uid']) { + +if(isset($_GET['uid']) && (int)$_GET['uid'] > 0) { $uid = (int)$_GET['uid']; + $target = $database->getUserArray($uid, 1); + + if(!$target) { + include("404.tpl"); + exit; + } + $varray = $database->getProfileVillages($uid); - if($user) { - $totalpop = 0; - foreach($varray as $vil) { $totalpop += $vil['pop']; } - $ranking->procRankArray(); - $rank = $ranking->getUserRank($user['id']); - $villages = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT COUNT(*) as Total FROM ".TB_PREFIX."vdata WHERE owner = $uid"), MYSQLI_ASSOC)['Total']; + $totalpop = 0; + foreach($varray as $vil) { $totalpop += $vil['pop']; } + + $ranking->procRankArray(); + $rank = $ranking->getUserRank($uid); + + $villages = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT COUNT(*) as Total FROM ".TB_PREFIX."vdata WHERE owner = $uid"), MYSQLI_ASSOC)['Total']; ?>