Initial commit of the Asset Management System, including project structure, Docker configuration, database migrations, and core application files. Added user authentication, asset management features, and basic UI components.

This commit is contained in:
2025-08-22 21:41:02 +02:00
parent b43a98f0ec
commit 677f70a19c
52 changed files with 5186 additions and 2 deletions

View File

@@ -0,0 +1,45 @@
<?php
namespace App\Models;
use App\Core\Database;
class PasswordReset
{
private Database $database;
public function __construct(Database $database)
{
$this->database = $database;
}
public function create(array $data): int
{
return $this->database->insert('password_resets', $data);
}
public function findByToken(string $token): ?array
{
return $this->database->fetch(
"SELECT * FROM password_resets WHERE token = :token",
['token' => $token]
);
}
public function delete(int $id): bool
{
return $this->database->delete('password_resets', 'id = :id', ['id' => $id]) > 0;
}
public function deleteExpired(): int
{
return $this->database->query(
"DELETE FROM password_resets WHERE expires_at < NOW()"
)->rowCount();
}
public function deleteByUserId(int $userId): int
{
return $this->database->delete('password_resets', 'user_id = :user_id', ['user_id' => $userId]);
}
}