drupal_access_denied

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

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

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

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

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

book_export_html in modules/book/book.module
This function is called by book_export() to generate HTML for export.
comment_edit in modules/comment/comment.module
Конструктор формы; генерирует форму редактирования комментария.
file_download in includes/file.inc
node_revisions in modules/node/node.module
Menu callback for revisions related activities.
node_revision_delete in modules/node/node.module
Delete the revision with specified revision number. A 'delete revision' nodeapi event is invoked when a revision is deleted.
node_revision_revert in modules/node/node.module
Revert to the revision with the specified revision number. A node and nodeapi 'update' event is triggered (via the node_save() call) when a revision is reverted.
page_example_baz in developer/examples/page_example.module
Более сложная реализация коллбэка меню для отображения страницы, которая принимает аргументы.
profile_browse in modules/profile/profile.module
Menu callback; display a list of user information.
tracker_track_user in modules/tracker/tracker.module
Menu callback. Prints a listing of active nodes on the site.
user_pass_reset in modules/user/user.module
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']), 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);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

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