-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_email.php
More file actions
33 lines (29 loc) · 952 Bytes
/
Copy pathverify_email.php
File metadata and controls
33 lines (29 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* Weryfikacja emaila użytkownika
* Ekipowo.pl - System zarządzania subdomenami
*/
require_once 'config/config.php';
require_once 'classes/User.php';
// Sprawdź czy token został podany
if (!isset($_GET['token']) || empty($_GET['token'])) {
set_flash_message('error', 'Nieprawidłowy link weryfikacyjny.');
header('Location: /login.php');
exit;
}
$token = sanitize_input($_GET['token']);
$user = new User();
try {
if ($user->verifyEmail($token)) {
set_flash_message('success', 'Twoje konto zostało pomyślnie zweryfikowane! Możesz się teraz zalogować.');
header('Location: /login.php');
} else {
set_flash_message('error', 'Błąd podczas weryfikacji konta. Spróbuj ponownie lub skontaktuj się z administratorem.');
header('Location: /login.php');
}
} catch (Exception $e) {
set_flash_message('error', $e->getMessage());
header('Location: /login.php');
}
exit;
?>