MDL-33340 completion: Incorrect logic in hidden field check

Credit to Jody Steele
This commit is contained in:
Ankit Agarwal 2012-06-25 14:10:42 +08:00 committed by Dan Poltawski
parent dd89f61e68
commit 986095771b

View File

@ -42,7 +42,7 @@ add_to_log($course->id, 'course', 'report outline', "report/outline/index.php?id
$showlastaccess = true;
$hiddenfields = explode(',', $CFG->hiddenuserfields);
if (array_search('lastaccess', $hiddenfields) and !has_capability('moodle/user:viewhiddendetails', $context)) {
if (array_search('lastaccess', $hiddenfields) !== false and !has_capability('moodle/user:viewhiddendetails', $context)) {
$showlastaccess = false;
}