One Hat Cyber Team
Your IP :
104.23.243.246
Server IP :
104.21.51.23
Server :
Linux 128-201-239-36.cprapid.com 3.10.0-1160.41.1.el7.x86_64 #1 SMP Tue Aug 31 14:52:47 UTC 2021 x86_64
Server Software :
Apache
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
juscatamarca
/
www
/
juzgadosdepaz
/
admin
/
View File Name :
login.php
<?php declare(strict_types=1); require_once __DIR__ . '/../app/config/database.php'; require_once __DIR__ . '/../app/helpers/functions.php'; require_once __DIR__ . '/../app/helpers/auth.php'; if (admin_is_logged_in()) { redirect(APP_BASE . '/admin/index.php'); } $error = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $usuario = trim((string)($_POST['usuario'] ?? '')); $password = (string)($_POST['password'] ?? ''); if (!admin_verify_csrf($_POST['csrf_token'] ?? null)) { $error = 'La sesión del formulario expiró. Volvé a intentar.'; } elseif ($usuario === '' || $password === '') { $error = 'Completá usuario y contraseña.'; } else { try { $pdo = get_pdo(); $stmt = $pdo->prepare('SELECT id, nombre_usuario, nombre_completo, email, password_hash, activo FROM usuarios_admin WHERE nombre_usuario = :usuario LIMIT 1'); $stmt->execute([':usuario' => $usuario]); $row = $stmt->fetch(); if ($row && (int)$row['activo'] === 1 && password_verify($password, (string)$row['password_hash'])) { $up = $pdo->prepare('UPDATE usuarios_admin SET ultimo_login_at = NOW() WHERE id = :id'); $up->execute([':id' => (int)$row['id']]); admin_login($row); redirect(APP_BASE . '/admin/index.php'); } $error = 'Credenciales inválidas.'; } catch (Throwable $e) { $error = 'No se pudo iniciar sesión. Revisá la conexión a base de datos.'; } } } ?> <!DOCTYPE html> <html lang="es"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Login Admin · Justicia de Paz</title> <style> * { box-sizing: border-box; } body { margin: 0; min-height: 100vh; display: grid; place-items: center; font-family: "Segoe UI", Tahoma, Arial, sans-serif; background: linear-gradient(180deg, #0f172a, #111827); color: #e2e8f0; padding: 18px; } .card { width: 100%; max-width: 420px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); border-radius: 14px; padding: 20px; backdrop-filter: blur(8px); } h1 { margin: 0 0 6px; font-size: 24px; color: #fff; } p { margin: 0 0 14px; color: #cbd5e1; } label { display: block; margin: 10px 0 6px; font-size: 13px; font-weight: 700; } input { width: 100%; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(2,6,23,.55); color: #fff; padding: 10px; font-size: 14px; } button { margin-top: 14px; width: 100%; border: 0; border-radius: 8px; background: #2563eb; color: #fff; padding: 11px; font-weight: 700; cursor: pointer; } button:hover { background: #1d4ed8; } .error { margin-top: 10px; background: rgba(220, 38, 38, .2); border: 1px solid rgba(248, 113, 113, .55); color: #fecaca; border-radius: 8px; padding: 10px; font-size: 13px; } .muted { margin-top: 10px; font-size: 12px; color: #94a3b8; } </style> </head> <body> <form class="card" method="post" action=""> <?= admin_csrf_input() ?> <h1>Panel Administrador</h1> <p>Justicia de Paz · Catamarca</p> <label for="usuario">Usuario</label> <input id="usuario" name="usuario" type="text" autocomplete="username" required /> <label for="password">Contraseña</label> <input id="password" name="password" type="password" autocomplete="current-password" required /> <button type="submit">Ingresar</button> <?php if ($error !== ''): ?> <div class="error"><?= e($error) ?></div> <?php endif; ?> <div class="muted">Este panel administra el contenido público actual, sin cambiar su diseño.</div> </form> </body> </html>