From: donal72 <donal72>
Date: Fri, 3 Aug 2007 12:28:33 +0000 (+0000)
Subject: Link to profile editing should not appear on remote-users' profiles (except for the... 
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b4daa48f1e4662b33b0263f97adabe9593a5ab14;p=moodle.git

Link to profile editing should not appear on remote-users' profiles (except for the user himself).
---

diff --git a/user/view.php b/user/view.php
index 0e1f973b57..9b3610f733 100644
--- a/user/view.php
+++ b/user/view.php
@@ -200,10 +200,14 @@
         $remotehost = get_record_sql($sql);
         
         echo '<p class="errorboxcontent">'.get_string('remote'.$remotehost->application.'user')." <br />\n";
-        if ($remotehost->application =='moodle') {
-            echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/user/edit.php\">{$remotehost->name}</a> ".get_string('editremoteprofile')." </p>\n";
+        if ($USER->id == $user->id) {
+            if ($remotehost->application =='moodle') {
+                echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/user/edit.php\">{$remotehost->name}</a> ".get_string('editremoteprofile')." </p>\n";
+            } else {
+                echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/\">{$remotehost->name}</a> ".get_string('gotoyourserver')." </p>\n";
+            }
         } else {
-            echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/\">{$remotehost->name}</a> ".get_string('gotoyourserver')." </p>\n";
+            echo "Remote {$remotehost->display_name}: <a href=\"{$remotehost->wwwroot}/\">{$remotehost->name}</a></p>\n";
         }
     }