drupal_valid_token

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 drupal_valid_token($token, $value = '', $skip_anonymous = FALSE)

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

Übergabeparameter

$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.

Rückgabewert

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.

▾ 2 functions call drupal_valid_token()

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.

Code

includes/common.inc, line 2614

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

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen