drupal_access_denied
includes/common.inc, строка 375
- Версии
- 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']), WATCHDOG_WARNING);
// Keep old path for reference
if (!isset($_REQUEST['destination'])) {
$_REQUEST['destination'] = $_GET['q'];
}
$path = drupal_get_normal_path(variable_get('site_403', ''));
if ($path && $path != $_GET['q']) {
menu_set_active_item($path);
$return = menu_execute_active_handler();
}
else {
// Redirect to a non-existent menu item to make possible tabs disappear.
menu_set_active_item('');
}
if (empty($return) || $return == MENU_NOT_FOUND || $return == MENU_ACCESS_DENIED) {
drupal_set_title(t('Access denied'));
menu_set_active_item('');
$return = t('You are not authorized to access this page.');
}
print theme('page', $return);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии