MDL-55345 user: correct userid when linking to iplookup from profile
authorPaul Holden <pholden@greenhead.ac.uk>
Tue, 26 Jul 2016 10:34:44 +0000 (11:34 +0100)
committerPaul Holden <pholden@greenhead.ac.uk>
Wed, 5 Oct 2016 14:08:38 +0000 (15:08 +0100)
lib/myprofilelib.php

index 49eff29..54ea27c 100644 (file)
@@ -422,7 +422,7 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user,
     // Last ip.
     if (has_capability('moodle/user:viewlastip', $usercontext) && !isset($hiddenfields['lastip'])) {
         if ($user->lastip) {
     // Last ip.
     if (has_capability('moodle/user:viewlastip', $usercontext) && !isset($hiddenfields['lastip'])) {
         if ($user->lastip) {
-            $iplookupurl = new moodle_url('/iplookup/index.php', array('ip' => $user->lastip, 'user' => $USER->id));
+            $iplookupurl = new moodle_url('/iplookup/index.php', array('ip' => $user->lastip, 'user' => $user->id));
             $ipstring = html_writer::link($iplookupurl, $user->lastip);
         } else {
             $ipstring = get_string("none");
             $ipstring = html_writer::link($iplookupurl, $user->lastip);
         } else {
             $ipstring = get_string("none");