Adding api_not_found function

skala
Julio Montoya 14 years ago
parent 83def980f4
commit 3ab430e4b1
  1. 16
      main/inc/lib/main_api.lib.php

@ -2565,6 +2565,22 @@ function api_is_anonymous($user_id = null, $db_check = false) {
return isset($_user['is_anonymous']) && $_user['is_anonymous'] === true; return isset($_user['is_anonymous']) && $_user['is_anonymous'] === true;
} }
/*
* Returns a not found page
* @todo use smarty to customize the not found page
*/
function api_not_found($print_headers = false) {
$origin = isset($_GET['origin']) ? $_GET['origin'] : '';
$show_headers = 0;
if ((!headers_sent() || $print_headers) && $origin != 'learnpath') {
$show_headers = 1;
}
$tpl = new Template(null, $show_headers, $show_headers);
$msg = get_lang('NotFound');
$tpl->assign('content', $msg);
$tpl->display_one_col_template();
}
/** /**
* Displays message "You are not allowed here..." and exits the entire script. * Displays message "You are not allowed here..." and exits the entire script.
* @param bool Whether or not to print headers (default = false -> does not print them) * @param bool Whether or not to print headers (default = false -> does not print them)

Loading…
Cancel
Save