diff options
| author | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-09-02 22:32:46 +0300 |
|---|---|---|
| committer | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-09-02 22:32:46 +0300 |
| commit | 9572c664d2bfff0877d4f2062eb0ef6665a109cf (patch) | |
| tree | 89c8e2868c1490a0bc578ce4a69c0ed7fae8b5bf /modules/gallery/helpers/gallery.php | |
| parent | a0033ce75968b3c134c0e439046f135b1e646550 (diff) | |
| parent | 511826a33cbbf03bf1e3cb151f1a181b8e6723e8 (diff) | |
Merge remote branch 'gallery3/master'
Diffstat (limited to 'modules/gallery/helpers/gallery.php')
| -rw-r--r-- | modules/gallery/helpers/gallery.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 3f83b23d..924ee76a 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -37,6 +37,22 @@ class gallery_Core { } /** + * If the gallery is only available to registered users and the user is not logged in, present + * the login page. + */ + static function private_gallery() { + if (Router::$controller != "login" && + Router::$controller != "combined" && + identity::active_user()->guest && + !access::user_can(identity::guest(), "view", item::root())) { + Session::instance()->set("continue_url", url::abs_current()); + Router::$controller = "login"; + Router::$controller_path = MODPATH . "gallery/controllers/login.php"; + Router::$method = "html"; + } + } + + /** * This function is called when the Gallery is fully initialized. We relay it to modules as the * "gallery_ready" event. Any module that wants to perform an action at the start of every * request should implement the <module>_event::gallery_ready() handler. |
