diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-12-08 12:45:00 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-12-08 12:45:00 +0000 |
commit | ad8408a69a1910ae8759dd92d7735ab2ea99cda4 (patch) | |
tree | 8731ee47736de3d99cc4d5af952998fa746e99d5 | |
parent | 5a4d2491058b0972146f9b7897b87d42102faee7 (diff) | |
download | elgg-ad8408a69a1910ae8759dd92d7735ab2ea99cda4.tar.gz elgg-ad8408a69a1910ae8759dd92d7735ab2ea99cda4.tar.bz2 |
gatekeeper functions now display helpful messages - closes #1060
git-svn-id: http://code.elgg.org/elgg/trunk@3742 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/sessions.php | 2 | ||||
-rw-r--r-- | languages/en.php | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php index f6758425a..0448007e1 100644 --- a/engine/lib/sessions.php +++ b/engine/lib/sessions.php @@ -588,6 +588,7 @@ function session_init($event, $object_type, $object) { function gatekeeper() { if (!isloggedin()) { $_SESSION['last_forward_from'] = current_page_url(); + register_error(elgg_echo('loggedinrequired')); forward(); } } @@ -601,6 +602,7 @@ function admin_gatekeeper() { if (!isadminloggedin()) { $_SESSION['last_forward_from'] = current_page_url(); + register_error(elgg_echo('adminrequired')); forward(); } } diff --git a/languages/en.php b/languages/en.php index 1972a81e7..017bc42dd 100644 --- a/languages/en.php +++ b/languages/en.php @@ -28,6 +28,9 @@ $english = array( 'logoutok' => "You have been logged out.", 'logouterror' => "We couldn't log you out. Please try again.", + 'loggedinrequired' => "You must be logged in to view that page.", + 'adminrequired' => "You must be an administrator to view that page.", + /** * Errors */ |