You are here

function advuser_user_update in Advanced User 5.2

Same name and namespace in other branches
  1. 5 advuser.module \advuser_user_update()
  2. 6.2 advuser.module \advuser_user_update()
  3. 7.3 advuser.module \advuser_user_update()

Notify administrator of user profile edit.

1 call to advuser_user_update()
advuser_user in ./advuser.module
hook_user implementation

File

./advuser.module, line 624
Advanced user module allows you to select users based on an advanced set of filtering and apply actions to block, unblock, delete or email the selected users.

Code

function advuser_user_update($edit, $user, $category) {

  // Check to see if we notify the administrator of the modified user profile.
  // Only send if the user isn't modified by an administrator.
  $modify_notify = variable_get('advuser_modify_notify', FALSE) && !user_access('administer users');
  if ($modify_notify) {
    $from = variable_get("site_mail", ini_get("sendmail_from"));
    $body = variable_get('advuser_modify_mail', NULL);
    $subject = variable_get('advuser_modify_subject', NULL);

    // these are invariant for all sent emails
    $variables = _advuser_get_variables($user);
    $user_subject = strtr($subject, $variables);
    $user_body = strtr($body, $variables);
    watchdog('advuser', "Sending user account mail: subj='{$user_subject}' body='{$user_body}'");
    _advuser_mail_roles($user_subject, $user_body, $from);
  }
}