'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
+ 'guest' => CAP_ALLOW,
+ 'student' => CAP_ALLOW,
+ 'teacher' => CAP_ALLOW,
+ 'editingteacher' => CAP_ALLOW,
+ 'coursecreator' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
if ($oldversion < 2006120400) { /// Remove secureforms config setting
execute_sql("DELETE FROM {$CFG->prefix}config where name='secureforms' ;", true);
}
+
+ if ($oldversion < 2006120700) { // add moodle/user:viewdetails to all roles!
+ if ($roles = get_records('role')) {
+ $context = get_context_instance(CONTEXT_SYSTEM);
+ foreach ($roles as $roleid=>$role) {
+ assign_capability('moodle/user:viewdetails', CAP_ALLOW, $roleid, $context->id);
+ }
+ }
+ }
return $result;
$country = $countries[$user->country];
}
}
-
+
+ $usercontext = get_context_instance(CONTEXT_USER, $user->id);
+
+ if ($piclink = ($USER->id == $user->id || has_capability('moodle/user:viewdetails', $context) ||has_capability('moodle/user:viewdetails', $context))) {
+ $profilelink = '<strong><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$course->id.'">'.fullname($user).'</a></strong>';
+ } else {
+ $profilelink = '<strong>'.fullname($user).'</strong>';
+ }
+
$data = array (
- print_user_picture($user->id, $course->id, $user->picture, false, true),
- '<strong><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$course->id.'">'.fullname($user).'</a></strong>'.$hidden);
+ print_user_picture($user->id, $course->id, $user->picture, false, true, $piclink),
+ $profilelink);
+
if (!isset($hiddenfields['city'])) {
$data[] = $user->city;
}
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2006120400; // YYYYMMDD = date
+ $version = 2006120700; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.8 dev'; // Human-friendly version name