Some better security when database is hidden

This commit is contained in:
moodler
2006-03-30 04:37:16 +00:00
parent b9957ccb1d
commit 3d1c33ef01
4 changed files with 18 additions and 2 deletions
+7
View File
@@ -81,8 +81,15 @@
$record = NULL;
}
require_course_login($course, true, $cm);
/// If it's hidden then it's don't show anything. :)
if (empty($cm->visible) and !isteacher($course->id)) {
notice(get_string("activityiscurrentlyhidden"));
}
/// If we have an empty Database then redirect because this page is useless without data
if (isteacher($course->id)) {
if (!record_exists('data_fields','dataid',$data->id)) { // Brand new database!