You are here

function cf_page_not_accessible in Common Functionality 7

Returns a standard "This page cannot be accessed" message.

Why: The drupal form api core produces problems when anything other than a form array is returned.

See: http://drupal.org/node/979758

Deprecated: drupal_access_denied() cannot be directly used within a page callback according the documentation at: https://api.drupal.org/api/drupal/includes--common.inc/function/drupal_a...

However, the desired functionality provided by this function can still be done by calling drupal_exit() immediately after drupal_access_denied(). This produces the behavior provided by thus function, therefore you can replace this function with drupal_access_denied() and drupal_exit().

Parameters

string $form_state: The form state. @param string $id (optional) The form id, generally this should be taken from: $form['#id'].

array $function_history: (optional) An array of function names, ie: array('0' => 'my_function_name').

Return value

array An array that can be safely as a return statement for a page.

File

./cf.module, line 332

Code

function cf_page_not_accessible(&$form_state, $id = '', array $function_history = array()) {
  drupal_access_denied();
  drupal_exit();
}