drupal_access_denied
includes/common.inc, строка 374
- Версии
- 5 – 6
drupal_access_denied()
Генерирует ошибку 403 если для просмотра страницы недостаточно прав.
Код
<?php
function drupal_access_denied() {
drupal_set_header('HTTP/1.1 403 Forbidden');
watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
$path = drupal_get_normal_path(variable_get('site_403', ''));
if ($path && $path != $_GET['q']) {
// Set the active item in case there are tabs to display or other
// dependencies on the path.
menu_set_active_item($path);
$return = menu_execute_active_handler($path);
}
if (empty($return) || $return == MENU_NOT_FOUND || $return == MENU_ACCESS_DENIED) {
drupal_set_title(t('Access denied'));
$return = t('You are not authorized to access this page.');
}
print theme('page', $return);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии