Skip to content

Commit

Permalink
MDL-17143 Some improvements suggested by Petr applied. Merged from 19…
Browse files Browse the repository at this point in the history
…_STABLE
  • Loading branch information
stronk7 committed Nov 11, 2008
1 parent d9c2628 commit 1ba3293
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion user/edit_form.php
Expand Up @@ -64,7 +64,7 @@ function definition_after_data() {
if ($user = $DB->get_record('user', array('id'=>$userid))) {

// remove description
if (!$DB->get_record('role_assignments', array('userid'=>$userid)) && empty($user->description) && !empty($CFG->profilesforenrolledusersonly)) {
if (empty($user->description) && !empty($CFG->profilesforenrolledusersonly) && !$DB->get_record('role_assignments', array('userid'=>$userid))) {
$mform->removeElement('description');
}

Expand Down
2 changes: 1 addition & 1 deletion user/editadvanced_form.php
Expand Up @@ -78,7 +78,7 @@ function definition_after_data() {
$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) && !empty($CFG->profilesforenrolledusersonly) && !$can_edit_user) {
if (empty($user->description) && !empty($CFG->profilesforenrolledusersonly) && !$can_edit_user && !$DB->get_record('role_assignments', array('userid'=>$userid))) {
$mform->removeElement('description');
}

Expand Down
3 changes: 1 addition & 2 deletions user/view.php
Expand Up @@ -211,8 +211,7 @@

if ($user->description && !isset($hiddenfields['description'])) {
$has_courseid = ($course->id != SITEID);
if (!$DB->get_record('role_assignments', array('userid'=>$id))
&& !$has_courseid && !empty($CFG->profilesforenrolledusersonly)) {
if (!$has_courseid && !empty($CFG->profilesforenrolledusersonly) && !$DB->get_record('role_assignments', array('userid'=>$id))) {
echo get_string('profilenotshown', 'moodle').'<hr />';
} else {
echo format_text($user->description, FORMAT_MOODLE)."<hr />";
Expand Down

0 comments on commit 1ba3293

Please sign in to comment.