Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions public/main/auth/inscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@

$extraFieldsLoaded = false;
$htmlHeadXtra[] = api_get_password_checker_js('#username', '#pass1');
$registeringText = addslashes(get_lang('Registering'));
$htmlHeadXtra[] = <<<EOD
<script>
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}';
});
});
}
});
</script>
EOD;


// User is not allowed if Terms and Conditions are disabled and
// registration is disabled too.
$isCreatingIntroPage = isset($_GET['create_intro_page']);
Expand Down Expand Up @@ -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' => '',
];

Expand All @@ -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 {
Expand All @@ -1230,10 +1250,12 @@
$textAfterRegistration .= '<p>'.get_lang('An e-mail has been sent to remind you of your login and password', $userEntity->getLocale()).'</p>';
$diagnosticPath = '<a href="'.$linkDiagnostic.'" class="custom-link">'.$linkDiagnostic.'</a>';
$textAfterRegistration .= '<p>';
$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 .= '</p>';
}

Expand Down
2 changes: 1 addition & 1 deletion public/main/inc/lib/formvalidator/FormValidator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion public/main/inc/lib/pear/HTML/QuickForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ public function setRequired(HTML_QuickForm_element $element)
{
$this->addRule(
$element->getName(),
get_lang('ThisFieldIsRequired'),
get_lang('Required field'),
'required'
);
}
Expand Down
Loading