drupal_valid_token

Versions
mediamosa-21
drupal_valid_token($token, $value = '', $skip_anonymous = FALSE)

Validate a token based on $value, the current user session and private key.

Parameters

$token The token to be validated.

$value An additional value to base the token on.

$skip_anonymous Set to true to skip token validation for anonymous users.

Return value

True for a valid token, false for an invalid token. When $skip_anonymous is true, the return value will always be true for anonymous users.

▾ 7 functions call drupal_valid_token()

dashboard_update in modules/dashboard/dashboard.module
Set the new weight of each region according to the drag-and-drop order.
drupal_validate_form in includes/form.inc
Validates user-submitted form data from the $form_state using the validate functions defined in a structured form array.
form_get_cache in includes/form.inc
Fetch a form from cache.
shortcut_link_add_inline in modules/shortcut/shortcut.admin.inc
Menu page callback: creates a new link in the provided shortcut set.
system_theme_default in modules/system/system.admin.inc
Menu callback; Set the default theme.
system_theme_disable in modules/system/system.admin.inc
Menu callback; Disables a theme.
system_theme_enable in modules/system/system.admin.inc
Menu callback; Enables a theme.

Code

includes/common.inc, line 4279

<?php
function drupal_valid_token($token, $value = '', $skip_anonymous = FALSE) {
  global $user;
  return (($skip_anonymous && $user->uid == 0) || ($token == drupal_get_token($value)));
}
?>