⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
china-democracyparty.com
/
2
/
includes
/
View File Name :
functions.php
<?php // includes/functions.php if (session_status() === PHP_SESSION_NONE) { session_start(); } function h($s){ return htmlspecialchars($s ?? '', ENT_QUOTES, 'UTF-8'); } function csrf_token() { if (empty($_SESSION['csrf'])) { $_SESSION['csrf'] = bin2hex(random_bytes(16)); } return $_SESSION['csrf']; } function check_csrf() { if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!isset($_POST['csrf']) || !hash_equals($_SESSION['csrf'] ?? '', $_POST['csrf'])) { http_response_code(400); die('Bad CSRF token'); } } } function is_logged_in(){ return !empty($_SESSION['admin_id']); } function require_login(){ if(!is_logged_in()){ header('Location: /admin/login.php'); exit; } } ?>