diff --git a/public/main/auth/inscription.php b/public/main/auth/inscription.php index 9552590adae..033acd93677 100644 --- a/public/main/auth/inscription.php +++ b/public/main/auth/inscription.php @@ -117,6 +117,26 @@ $extraFieldsLoaded = false; $htmlHeadXtra[] = api_get_password_checker_js('#username', '#pass1'); +$registeringText = addslashes(get_lang('Registering')); +$htmlHeadXtra[] = << +document.addEventListener('DOMContentLoaded', function() { + const form = document.querySelector('form[name="registration"]'); + if (form) { + form.addEventListener('submit', function(event) { + const submitButtons = form.querySelectorAll('button[type="submit"], input[type="submit"]'); + submitButtons.forEach(btn => { + btn.disabled = true; + btn.classList.add('disabled'); + btn.innerText = '{$registeringText}'; + }); + }); + } +}); + +EOD; + + // User is not allowed if Terms and Conditions are disabled and // registration is disabled too. $isCreatingIntroPage = isset($_GET['create_intro_page']); @@ -1204,7 +1224,7 @@ ['class' => 'btn btn--primary btn-large'] ), 'message' => '', - 'action' => api_get_path(WEB_PATH).'user_portal.php', + 'action' => api_get_path(WEB_PATH).'home', 'go_button' => '', ]; @@ -1221,7 +1241,7 @@ Session::erase('_course'); Session::erase('_cid'); } else { - $formData['action'] = api_get_path(WEB_PATH).'user_portal.php'; + $formData['action'] = api_get_path(WEB_PATH).'home'; } } } else { @@ -1230,10 +1250,12 @@ $textAfterRegistration .= '

'.get_lang('An e-mail has been sent to remind you of your login and password', $userEntity->getLocale()).'

'; $diagnosticPath = ''.$linkDiagnostic.''; $textAfterRegistration .= '

'; - $textAfterRegistration .= sprintf( - get_lang('Welcome, please go to diagnostic at %s.', $userEntity->getLocale()), - $diagnosticPath - ); + if ('true' === api_get_setting('session.allow_search_diagnostic')) { + $textAfterRegistration .= sprintf( + get_lang('Welcome, please go to diagnostic at %s.', $userEntity->getLocale()), + $diagnosticPath + ); + } $textAfterRegistration .= '

'; } diff --git a/public/main/inc/lib/formvalidator/FormValidator.class.php b/public/main/inc/lib/formvalidator/FormValidator.class.php index 01967c4e8e5..a4e64cff633 100644 --- a/public/main/inc/lib/formvalidator/FormValidator.class.php +++ b/public/main/inc/lib/formvalidator/FormValidator.class.php @@ -1401,7 +1401,7 @@ public function addNumeric($name, $label, $attributes = [], $required = false) $element = $this->addElement('Number', $name, $label, $attributes); if ($required) { - $this->addRule($name, get_lang('ThisFieldIsRequired'), 'required'); + $this->addRule($name, get_lang('Required field'), 'required'); } return $element; diff --git a/public/main/inc/lib/pear/HTML/QuickForm.php b/public/main/inc/lib/pear/HTML/QuickForm.php index 81f1993cb3e..c94f1c00a9a 100644 --- a/public/main/inc/lib/pear/HTML/QuickForm.php +++ b/public/main/inc/lib/pear/HTML/QuickForm.php @@ -1925,7 +1925,7 @@ public function setRequired(HTML_QuickForm_element $element) { $this->addRule( $element->getName(), - get_lang('ThisFieldIsRequired'), + get_lang('Required field'), 'required' ); }