diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-03-30 00:37:07 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-03-30 00:37:07 +0000 |
commit | 4d322701de488c66916d15955099c3ed1ad061ab (patch) | |
tree | 19f13abdb83f21f13d6bd3b75f54c5eeccdf35a3 /include/functions_html.inc.php | |
parent | a2dd39df73d6c29073dbd8d7d87f34adf9aef621 (diff) |
fix: image_order cookie path fixed for url rewriting
improve: add function access_denied called when check_status or
check_restrictions fail
fix: french language correction
fix: remove php warnings in clean_iptc_value
split search functions into include/functions_search.inc.php
git-svn-id: http://piwigo.org/svn/trunk@1113 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_html.inc.php | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index 37f4d8a59..7e7df7c41 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -5,7 +5,7 @@ // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ // | branch : BSF (Best So Far) -// | file : $RCSfile$ +// | file : $Id$ // | last update : $Date$ // | last modifier : $Author$ // | revision : $Revision$ @@ -493,4 +493,30 @@ function get_cat_display_name_from_id($cat_id, $cat_info = get_cat_info($cat_id); return get_cat_display_name($cat_info['name'], $url, $replace_space); } -?> + +/** + * exits the current script (either exit or redirect) + */ +function access_denied() +{ + global $user, $lang; + + $login_url = + get_root_url().'identification.php?redirect=' + .urlencode(urlencode($_SERVER['REQUEST_URI'])); + + if ( isset($user['is_the_guest']) and !$user['is_the_guest'] ) + { + echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />'; + echo '<a href="'.get_root_url().'identification.php">'.$lang['identification'].'</a> '; + echo '<a href="'.make_index_url().'">'.$lang['home'].'</a></div>'; + exit(); + } + else + { + header('HTTP/1.1 401 Authorization required'); + header('Status: 401 Authorization required'); + redirect($login_url); + } +} +?>
\ No newline at end of file |