You are here

function antispam_user_load in AntiSpam 7

Implements hook_user_load().

File

./antispam.module, line 1541
Primary hook implementations for the Antispam module.

Code

function antispam_user_load($users) {
  $moderator_email_for_options = _antispam_get_email_for_options();
  foreach ($users as $user) {
    $moderator_types = antispam_get_moderator_types($user);
    $moderator_types_count = count($moderator_types);
    if ($moderator_types_count > 0) {
      $moderator_data = db_query('SELECT * FROM {antispam_moderator} WHERE uid=:uid', array(
        ':uid' => $user->uid,
      ))
        ->fetchObject();
      $user->antispam_moderator_email_for = isset($moderator_data->email_for) && isset($moderator_email_for_options[$moderator_data->email_for]) ? $moderator_data->email_for : 'approval';
    }
  }
}