You are here

function realname_contact_user in Real Name 6

Intercept the Personal contact page.

1 string reference to 'realname_contact_user'
realname_menu_alter in ./realname.module
Implements hook_menu_alter().

File

./realname.module, line 312

Code

function realname_contact_user($account) {
  global $user;
  if (!valid_email_address($user->mail)) {
    $output = t('You need to provide a valid e-mail address to contact other users. Please update your <a href="@url">user information</a> and try again.', array(
      '@url' => url("user/{$user->uid}/edit"),
    ));
  }
  else {
    if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold', 3))) {
      $output = t('You cannot contact more than %number users per hour. Please try again later.', array(
        '%number' => variable_get('contact_hourly_threshold', 3),
      ));
    }
    else {
      realname_check_breadcrumbs($account);
      $output = drupal_get_form('contact_mail_user', $account);
    }
  }
  return $output;
}