andrewhancox/Moodle-jQuery-Lightbox-Gallery — Issue #1: lack of visibility checking in view.php
Author: dracono
Created: 2011-12-12 09:39:55+00:00
State: open

Hidden galleries are still can be viewed.

Here is a patch:

``` php
--- /tmp/lightboxgallery/view.php 2011-11-16 13:12:44.000000000 +0100
+++ lightboxgallery/view.php 2011-12-09 14:20:52.000000000 +0100
@@ -47,11 +47,15 @@
require_capability('mod/lightboxgallery:edit', $context);
}

+ if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $context)) {
+ notice(get_string("activityiscurrentlyhidden"),$CFG->wwwroot . '/course/view.php?id=' . $course->id);
+ }
+
lightboxgallery_config_defaults();
```