You are here

function multiple_email_confirm_page in Multiple E-mail Addresses 2.x

Same name and namespace in other branches
  1. 5 multiple_email_confirm_page.inc \multiple_email_confirm_page()
  2. 6 multiple_email_confirm_page.inc \multiple_email_confirm_page()
  3. 7 multiple_email_confirm_page.inc \multiple_email_confirm_page()

Renders the page to confirm an e-mail address.

If code is passed in on URL, then it will populate that value in the text field.

Parameters

object $account: Loaded user account object.

object $email: Loaded e-mail object.

string $code: Optional confirmation code.

Return value

string

1 string reference to 'multiple_email_confirm_page'
multiple_email_menu in ./multiple_email.module
Implements hook_menu().

File

./multiple_email_confirm_page.inc, line 23
Functions for displaying and processing the confirmation page

Code

function multiple_email_confirm_page($account, $email, $code = NULL) {
  global $user;
  if (_multiple_email_access('confirm', $account, $email)) {
    menu_set_active_item('user/' . $account->uid . '/edit/email-addresses');
    return drupal_get_form('multiple_email_confirm_form', $account, $email, $code);
  }
  elseif (empty($user->uid)) {
    drupal_set_message(t('You must be signed in to confirm an address.'));
    drupal_goto('user/login', array(
      'query' => drupal_get_destination(),
    ));
  }
  else {
    drupal_access_denied();
  }
}