PHP WebShell

Текущая директория: /var/www/bitcardoApp/user/security

Просмотр файла: revoke_device.php

<?php
require_once __DIR__ . '/../../config/bootstrap.php';
require_once __DIR__ . '/../../lib/csrf.php';
if (empty($_SESSION['user_id'])) { header('Location:/auth/login.php'); exit; }
csrf_verify_or_fail($_POST['csrf'] ?? null, '/auth/login.php');

$userId = (int)$_SESSION['user_id'];
$devId  = (int)($_POST['id'] ?? 0);

if ($devId > 0) {
  $u = $conn->prepare("UPDATE user_devices SET trusted=0, trusted_until=NOW() WHERE udev_id=? AND user_id=?");
  $u->bind_param('ii', $devId, $userId);
  $u->execute(); $u->close();
}

header('Location: /user/security/sessions.php'); exit;

Выполнить команду


Для локальной разработки. Не используйте в интернете!