Primer version funcional

This commit is contained in:
Administrador Ibiza
2025-12-29 23:37:11 -06:00
commit 5289fd4133
294 changed files with 111418 additions and 0 deletions

25
login.php Executable file
View File

@@ -0,0 +1,25 @@
<?php
session_start();
require_once __DIR__ . '/config/config.php';
require_once __DIR__ . '/core/Database.php';
require_once __DIR__ . '/core/Auth.php';
require_once __DIR__ . '/models/User.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = trim($_POST['username'] ?? '');
$password = $_POST['password'] ?? '';
$user = User::findByUsername($username);
if ($user && password_verify($password, $user['password'])) {
Auth::login($user);
header('Location: /dashboard.php');
exit;
} else {
$error = 'Credenciales incorrectas';
}
}
require_once __DIR__ . '/views/auth/login.php';