@@ -690,6 +701,8 @@ function validateForm(event) {
$reservas_duplicadas = 0;
$erros = [];
$num_semanas = 0;
+ $db->begin_transaction();
+
// Create reservations for each week until we pass the end date
$current_date = $first_date;
@@ -740,6 +753,13 @@ function validateForm(event) {
}
// Send email notification to the user if any reservations were created
+ if (!empty($erros)) {
+ $db->rollback();
+ $reservas_criadas = 0;
+ } else {
+ $db->commit();
+ }
+
if ($reservas_criadas > 0) {
sendRecurringWeeklyReservationsEmail(
$db,
diff --git a/login/index.php b/login/index.php
index 0148806..a00f38e 100644
--- a/login/index.php
+++ b/login/index.php
@@ -1,8 +1,13 @@
⚠️ MODO DE DESENVOLVIMENTO - Dados de teste | Base de dados de desenvolvimento
' : '';
- $content = $devModeBanner . '
Verificação de Segurança
Introduza o código do seu autenticador para prosseguir.
' . (!empty($localAuthError) ? '
' . htmlspecialchars($localAuthError) . '
' : '') . '
';
+ $content = $devModeBanner . '
Verificação de Segurança
Introduza o código do seu autenticador para prosseguir.
' . (!empty($localAuthError) ? '
' . htmlspecialchars($localAuthError) . '
' : '') . '
';
render_login_template('Verificação de Segurança', $content);
die();
}
@@ -357,6 +368,7 @@ function start_authenticated_session($userId, $userName, $userEmail, $isAdmin) {
$content .= '
Por favor, introduza o seu nome completo.
';
if (!empty($localAuthError)) { $content .= '
' . htmlspecialchars($localAuthError) . '
'; }
$content .= '