19 lines
454 B
PHP
19 lines
454 B
PHP
<?php
|
|
require_once '../config/db.php';
|
|
|
|
// Verificar si el usuario está logueado
|
|
function verificarAuth() {
|
|
if (!isset($_SESSION['admin_id'])) {
|
|
header('Location: login.php');
|
|
exit;
|
|
}
|
|
}
|
|
|
|
// Obtener datos del admin logueado
|
|
function getAdminActual() {
|
|
global $pdo;
|
|
$stmt = $pdo->prepare("SELECT id, nombre, email FROM admin_users WHERE id = ?");
|
|
$stmt->execute([$_SESSION['admin_id']]);
|
|
return $stmt->fetch();
|
|
}
|
|
?>
|