prepare(" SELECT id, first_name, email_verified FROM users WHERE email = ? AND deleted_at IS NULL "); $stmt->execute([$email]); $user = $stmt->fetch(); if (!$user) { // Per sicurezza, non rivelare se l'email esiste $success = true; } elseif ($user['email_verified']) { $error = 'Questo account è già stato verificato. Puoi effettuare il login.'; } else { // Genera nuovo token $email_token = bin2hex(random_bytes(32)); $token_expires = date('Y-m-d H:i:s', strtotime('+24 hours')); // Aggiorna token $stmt = $pdo->prepare(" UPDATE users SET email_token = ?, email_token_expires = ?, updated_at = NOW() WHERE id = ? "); $stmt->execute([$email_token, $token_expires, $user['id']]); // Log attività $stmt = $pdo->prepare(" INSERT INTO activity_log (user_id, action, description, ip_address, user_agent, created_at) VALUES (?, 'resend_verification', 'Richiesto nuovo link verifica email', ?, ?, NOW()) "); $stmt->execute([ $user['id'], $_SERVER['REMOTE_ADDR'] ?? null, $_SERVER['HTTP_USER_AGENT'] ?? null ]); // Invia email $verify_url = SITE_URL . "/verify_email.php?token=" . $email_token; $subject = "Conferma il tuo account su " . SITE_NAME; $body = "

Nuovo Link di Verifica

Ciao " . htmlspecialchars($user['first_name']) . ",

Hai richiesto un nuovo link per verificare il tuo account su " . SITE_NAME . ".

Per completare la registrazione e attivare il tuo account, clicca sul pulsante qui sotto:

✅ Conferma Email

Oppure copia e incolla questo link nel tuo browser:
" . $verify_url . "

⏰ Importante: Questo link è valido per 24 ore. Questo nuovo link sostituisce quello precedente.

Se non hai richiesto questo link, ignora questa email e il tuo account rimarrà non verificato.

A presto!
Il team di " . SITE_NAME . "

"; send_email($email, $subject, $body); $success = true; } } catch (PDOException $e) { $error = 'Errore durante l\'invio. Riprova più tardi.'; error_log("Resend verification error: " . $e->getMessage()); } } } ?> Re-Invio Verifica Email - <?php echo SITE_NAME; ?>

📧 Re-Invio Email di Verifica

✅ Email Inviata!

Se l'email è registrata nel nostro sistema, riceverai un nuovo link di verifica.

Controlla la tua casella email (e la cartella spam). Il link è valido per 24 ore.

← Torna al Login

Inserisci la tua email per ricevere un nuovo link di verifica