diff --git a/admin/profile.php b/admin/profile.php index 8fd1bb9..cf1c217 100644 --- a/admin/profile.php +++ b/admin/profile.php @@ -86,6 +86,65 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) { } } +// Processa test invio email +if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['test_email'])) { + $test_email = sanitize_input($_POST['test_email_address'] ?? ''); + + if (empty($test_email) || !validate_email($test_email)) { + $error = 'Inserisci un indirizzo email valido'; + } else { + $subject = "Test Email - " . SITE_NAME; + $body = " + + + + + +
+
+

✅ Test Email Configurazione SMTP

+
+
+

Congratulazioni!

+

La configurazione SMTP funziona correttamente.

+

Hai ricevuto questa email di test da " . SITE_NAME . "

+
+ Dettagli configurazione:
+ Host: " . SMTP_HOST . "
+ Port: " . SMTP_PORT . "
+ Username: " . SMTP_USERNAME . "
+ Encryption: " . SMTP_ENCRYPTION . " +
+

Ora il sistema è pronto per inviare email agli utenti per:

+ +
+
+ + + "; + + if (send_email($test_email, $subject, $body)) { + set_flash_message('success', '✅ Email di test inviata con successo a ' . htmlspecialchars($test_email) . '! Controlla la casella di posta.'); + header('Location: profile.php'); + exit; + } else { + $error = '❌ Errore durante l\'invio dell\'email. Verifica le impostazioni SMTP in config.php'; + } + } +} + ?> @@ -241,6 +300,36 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) { + +
+
+

📧 Test Invio Email

+
+
+

+ Verifica che la configurazione SMTP funzioni correttamente inviando una email di test. +

+
+
+ + + Riceverai una email di test a questo indirizzo +
+ + +
+
+
+
diff --git a/lesson.php b/lesson.php index 7e32854..674c3b0 100644 --- a/lesson.php +++ b/lesson.php @@ -134,30 +134,67 @@ $can_view = $lesson['is_demo'] || $user_owns; style="border-radius: 8px;"> - + 'video/mp4', - 'webm' => 'video/webm', - 'ogg' => 'video/ogg', - 'mov' => 'video/quicktime' - ]; - $mime_type = $mime_types[$extension] ?? 'video/mp4'; + // Usa lo stream protetto per i video locali + $stream_url = SITE_URL . '/stream_video.php?lesson_id=' . $lesson_id; ?> -