diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-02-23 05:12:32 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-02-23 05:12:32 +0000 |
commit | 347d2e34b3972ec1d0022b831dd5a1fe13adbaa5 (patch) | |
tree | 92cd6cd3e49c50337de07c175c2d9d71291a74f0 /include/functions_category.inc.php | |
parent | 34538a62f4ac8bc6db41580058fdd040abaa3183 (diff) |
fix: permissioning not working (2 bugs)
fix: locked gallery cannot be unlocked (impossible to login)
improvement: nicer display in redirect.tpl
improvement: when a page is not accessible because of permissions (accessed
through bookmark or email), redirect to identification.php and after
identification to the initially requested page
git-svn-id: http://piwigo.org/svn/trunk@1052 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_category.inc.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php index b3abce892..f7c5b926b 100644 --- a/include/functions_category.inc.php +++ b/include/functions_category.inc.php @@ -46,10 +46,21 @@ function check_restrictions($category_id) if (in_array($category_id, explode(',', $user['forbidden_categories']))) { - echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />'; - echo '<a href="./category.php">'; - echo $lang['thumbnails'].'</a></div>'; - exit(); + $login_url = './identification.php?redirect='. + htmlentities(htmlentities($_SERVER['REQUEST_URI'])); + if ( ! $user['is_the_guest'] ) + { + echo '<div style="text-align:center;">'; + echo $lang['hello'].' '.$user['username'].'! '; + echo $lang['access_forbiden'].'<br />'; + echo '<a href="./category.php">'.$lang['thumbnails'].'</a> '; + echo '</div>'; + exit(); + } + else + { + redirect($login_url); + } } } |