diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-12-13 01:05:38 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-12-13 01:05:38 +0000 |
commit | 74e5d80e899562b6505ce7c4865041448b22470d (patch) | |
tree | e47fae00cc013e4626081cc66f38ce43e1d40dd4 /include | |
parent | 5046b3c2105bdfae23d6835c110606ea9e7ff055 (diff) |
- feature 599: option to forbid user registration
- 1 language cleanup
- added page_forbidden function (sends 403)
git-svn-id: http://piwigo.org/svn/trunk@1652 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_html.inc.php | 17 | ||||
-rwxr-xr-x | include/menubar.inc.php | 6 |
2 files changed, 22 insertions, 1 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index f3ad7f700..39f738f3f 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -614,6 +614,23 @@ function access_denied() } /** + * exits the current script with 403 code + * @param string msg a message to display + * @param string alternate_url redirect to this url + */ +function page_forbidden($msg, $alternate_url=null) +{ + set_status_header(403); + if ($alternate_url==null) + $alternate_url = make_index_url(); + redirect_html( $alternate_url, + '<div style="text-align:left; margin-left:5em;margin-bottom:5em;"> +<h1 style="text-align:left; font-size:36px;">Forbidden</h1><br/>' +.$msg.'</div>', + 5 ); +} + +/** * exits the current script with 404 code when a page cannot be found * @param string msg a message to display * @param string alternate_url redirect to this url diff --git a/include/menubar.inc.php b/include/menubar.inc.php index c360b2600..c149b3553 100755 --- a/include/menubar.inc.php +++ b/include/menubar.inc.php @@ -206,7 +206,6 @@ $template->assign_block_vars( if ($user['is_the_guest']) { - $template->assign_block_vars('register', array()); $template->assign_block_vars('login', array()); $template->assign_block_vars('quickconnect', array()); @@ -214,6 +213,11 @@ if ($user['is_the_guest']) { $template->assign_block_vars('quickconnect.remember_me', array()); } + if ($conf['allow_user_registration']) + { + $template->assign_block_vars('register', array()); + $template->assign_block_vars('quickconnect.register', array()); + } } else { |