drupal_access_denied

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/common.inc, строка 374

Версии
5 – 6
drupal_access_denied()

Генерирует ошибку 403 если для просмотра страницы недостаточно прав.

▾ 9 функции вызывают drupal_access_denied()

book_export_html in modules/book/book.pages.inc
This function is called by book_export() to generate HTML for export.
comment_edit in modules/comment/comment.pages.inc
Конструктор формы; генерирует форму редактирования комментария.
file_download in includes/file.inc
Call modules that implement hook_file_download() to find out if a file is accessible and what headers it should be transferred with. If a module returns -1 drupal_access_denied() will be returned. If one or more modules returned headers the download...
menu_delete_menu_page in modules/menu/menu.admin.inc
Menu callback; check access and get a confirm form for deletion of a custom menu.
menu_item_delete_page in modules/menu/menu.admin.inc
Menu callback; Check access and present a confirm form for deleting a menu link.
page_example_baz in developer/examples/page_example.module
Более сложная реализация коллбэка меню для отображения страницы, которая принимает аргументы.
profile_browse in modules/profile/profile.pages.inc
Menu callback; display a list of user information.
system_batch_page in modules/system/system.admin.inc
Default page callback for batches.
user_pass_reset in modules/user/user.pages.inc
Menu callback; process one time login link and redirects to the user page on success.

Код

<?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);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему