Add password reset functionality and SMTP mailer class

- Implemented reset-password.php for users to reset their passwords securely.
- Added validation for reset tokens and password strength checks.
- Created mailer.php to handle sending emails via SMTP, including password reset and invitation emails.
- Integrated responsive HTML email templates for better user experience.
This commit is contained in:
2026-09-10 09:57:53 +02:00
parent d4fd706eca
commit a7aad57e0b
10 changed files with 1248 additions and 5 deletions
+11
View File
@@ -31,6 +31,17 @@ CREATE TABLE IF NOT EXISTS `invites` (
CONSTRAINT `fk_invites_user` FOREIGN KEY (`created_by_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `password_resets` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`email` VARCHAR(191) NOT NULL,
`token` VARCHAR(64) NOT NULL UNIQUE,
`expires_at` DATETIME NOT NULL,
`used_at` DATETIME NULL,
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
INDEX (`email`),
INDEX (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `daily_plans` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`user_id` INT NOT NULL,