MDL-17143 Avoid notices caused by not existing profilesforenrolledusersonly setting. Merged from 19_STABLE
This commit is contained in:
+1
-1
@@ -64,7 +64,7 @@ class user_edit_form extends moodleform {
|
||||
if ($user = $DB->get_record('user', array('id'=>$userid))) {
|
||||
|
||||
// remove description
|
||||
if (!$DB->get_record('role_assignments', array('userid'=>$userid)) && empty($user->description) && $CFG->profilesforenrolledusersonly) {
|
||||
if (!$DB->get_record('role_assignments', array('userid'=>$userid)) && empty($user->description) && !empty($CFG->profilesforenrolledusersonly)) {
|
||||
$mform->removeElement('description');
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class user_editadvanced_form extends moodleform {
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$can_edit_user = has_capability('moodle/user:update', $sitecontext);
|
||||
// remove description
|
||||
if (!$DB->get_record('role_assignments', array('userid'=>$userid)) && empty($user->description) && $CFG->profilesforenrolledusersonly && !$can_edit_user) {
|
||||
if (!$DB->get_record('role_assignments', array('userid'=>$userid)) && empty($user->description) && !empty($CFG->profilesforenrolledusersonly) && !$can_edit_user) {
|
||||
$mform->removeElement('description');
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@
|
||||
if ($user->description && !isset($hiddenfields['description'])) {
|
||||
$has_courseid = ($course->id != SITEID);
|
||||
if (!$DB->get_record('role_assignments', array('userid'=>$id))
|
||||
&& !$has_courseid && $CFG->profilesforenrolledusersonly) {
|
||||
&& !$has_courseid && !empty($CFG->profilesforenrolledusersonly)) {
|
||||
echo get_string('profilenotshown', 'moodle').'<hr />';
|
||||
} else {
|
||||
echo format_text($user->description, FORMAT_MOODLE)."<hr />";
|
||||
|
||||
Reference in New Issue
Block a user