You are here

function taxonomy_manager_valid_ajax_callback in Taxonomy Manager 6.2

Validates a custom AJAX callback by ensuring that the request contains a valid form token, which prevents CSRF.

Parameters

$submitted_data: An array containing the submitted data, usually $_POST. Needs to contain form_token and form_id.

Return value

TRUE if a valid token is provided, else FALSE.

3 calls to taxonomy_manager_valid_ajax_callback()
taxonomy_manager_double_tree_edit in ./taxonomy_manager.admin.inc
AJAX Callback for Double Tree operations
taxonomy_manager_term_data_edit in ./taxonomy_manager.admin.inc
callback handler for updating term data
taxonomy_manager_update_weights in ./taxonomy_manager.admin.inc
callback for updating weights data send through AJAX, $_POST $_POST[$tid] => $weight

File

./taxonomy_manager.admin.inc, line 1568
Taxonomy Manager Admin

Code

function taxonomy_manager_valid_ajax_callback($submitted_data) {
  if (isset($submitted_data['form_token']) && isset($submitted_data['form_id']) && drupal_valid_token($submitted_data['form_token'], $submitted_data['form_id'])) {
    return TRUE;
  }
  return FALSE;
}