[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Enhance user registration form submission handling by preventing duplicate submits

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69147e255475f_2b1833dc11594@gitlab-sidekiq-low-urgency-cpu-bound-v2-f8dc7c8b7-dnzjg.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
f197820a by Moïse Nturubika at 2025-11-12T12:23:40+00:00
[FIX] Enhance user registration form submission handling by preventing duplicate submits
---
* [FIX] Restore superglobals assignments in UserRegistration class

* [FIX] Enhance user registration form submission handling by preventing duplicate submits

See merge request tikiwiki/tiki!8409

- - - - -


1 changed file:

- templates/user_registration.tpl


Changes:

=====================================
templates/user_registration.tpl
=====================================
@@ -37,6 +37,19 @@
         {jq}
             $('form[name="RegForm"]').on("submit", async function (event) {
                 event.preventDefault();
+                var $form = $(this);
+
+                if ($form.data('submitting') === true) {
+                    return;
+                }
+
+                function setSubmitting(state) {
+                    $form.data('submitting', state === true);
+                    $form.find('button[type="submit"], .registerSubmit').prop('disabled', state === true).toggleClass('disabled', state === true);
+                }
+
+                setSubmitting(true);
+
                 var isWebauthnEnabled = "{{$prefs.auth_webauthn_enabled}}";
                 var isWebAuthnIsChoosen = $("#webauthn_checkbox_register").is(':checked') && isWebauthnEnabled === 'y';
                 var regUser = $(this).find('#name').val();
@@ -56,6 +69,7 @@
                                     <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                 </div>`
                             );
+                            setSubmitting(false);
                             return;
                         }
                         this.submit();
@@ -66,6 +80,7 @@
                                 <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                             </div>`
                         );
+                        setSubmitting(false);
                         return;
                     }
                 } else {



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f197820a080353ba9060de7f0a32edc8bb7db457

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f197820a080353ba9060de7f0a32edc8bb7db457
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.