diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index bf838cfed..b8620f80a 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -255,7 +255,7 @@ function tag_alpha_compare($a, $b) } /** - * Exits the current script (or redirect to login page if not logged). + * Exits the current script. */ function access_denied() { @@ -265,14 +265,19 @@ function access_denied() get_root_url().'identification.php?redirect=' .urlencode(urlencode($_SERVER['REQUEST_URI'])); + $access_denied_html = + ''. + '
'. + '
'. + 'warning-triangle'. + '

'.l10n('You are not authorized to access the requested page').'

'; + if ( isset($user) and !is_a_guest() ) { set_status_header(401); - echo ''; - echo '
'.l10n('You are not authorized to access the requested page').'
'; - echo ''.l10n('Identification').' '; - echo ''.l10n('Home').'
'; + echo $access_denied_html; + echo ''.l10n('Home').'
'; echo str_repeat( ' ', 512); //IE6 doesn't error output if below a size exit(); } @@ -282,10 +287,17 @@ function access_denied() } else { - redirect_html($login_url); + set_status_header(401); + + echo $access_denied_html; + echo ''.l10n('Identification').''; + echo ''.l10n('Home').''; + echo str_repeat( ' ', 512); //IE6 doesn't error output if below a size + exit(); } } + /** * Exits the current script with 403 code. * @todo nice display if $template loaded diff --git a/themes/default/icon/warning-triangle.svg b/themes/default/icon/warning-triangle.svg new file mode 100644 index 000000000..eb80354f5 --- /dev/null +++ b/themes/default/icon/warning-triangle.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file