]> git.mjollnir.org Git - moodle.git/commitdiff
Small efficiency improvement for print_user_picture() when it does access the db
authormoodler <moodler>
Fri, 5 Oct 2007 06:32:53 +0000 (06:32 +0000)
committermoodler <moodler>
Fri, 5 Oct 2007 06:32:53 +0000 (06:32 +0000)
lib/weblib.php

index cc8ee571a9f8154e32b1ad5afd9fcdb19f56d6e9..9f5abfc763f2f676ac8e062f018042d417ce0a6c 100644 (file)
@@ -3788,12 +3788,12 @@ function print_user_picture($user, $courseid, $picture=NULL, $size=0, $return=fa
             $userobj = new StdClass; // fake it to save DB traffic
             $userobj->id = $user;
             $userobj->picture = $picture;
-            $user = $userobj;
+            $user = clone($userobj);
             unset($userobj);
         }
     }
     if ($needrec) {
-        $user = get_record('user','id',$user);   
+        $user = get_record('user','id',$user, '', '', '', '', 'id,firstname,lastname,imagealt');   
     }
 
     if ($link) {
@@ -6548,4 +6548,4 @@ function fix_align_rtl($align) {
 
 
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
\ No newline at end of file
+?>