diff options
| author | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-12-09 18:31:01 +0200 |
|---|---|---|
| committer | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-12-09 18:31:01 +0200 |
| commit | 3e2610ea83c60805d5e727df6509da6c49fd6c7b (patch) | |
| tree | 28638f7a1cd2e298587f4b3960caf409f7d2d2fa /modules/gallery/helpers/gallery.php | |
| parent | 6aabab4b715ff8ac00cc667e9d0a40c9868410d8 (diff) | |
| parent | c3ef8921260db8e39b6d2a7b4708e3d19f35f8b5 (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, 15 insertions, 1 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 3cf0eacd..2bb55ccb 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -18,13 +18,17 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class gallery_Core { - const VERSION = "3.0 RC2 (Santa Fe)"; + const VERSION = "3.0+ (git)"; /** * If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is * down for maintenance" page. */ static function maintenance_mode() { + // @todo: we need a mechanism here to identify controllers that are still legally accessible + // when the entire Gallery is in maintenance mode. Perhaps a controller class function or + // method? + // https://sourceforge.net/apps/trac/gallery/ticket/1411 if (Router::$controller != "login" && Router::$controller != "combined" && module::get_var("gallery", "maintenance_mode", 0) && @@ -41,8 +45,13 @@ class gallery_Core { * the login page. */ static function private_gallery() { + // @todo: we need a mechanism here to identify controllers that are still legally accessible + // when the entire Gallery is private. Perhaps a controller class function or method? + // https://sourceforge.net/apps/trac/gallery/ticket/1411 if (Router::$controller != "login" && Router::$controller != "combined" && + Router::$controller != "digibug" && + Router::$controller != "rest" && identity::active_user()->guest && !access::user_can(identity::guest(), "view", item::root()) && php_sapi_name() != "cli") { @@ -66,6 +75,11 @@ class gallery_Core { * request should implement the <module>_event::gallery_ready() handler. */ static function ready() { + // Don't keep a session for robots; it's a waste of database space. + if (request::user_agent("robot")) { + Session::instance()->abort_save(); + } + module::event("gallery_ready"); } |
