You are here

function email_confirm_user in Email Change Confirmation 6

Same name and namespace in other branches
  1. 5 email_confirm.module \email_confirm_user()

Implementation of hook_user().

File

./email_confirm.module, line 112

Code

function email_confirm_user($op, &$edit, &$account) {
  switch ($op) {
    case 'submit':
      if (!empty($edit['mail']) && $account->mail != $edit['mail'] && !user_access('administer users')) {
        email_confirm_build_mail($edit);
        module_invoke_all('email_confirm', 'email change', $account->uid, $account->mail, $edit['mail']);
        if (module_exists('rules')) {
          rules_invoke_event('email_confirm_email_change_request', $account, $account->mail, $edit['mail']);
        }
        unset($edit['mail']);
      }
      break;
  }
}