Function __global->_access_denied

Definitions

sources/failure.php

  • Show a helpful access-denied page. Has a login ability if it senses that logging in could curtail the error.Note that this function should only be used for cases where access is being denied based on credentials, not for when access is blocked for other reasons (such as to enforce flow security). Using warn_exit with INTERNAL_ERROR is for those situations, or log_hack_attack_and_exit.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$class ID_TEXT No No required parameter N/A N/A The class of error (e.g. PRIVILEGE)
$param string No No required parameter N/A N/A The parameter given to the error message
$force_login boolean No No required parameter N/A N/A Force the user to login (even if perhaps they are logged in already)

Preview

Code (PHP)

/**
 * Show a helpful access-denied page. Has a login ability if it senses that logging in could curtail the error.Note that this function should only be used for cases where access is being denied based on credentials, not for when access is blocked for other reasons (such as to enforce flow security). Using warn_exit with INTERNAL_ERROR is for those situations, or log_hack_attack_and_exit.
 *
 * @param  ID_TEXT $class The class of error (e.g. PRIVILEGE)
 * @param  string $param The parameter given to the error message
 * @param  boolean $force_login Force the user to login (even if perhaps they are logged in already)
 */

function _access_denied(string $class, string $param, bool $force_login)