You are here

function persistent_login_erase in Persistent Login 6

Same name and namespace in other branches
  1. 5 persistent_login.module \persistent_login_erase()
  2. 7 persistent_login.pages.inc \persistent_login_erase()

Menu callback to erase a user's Persistent Login records. The menu entry guarantees that the user is logged in.

Redirects to user/$uid if allowed or calls drupal_access_denied().

Parameters

$uid: The user id for whom to erase PL records. A user can specify any uid for the callback, but only the current user's id will work unless the user has 'administer Persistent Login' permission.

1 string reference to 'persistent_login_erase'
persistent_login_menu in ./persistent_login.module
Implementation of hook_menu().

File

./persistent_login.pages.inc, line 113
Implementation of Persistent Login forms.

Code

function persistent_login_erase($uid = NULL) {
  global $user;
  if (!isset($uid)) {
    $uid = $user->uid;
  }
  if ($user->uid == $uid || user_access('administer Persistent Login')) {
    _persistent_login_invalidate('erase', 'uid = %d', $uid);
    drupal_goto('user/' . $uid);
  }
  drupal_access_denied();
}