Merge branch 'MDL-52892' of https://github.com/dg711/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 23 Feb 2016 01:39:26 +0000 (09:39 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Tue, 23 Feb 2016 01:39:26 +0000 (09:39 +0800)
message/lib.php

index 9ded749..77a82dd 100644 (file)
@@ -1528,11 +1528,7 @@ function message_print_user ($user=false, $iscontact=false, $isblocked=false, $i
 
     if ($user === false) {
         echo $OUTPUT->user_picture($USER, $userpictureparams);
-    } else if (core_user::is_real_user($user->id)) { // If not real user, then don't show any links.
-        $userpictureparams['link'] = false;
-        echo $OUTPUT->user_picture($USER, $userpictureparams);
-        echo fullname($user);
-    } else {
+    } else if (core_user::is_real_user($user->id)) {
         echo $OUTPUT->user_picture($user, $userpictureparams);
 
         $link = new moodle_url("/message/index.php?id=$user->id");
@@ -1552,6 +1548,10 @@ function message_print_user ($user=false, $iscontact=false, $isblocked=false, $i
         } else {
             message_contact_link($user->id, 'block', $return, $script, $includeicontext);
         }
+    } else { // If not real user, then don't show any links.
+        $userpictureparams['link'] = false;
+        echo $OUTPUT->user_picture($USER, $userpictureparams);
+        echo fullname($user);
     }
 }