Mejoras de Seguridad en home
This commit is contained in:
@@ -2,8 +2,18 @@
|
|||||||
require_once __DIR__ . '/../../config/database.php';
|
require_once __DIR__ . '/../../config/database.php';
|
||||||
$conn = getConnection();
|
$conn = getConnection();
|
||||||
|
|
||||||
|
// Cabeceras de seguridad
|
||||||
|
header("X-Frame-Options: DENY");
|
||||||
|
header("X-Content-Type-Options: nosniff");
|
||||||
|
header("X-XSS-Protection: 1; mode=block");
|
||||||
|
header("Referrer-Policy: no-referrer");
|
||||||
|
header("Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com; script-src 'self' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com; img-src 'self' data:;");
|
||||||
|
|
||||||
$sql = "SELECT TOP 1 * FROM configuracion_sistema";
|
$sql = "SELECT TOP 1 * FROM configuracion_sistema";
|
||||||
$stmt = sqlsrv_query($conn, $sql);
|
$stmt = sqlsrv_prepare($conn, $sql);
|
||||||
|
if (!$stmt || !sqlsrv_execute($stmt)) {
|
||||||
|
die("Error al ejecutar la consulta de configuración.");
|
||||||
|
}
|
||||||
$config = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC);
|
$config = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC);
|
||||||
|
|
||||||
// Variables con valores por defecto
|
// Variables con valores por defecto
|
||||||
@@ -111,11 +121,22 @@ $mensajeMantenimiento = $config['mensaje_mantenimiento'] ?? 'El sistema se encue
|
|||||||
|
|
||||||
<!-- ALERTA DE MANTENIMIENTO -->
|
<!-- ALERTA DE MANTENIMIENTO -->
|
||||||
<?php if ($mantenimiento): ?>
|
<?php if ($mantenimiento): ?>
|
||||||
<div class="container mt-4">
|
<div id="bloqueo-mantenimiento" style="
|
||||||
<div class="alert alert-danger text-center" role="alert">
|
position: fixed;
|
||||||
<i class="fas fa-triangle-exclamation me-2"></i>
|
top: 0; left: 0;
|
||||||
<?= htmlspecialchars($mensajeMantenimiento) ?>
|
width: 100%; height: 100%;
|
||||||
</div>
|
background: rgba(255, 255, 255, 0.95);
|
||||||
|
z-index: 9999;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
text-align: center;
|
||||||
|
font-family: sans-serif;
|
||||||
|
">
|
||||||
|
<i class="fas fa-tools fa-3x mb-3 text-danger"></i>
|
||||||
|
<h2>Sistema en Mantenimiento</h2>
|
||||||
|
<p><?= htmlspecialchars($mensajeMantenimiento) ?></p>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user