You are here

function openid_user_identities in Drupal 6

Same name and namespace in other branches
  1. 7 modules/openid/openid.pages.inc \openid_user_identities()

Menu callback; Manage OpenID identities for the specified user.

1 string reference to 'openid_user_identities'
openid_menu in modules/openid/openid.module
Implementation of hook_menu.

File

modules/openid/openid.pages.inc, line 29
User page callbacks for the openid module.

Code

function openid_user_identities($account) {
  drupal_set_title(check_plain($account->name));
  drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', 'module');

  // Check to see if we got a response
  $result = openid_complete();
  if ($result['status'] == 'success') {
    $identity = $result['openid.claimed_id'];
    db_query("INSERT INTO {authmap} (uid, authname, module) VALUES (%d, '%s','openid')", $account->uid, $identity);
    drupal_set_message(t('Successfully added %identity', array(
      '%identity' => $identity,
    )));
  }
  $header = array(
    t('OpenID'),
    t('Operations'),
  );
  $rows = array();
  $result = db_query("SELECT * FROM {authmap} WHERE module='openid' AND uid=%d", $account->uid);
  while ($identity = db_fetch_object($result)) {
    $rows[] = array(
      check_plain($identity->authname),
      l(t('Delete'), 'user/' . $account->uid . '/openid/delete/' . $identity->aid),
    );
  }
  $output = theme('table', $header, $rows);
  $output .= drupal_get_form('openid_user_add');
  return $output;
}