function spam_user in Spam 6
Same name and namespace in other branches
- 5.3 modules/spam_user.inc \spam_user()
File
- content/
spam_content_user.inc, line 11 - Include file for integration with the user system.
Code
function spam_user($type, &$edit, &$user, $category = NULL) {
switch ($type) {
case 'update':
$user = spam_content_user_profile_update($user);
return spam_content_update($user, 'user');
case 'insert':
$user = spam_content_user_profile_update($user);
return spam_content_insert($user, 'user');
case 'delete':
return spam_content_delete($user, 'user');
case 'view':
$links = '';
if (user_spamapi('filter_content_type', $user) && user_access('administer spam')) {
foreach (spam_links('user', $user->uid, $user) as $link) {
if ($link['href']) {
$links .= l($link['title'], $link['href'], array(
'query' => array_merge($link['query'], array(
'destination' => 'user/' . $user->uid,
)),
)) . ' ';
}
else {
$links .= $link['title'] . ' ';
}
}
$status = db_result(db_query('SELECT status FROM {users} WHERE uid = %d', $user->uid));
$status_text = t('User status: %status', array(
'%status' => $status ? t('not blocked') : t('blocked'),
));
$user->content['summary']['spam_status'] = array(
'#type' => 'user_profile_item',
'#weight' => '10',
'#title' => 'Spam status',
'#value' => $links . ' ' . $status_text,
);
}
break;
}
}