Skip to content

Commit 78e3fe3

Browse files
authored
Merge pull request #6764 from christianbeeznest/ofaj-22823-2
User: Remove default DoB=now; make registration emails mirror visible form fields - refs #22823
2 parents 59fd23e + 75f734d commit 78e3fe3

File tree

6 files changed

+588
-456
lines changed

6 files changed

+588
-456
lines changed

public/main/auth/registration.php

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -371,25 +371,21 @@ function ($email) {
371371
get_lang('Phone'),
372372
['size' => 20]
373373
);
374-
//if ('true' === api_get_setting('registration', 'phone')) {
375374
$form->addRule(
376375
'phone',
377376
get_lang('Required field'),
378377
'required'
379378
);
380-
//}
381379
}
382380

383381
// Language
384382
if (in_array('language', $allowedFields)) {
385-
//if ('true' === api_get_setting('registration', 'language')) {
386383
$form->addSelectLanguage(
387384
'language',
388385
get_lang('Language'),
389386
[],
390387
['id' => 'language']
391388
);
392-
//}
393389
}
394390

395391
if (in_array('official_code', $allowedFields)) {
@@ -399,29 +395,19 @@ function ($email) {
399395
get_lang('Official code'),
400396
['size' => 40]
401397
);
402-
//if ('true' === api_get_setting('registration', 'officialcode')) {
403398
$form->addRule(
404399
'official_code',
405400
get_lang('Required field'),
406401
'required'
407402
);
408-
//}
409403
}
410404

411-
// STUDENT/TEACHER
412-
if ('false' !== api_get_setting('allow_registration_as_teacher')) {
413-
if (in_array('status', $allowedFields)) {
414-
$form->addRadio(
415-
'status',
416-
get_lang('What do you want to do?'),
417-
[
418-
STUDENT => '<p class="caption">'.get_lang('Follow courses').'</p>',
419-
COURSEMANAGER => '<p class="caption">'.get_lang('Teach courses').'</p>',
420-
],
421-
['class' => 'register-profile']
422-
);
423-
$form->addRule('status', get_lang('Required field'), 'required');
424-
}
405+
if (in_array('date_of_birth', $allowedFields, true)) {
406+
$form->addDatePicker(
407+
'date_of_birth',
408+
get_lang('Date of birth'),
409+
['required' => false]
410+
);
425411
}
426412

427413
$captcha = api_get_setting('allow_captcha');
@@ -595,6 +581,7 @@ function ($email) {
595581
}
596582
}
597583

584+
// Defaults
598585
if (isset($_SESSION['user_language_choice']) && '' != $_SESSION['user_language_choice']) {
599586
$defaults['language'] = $_SESSION['user_language_choice'];
600587
} else {

0 commit comments

Comments
 (0)