mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-26 14:36:06 +00:00
Merge branch 'master' of https://github.com/Shadowss/TravianZ
This commit is contained in:
@@ -63,6 +63,7 @@ $varmedal = $database->getProfileMedalAlly($_GET['aid']);
|
|||||||
<td><img src="../gpack/travian_default/img/t/<?=$medal['img']?>.jpg"></td>
|
<td><img src="../gpack/travian_default/img/t/<?=$medal['img']?>.jpg"></td>
|
||||||
<td>
|
<td>
|
||||||
<form action="../GameEngine/Admin/Mods/delallymedal.php" method="POST" style="margin:0">
|
<form action="../GameEngine/Admin/Mods/delallymedal.php" method="POST" style="margin:0">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
<input type="hidden" name="aid" value="<?=$_GET['aid']?>">
|
<input type="hidden" name="aid" value="<?=$_GET['aid']?>">
|
||||||
<input type="hidden" name="admid" value="<?=$_SESSION['id']?>">
|
<input type="hidden" name="admid" value="<?=$_SESSION['id']?>">
|
||||||
<button type="submit" name="medalid" value="<?=$medal['id']?>" class="medal-del" title="Delete">
|
<button type="submit" name="medalid" value="<?=$medal['id']?>" class="medal-del" title="Delete">
|
||||||
@@ -81,6 +82,7 @@ $varmedal = $database->getProfileMedalAlly($_GET['aid']);
|
|||||||
<td>Delete All</td>
|
<td>Delete All</td>
|
||||||
<td>
|
<td>
|
||||||
<form action="../GameEngine/Admin/Mods/delallymedalbyaid.php" method="POST" style="margin:0">
|
<form action="../GameEngine/Admin/Mods/delallymedalbyaid.php" method="POST" style="margin:0">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
<input type="hidden" name="admid" value="<?=$_SESSION['id']?>">
|
<input type="hidden" name="admid" value="<?=$_SESSION['id']?>">
|
||||||
<input type="hidden" name="aid" value="<?=$_GET['aid']?>">
|
<input type="hidden" name="aid" value="<?=$_GET['aid']?>">
|
||||||
<button type="submit" class="medal-del" title="Delete All">
|
<button type="submit" class="medal-del" title="Delete All">
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ $members = $database->getAllMember($aid);
|
|||||||
<div class="warn">⚠ All members will be removed from the alliance, permissions, diplomacy, logs and the alliance forum will be deleted. The action is irreversible!</div>
|
<div class="warn">⚠ All members will be removed from the alliance, permissions, diplomacy, logs and the alliance forum will be deleted. The action is irreversible!</div>
|
||||||
|
|
||||||
<form method="POST" action="../GameEngine/Admin/Mods/delAli.php" onsubmit="return confirm('Last warning: DELETE PERMANENTLY?');">
|
<form method="POST" action="../GameEngine/Admin/Mods/delAli.php" onsubmit="return confirm('Last warning: DELETE PERMANENTLY?');">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
<input type="hidden" name="aid" value="<?php echo $aid;?>">
|
<input type="hidden" name="aid" value="<?php echo $aid;?>">
|
||||||
<input type="hidden" name="admid" value="<?php echo $_SESSION['id'];?>">
|
<input type="hidden" name="admid" value="<?php echo $_SESSION['id'];?>">
|
||||||
<button type="submit" class="btn del">YES, DELETE</button>
|
<button type="submit" class="btn del">YES, DELETE</button>
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ $nummedals = $sql['Total'];
|
|||||||
|
|
||||||
|
|
||||||
<form action="../GameEngine/Admin/Mods/delallymedalbyweek.php" method="POST">
|
<form action="../GameEngine/Admin/Mods/delallymedalbyweek.php" method="POST">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||||
<table id="member">
|
<table id="member">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ $nummedals = $sql['Total'];
|
|||||||
|
|
||||||
|
|
||||||
<form action="../GameEngine/Admin/Mods/deletemedalbyweek.php" method="POST">
|
<form action="../GameEngine/Admin/Mods/deletemedalbyweek.php" method="POST">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||||
<table id="member">
|
<table id="member">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ textarea{width:100%;box-sizing:border-box;min-height:120px;padding:8px;border:1p
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="../GameEngine/Admin/Mods/editAli.php" method="POST">
|
<form action="../GameEngine/Admin/Mods/editAli.php" method="POST">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
<input type="hidden" name="aid" value="<?php echo $aid; ?>">
|
<input type="hidden" name="aid" value="<?php echo $aid; ?>">
|
||||||
<input type="hidden" name="admid" value="<?php echo $_SESSION['id']; ?>">
|
<input type="hidden" name="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
<td><img class="medal" src="../gpack/travian_default/img/t/'.$medal['img'].'.jpg"></td>
|
<td><img class="medal" src="../gpack/travian_default/img/t/'.$medal['img'].'.jpg"></td>
|
||||||
<td>
|
<td>
|
||||||
<form action="../GameEngine/Admin/Mods/medals.php" method="POST" style="margin:0">
|
<form action="../GameEngine/Admin/Mods/medals.php" method="POST" style="margin:0">
|
||||||
|
'.csrf_field().'
|
||||||
<input type="hidden" name="uid" value="'.$_GET['uid'].'">
|
<input type="hidden" name="uid" value="'.$_GET['uid'].'">
|
||||||
<input type="hidden" name="medalid" value="'.$medal['id'].'">
|
<input type="hidden" name="medalid" value="'.$medal['id'].'">
|
||||||
<button type="submit" class="medals-del" title="Delete medal">
|
<button type="submit" class="medals-del" title="Delete medal">
|
||||||
@@ -71,6 +72,7 @@
|
|||||||
echo '<tr class="avg-row"><td style="text-align:left"><b>Average Rank</b></td><td>'.$average.'</td><td></td><td></td><td>Delete All</td>
|
echo '<tr class="avg-row"><td style="text-align:left"><b>Average Rank</b></td><td>'.$average.'</td><td></td><td></td><td>Delete All</td>
|
||||||
<td>
|
<td>
|
||||||
<form action="../GameEngine/Admin/Mods/medals.php" method="POST" style="margin:0">
|
<form action="../GameEngine/Admin/Mods/medals.php" method="POST" style="margin:0">
|
||||||
|
'.csrf_field().'
|
||||||
<input type="hidden" name="uid" value="'.$_GET['uid'].'">
|
<input type="hidden" name="uid" value="'.$_GET['uid'].'">
|
||||||
<input type="hidden" name="userid" value="'.$id.'">
|
<input type="hidden" name="userid" value="'.$id.'">
|
||||||
<button type="submit" class="medals-del" title="Delete all medals">
|
<button type="submit" class="medals-del" title="Delete all medals">
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ if (empty($_SESSION['access']) || $_SESSION['access'] < 9) {
|
|||||||
die("Access Denied: You are not Admin!");
|
die("Access Denied: You are not Admin!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue #139: this Mod is POSTed to directly, so it must verify the CSRF token
|
||||||
|
// itself (it does not go through admin.php's central csrf_verify()).
|
||||||
|
require_once(__DIR__ . '/../csrf.php');
|
||||||
|
csrf_verify();
|
||||||
|
|
||||||
include_once("../../config.php");
|
include_once("../../config.php");
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ if (empty($_SESSION['access']) || $_SESSION['access'] < 9) {
|
|||||||
die("Access Denied: You are not Admin!");
|
die("Access Denied: You are not Admin!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue #139: this Mod is POSTed to directly, so it must verify the CSRF token
|
||||||
|
// itself (it does not go through admin.php's central csrf_verify()).
|
||||||
|
require_once(__DIR__ . '/../csrf.php');
|
||||||
|
csrf_verify();
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Autoloader path
|
// Autoloader path
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ if (empty($_SESSION['access']) || $_SESSION['access'] < 9) {
|
|||||||
die("Access Denied: You are not Admin!");
|
die("Access Denied: You are not Admin!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue #139: this Mod is POSTed to directly, so it must verify the CSRF token
|
||||||
|
// itself (it does not go through admin.php's central csrf_verify()).
|
||||||
|
require_once(__DIR__ . '/../csrf.php');
|
||||||
|
csrf_verify();
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Autoloader path
|
// Autoloader path
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ if (empty($_SESSION['access']) || $_SESSION['access'] < 9) {
|
|||||||
die("Access Denied: You are not Admin!");
|
die("Access Denied: You are not Admin!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue #139: this Mod is POSTed to directly, so it must verify the CSRF token
|
||||||
|
// itself (it does not go through admin.php's central csrf_verify()).
|
||||||
|
require_once(__DIR__ . '/../csrf.php');
|
||||||
|
csrf_verify();
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Autoloader path
|
// Autoloader path
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ if (empty($_SESSION['access']) || $_SESSION['access'] < 9) {
|
|||||||
die("Access Denied: You are not Admin!");
|
die("Access Denied: You are not Admin!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue #139: this Mod is POSTed to directly, so it must verify the CSRF token
|
||||||
|
// itself (it does not go through admin.php's central csrf_verify()).
|
||||||
|
require_once(__DIR__ . '/../csrf.php');
|
||||||
|
csrf_verify();
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Autoloader path
|
// Autoloader path
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ if (empty($_SESSION['access']) || $_SESSION['access'] < 9) {
|
|||||||
die("Access Denied: You are not Admin!");
|
die("Access Denied: You are not Admin!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue #139: this Mod is POSTed to directly, so it must verify the CSRF token
|
||||||
|
// itself (it does not go through admin.php's central csrf_verify()).
|
||||||
|
require_once(__DIR__ . '/../csrf.php');
|
||||||
|
csrf_verify();
|
||||||
|
|
||||||
include_once("../../config.php");
|
include_once("../../config.php");
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -11,6 +11,12 @@
|
|||||||
#################################################################################
|
#################################################################################
|
||||||
if (!isset($_SESSION)) session_start();
|
if (!isset($_SESSION)) session_start();
|
||||||
if($_SESSION['access'] < 9) die("Access Denied: You are not Admin!");
|
if($_SESSION['access'] < 9) die("Access Denied: You are not Admin!");
|
||||||
|
|
||||||
|
// Issue #139: this Mod is POSTed to directly, so it must verify the CSRF token
|
||||||
|
// itself (it does not go through admin.php's central csrf_verify()).
|
||||||
|
require_once(__DIR__ . '/../csrf.php');
|
||||||
|
csrf_verify();
|
||||||
|
|
||||||
include_once("../../Account.php");
|
include_once("../../Account.php");
|
||||||
|
|
||||||
// go max 5 levels up - we don't have folders that go deeper than that
|
// go max 5 levels up - we don't have folders that go deeper than that
|
||||||
@@ -34,10 +40,12 @@ elseif(isset($_POST['userid']) && !empty($_POST['userid']) && is_numeric($_POST[
|
|||||||
mysqli_query($database->dblink, "UPDATE ".TB_PREFIX."medal set del = 1 WHERE userid = ".$userID."");
|
mysqli_query($database->dblink, "UPDATE ".TB_PREFIX."medal set del = 1 WHERE userid = ".$userID."");
|
||||||
}
|
}
|
||||||
|
|
||||||
$admidID = (int) $_SESSION['id'];
|
$admid = (int) $_SESSION['id'];
|
||||||
$name = $database->getUserField($adminID, "name", 0);
|
$uid = (int) ($_POST['uid'] ?? 0);
|
||||||
|
$name = $database->escape((string) $database->getUserField($uid, "username", 0));
|
||||||
|
$medalLogId = isset($medalID) ? $medalID : 0;
|
||||||
//TODO: Make a dedicated method for logging
|
//TODO: Make a dedicated method for logging
|
||||||
mysqli_query($database->dblink, "INSERT INTO ".TB_PREFIX."admin_log values (0, $admid, 'Deleted medal id [#".$medalid."] from the user <a href=\'admin.php?p=player&uid=$uid\'>$name</a> ',".time().")");
|
mysqli_query($database->dblink, "INSERT INTO ".TB_PREFIX."admin_log values (0, $admid, 'Deleted medal id [#".$medalLogId."] from the user <a href=\'admin.php?p=player&uid=$uid\'>$name</a> ',".time().")");
|
||||||
|
|
||||||
header("Location: ../../../Admin/admin.php?p=player&uid=".$_POST['uid']."");
|
header("Location: ../../../Admin/admin.php?p=player&uid=".$uid);
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user