Файл: pages/clan/hall-confirm.php
Строк: 83
<?php
// Physical module map v50.6: public URL stays clean while code lives in /pages.
if (!defined('GAME_ROOT')) define('GAME_ROOT', dirname(__DIR__, 2));
chdir(GAME_ROOT);
if (PHP_SAPI !== 'cli') { $_SERVER['PHP_SELF']='/hall-confirm.php'; $_SERVER['SCRIPT_NAME']='/hall-confirm.php'; }
/* Подтверждение отмены попытки рекорда. by Метриум (Стэлп) */
require_once './system/common.php'; require_once './system/functions.php'; require_once './system/user.php';
if(!$user){ header('Location:/'); exit; }
$scope=(string)($_REQUEST['scope']??'personal'); $code=(string)($_REQUEST['code']??'');
if(!in_array($scope,['personal','clan'],true)) $scope='personal';
$defs=$scope==='clan'?game_hall_clan_defs():game_hall_personal_defs(); $back=$scope==='clan'?'/hall-clan/':'/hall-personal/';
if(!isset($defs[$code])){ header('Location:'.$back); exit; }
$cm=game_hall_user_clan((int)$user['id']); if(!$cm){ header('Location:/clans/'); exit; }
$cid=(int)$cm['clan']; $entityId=$scope==='clan'?$cid:(int)$user['id'];
if($scope==='clan' && (int)$cm['rank']<4){ $_SESSION['err']='Отменить клановый рекорд может лидер или заместитель.'; header('Location:'.$back); exit; }
$attempt=game_hall_attempt_row($scope,$code,$entityId); if(!$attempt){ header('Location:'.$back); exit; }
if(($_SERVER['REQUEST_METHOD']??'GET')==='POST' && isset($_POST['confirm_cancel'])){
security_require_csrf(); game_hall_cancel_attempt($scope,$code,$entityId); $_SESSION['ok']='Попытка рекорда отменена.'; header('Location:'.$back); exit;
}
$title='Подтверждение'; require './system/h.php';
?>
<div class="menu"><a href="<?=$back?>">← <span class="yellow">Назад</span></a></div>
<div class="hall-slogan">Установи рекорд и увековечь своё имя в истории клана!</div>
<div class="hall-banner"><img src="/images/hall/records_banner.jpg" alt="Зал славы"></div>
<div class="hall-confirm-box">
<div class="hall-confirm-question">Вы уверены, что хотите отменить задание?</div>
<form method="post" action="/hall-confirm/" class="hall-confirm-form">
<?=security_csrf_field()?>
<input type="hidden" name="scope" value="<?=security_html($scope)?>"><input type="hidden" name="code" value="<?=security_html($code)?>">
<button class="hall-confirm-choice hall-confirm-yes" type="submit" name="confirm_cancel" value="1"><img src="/images/icon/ok.png" alt=""> Да, уверен</button>
</form>
<div class="hall-confirm-choice hall-confirm-no"><span class="hall-x">✖</span> <a href="<?=$back?>">Нет, отмена</a></div>
</div>
<?php require './system/f.php'; ?>