diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 6cb38fdb..afa7ea9d 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -1,6 +1,7 @@ getConnection(); $is_oauth = $session->has('oauth2_connect_provider'); $msg = ''; @@ -211,6 +215,9 @@ function guest_register() } if ($valid) { + // Safeguard against partially created user data + $db->beginTransaction(); + $user = new User([ 'name' => $nick, 'password' => $password_hash, @@ -295,6 +302,9 @@ function guest_register() $user_angel_types_info[] = $angel_types[$selected_angel_type_id]; } + // Commit complete user data + $db->commit(); + engelsystem_log( 'User ' . User_Nick_render($user, true) . ' signed up as: ' . join(', ', $user_angel_types_info)