Commit a8c0d79f authored by webchick's avatar webchick

#357591 by sun: Add watchdog calls for user cancel operations.

parent 9f54383f
......@@ -1786,6 +1786,7 @@ function _user_cancel($edit, $account, $method) {
}
db_update('users')->fields(array('status' => 0))->condition('uid', $account->uid)->execute();
drupal_set_message(t('%name has been disabled.', array('%name' => $account->name)));
watchdog('user', 'Blocked user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
break;
case 'user_cancel_reassign':
......@@ -1798,8 +1799,7 @@ function _user_cancel($edit, $account, $method) {
db_delete('users_roles')->condition('uid', $account->uid)->execute();
db_delete('authmap')->condition('uid', $account->uid)->execute();
drupal_set_message(t('%name has been deleted.', array('%name' => $account->name)));
$variables = array('%name' => $account->name, '%email' => '<' . $account->mail . '>');
watchdog('user', 'Deleted user: %name %email.', $variables, WATCHDOG_NOTICE);
watchdog('user', 'Deleted user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
break;
}
......
......@@ -400,6 +400,7 @@ function user_cancel_confirm_form_submit($form, &$form_state) {
$account = user_save($account, $edit);
_user_mail_notify('cancel_confirm', $account);
drupal_set_message(t('A confirmation request to cancel your account has been sent to your e-mail address.'));
watchdog('user', 'Sent account cancellation request to %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
if (!isset($_REQUEST['destination'])) {
$form_state['redirect'] = "user/$account->uid";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment