|
|
|
|
@ -540,6 +540,7 @@ if (!CustomPages::enabled()) { |
|
|
|
|
|
|
|
|
|
$blockButton = false; |
|
|
|
|
$termActivated = false; |
|
|
|
|
$showTerms = false; |
|
|
|
|
|
|
|
|
|
// Terms and conditions |
|
|
|
|
if (api_get_setting('allow_terms_conditions') == 'true') { |
|
|
|
|
@ -712,6 +713,7 @@ if ($blockButton) { |
|
|
|
|
} else { |
|
|
|
|
$form->addButtonNext(get_lang('RegisterUser')); |
|
|
|
|
} |
|
|
|
|
$showTerms = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$course_code_redirect = Session::read('course_redirect'); |
|
|
|
|
@ -949,6 +951,26 @@ if ($form->validate()) { |
|
|
|
|
echo $content; |
|
|
|
|
Display::display_footer(); |
|
|
|
|
exit; |
|
|
|
|
} else if (api_get_setting('allow_registration') === 'confirmation') { |
|
|
|
|
$TABLE_USER = Database::get_main_table(TABLE_MAIN_USER); |
|
|
|
|
// 1. set account inactive |
|
|
|
|
$sql = "UPDATE $TABLE_USER SET active='0' WHERE user_id = ".$user_id; |
|
|
|
|
Database::query($sql); |
|
|
|
|
|
|
|
|
|
// 2. Send mail to the user |
|
|
|
|
/** @var \Chamilo\UserBundle\Entity\User $thisUser */ |
|
|
|
|
$thisUser = Database::getManager()->getRepository('ChamiloUserBundle:User')->find($user_id); |
|
|
|
|
|
|
|
|
|
UserManager::sendUserConfirmationMail($thisUser); |
|
|
|
|
|
|
|
|
|
// 3. exit the page |
|
|
|
|
unset($user_id); |
|
|
|
|
|
|
|
|
|
Display::display_header(get_lang('ConfirmationForNewAccount', null, $values['language'])); |
|
|
|
|
echo Display::page_header(get_lang('YouNeedToConfirmYourAccountViaMailToAccessPlatform', null, $values['language'])); |
|
|
|
|
echo $content; |
|
|
|
|
Display::display_footer(); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -1122,7 +1144,7 @@ if ($form->validate()) { |
|
|
|
|
Session::erase('session_redirect'); |
|
|
|
|
Session::erase('only_one_course_session_redirect'); |
|
|
|
|
|
|
|
|
|
if (CustomPages::enabled()) { |
|
|
|
|
if (CustomPages::enabled() && CustomPages::exists(CustomPages::REGISTRATION_FEEDBACK)) { |
|
|
|
|
CustomPages::display( |
|
|
|
|
CustomPages::REGISTRATION_FEEDBACK, |
|
|
|
|
array('info' => $text_after_registration) |
|
|
|
|
@ -1137,7 +1159,7 @@ if ($form->validate()) { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// Custom pages |
|
|
|
|
if (CustomPages::enabled()) { |
|
|
|
|
if (CustomPages::enabled() && CustomPages::exists(CustomPages::REGISTRATION)) { |
|
|
|
|
CustomPages::display( |
|
|
|
|
CustomPages::REGISTRATION, array('form' => $form) |
|
|
|
|
); |
|
|
|
|
|