You are here

function cleantalk_user_insert in Anti Spam by CleanTalk 7.2

Same name and namespace in other branches
  1. 8 cleantalk.module \cleantalk_user_insert()
  2. 7 cleantalk.module \cleantalk_user_insert()

Implements hook_user_insert().

File

./cleantalk.module, line 1658
Main CleanTalk integration module functions.

Code

function cleantalk_user_insert(&$edit, $account, $category) {
  if ($category != 'account') {
    return;
  }
  $ct_result = _cleantalk_ct_result();
  if (!empty($ct_result['ct_request_id'])) {
    db_insert('cleantalk_uids')
      ->fields(array(
      'uid' => $account->uid,
      'ct_request_id' => $ct_result['ct_request_id'],
      'ct_result_comment' => empty($ct_result['ct_result_comment']) ? '' : $GLOBALS['ct_result_comment'],
    ))
      ->execute();
    _cleantalk_ct_result('set');
  }
}