Skip to content

Commit 153f415

Browse files
Merge pull request #7478 from christianbeeznest/GH-7459
User: Remove double validation step from registration form - refs #7459
2 parents 742c850 + 74183da commit 153f415

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

public/main/auth/registration.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -927,10 +927,10 @@ function ($email) {
927927
$settingRequiredFields = api_get_setting('registration.required_extra_fields_in_inscription', true);
928928
$requiredExtraFieldVars = $normalizeSettingList($settingRequiredFields);
929929

930-
// Load extra fields if:
931-
// - extra fields are enabled in allow_fields_inscription OR
932-
// - there are required extra fields configured OR
933-
// - conditions extra fields exist (profile.show_conditions_to_user)
930+
// Load extra fields if:
931+
// - extra fields are enabled in allow_fields_inscription OR
932+
// - there are required extra fields configured OR
933+
// - conditions extra fields exist (profile.show_conditions_to_user)
934934
$shouldLoadExtraFields = (
935935
array_key_exists('extra_fields', $allowedFields) ||
936936
in_array('extra_fields', $allowedFields, true) ||
@@ -1156,8 +1156,16 @@ function ($email) {
11561156
);
11571157
} else {
11581158
$allow = ('true' === api_get_setting('registration.allow_double_validation_in_registration'));
1159+
$termsEnabled = ('true' === api_get_setting('allow_terms_conditions'));
1160+
11591161
ChamiloHelper::addLegalTermsFields($form, $userAlreadyRegisteredShowTerms);
1160-
if ($allow && !$termActivated) {
1162+
1163+
/**
1164+
* The "double validation" (Validate -> Register) is legacy UX.
1165+
* When Terms & Conditions are enabled, it becomes redundant and may create a confusing 2-step flow.
1166+
* Keep it only for platforms that explicitly want it without T&C.
1167+
*/
1168+
if ($allow && !$termsEnabled && !$termActivated) {
11611169
$htmlHeadXtra[] = '<script>
11621170
$(document).ready(function() {
11631171
$("#pre_validation").click(function() {
@@ -1421,7 +1429,6 @@ function ($email) {
14211429
}
14221430
}
14231431

1424-
14251432
/* SESSION REGISTERING */
14261433
/* @todo move this in a function */
14271434
$user['firstName'] = stripslashes($values['firstname']);

0 commit comments

Comments
 (0)