Use function instead of custom code

35cd3b5c08 (commitcomment-26390637)
pull/2487/head
jmontoyaa 7 years ago
parent f5e0998ca7
commit 233524c8c0
  1. 8
      main/auth/inscription.php

@ -776,8 +776,7 @@ if ($form->validate()) {
} }
// 2. set account inactive // 2. set account inactive
$sql = "UPDATE $TABLE_USER SET active='0' WHERE user_id = ".$user_id; Usermanager::disable($user_id);
Database::query($sql);
// 3. exit the page // 3. exit the page
unset($user_id); unset($user_id);
@ -788,15 +787,12 @@ if ($form->validate()) {
Display::display_footer(); Display::display_footer();
exit; exit;
} elseif (api_get_setting('allow_registration') === 'confirmation') { } elseif (api_get_setting('allow_registration') === 'confirmation') {
$TABLE_USER = Database::get_main_table(TABLE_MAIN_USER);
// 1. Send mail to the user // 1. Send mail to the user
$thisUser = api_get_user_entity($user_id); $thisUser = api_get_user_entity($user_id);
UserManager::sendUserConfirmationMail($thisUser); UserManager::sendUserConfirmationMail($thisUser);
// 2. set account inactive // 2. set account inactive
$sql = "UPDATE $TABLE_USER SET active='0' WHERE user_id = ".$user_id; Usermanager::disable($user_id);
Database::query($sql);
// 3. exit the page // 3. exit the page
unset($user_id); unset($user_id);

Loading…
Cancel
Save