';
- if ((!empty($send) || !empty($preview) || !empty($edit)) && (empty($messagebody))) {
- echo $OUTPUT->notification(get_string('allfieldsrequired'));
- }
+if ((!empty($send) || !empty($preview) || !empty($edit)) && (empty($messagebody))) {
+ echo $OUTPUT->notification(get_string('allfieldsrequired'));
+}
- if (count($SESSION->emailto[$id])) {
- $usehtmleditor = can_use_html_editor();
- require("message.html");
- }
+if (count($SESSION->emailto[$id])) {
+ $usehtmleditor = can_use_html_editor();
+ require("message.html");
+}
- echo $OUTPUT->footer();
+echo $OUTPUT->footer();
-?>
+?>
\ No newline at end of file
diff --git a/user/policy.php b/user/policy.php
index b008a82005..40951e9a7c 100644
--- a/user/policy.php
+++ b/user/policy.php
@@ -1,61 +1,90 @@
-libdir.'/filelib.php');
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see .
- $agree = optional_param('agree', 0, PARAM_BOOL);
+/**
+ * This file is part of the User section Moodle
+ *
+ * @copyright 1999 Martin Dougiamas http://dougiamas.com
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package user
+ */
- define('MESSAGE_WINDOW', true); // This prevents the message window coming up
+require_once('../config.php');
+require_once($CFG->libdir.'/filelib.php');
- if (!isloggedin()) {
- require_login();
- }
+$agree = optional_param('agree', 0, PARAM_BOOL);
- if ($agree and confirm_sesskey()) { // User has agreed
- if (!isguestuser()) { // Don't remember guests
- if (!$DB->set_field('user', 'policyagreed', 1, array('id'=>$USER->id))) {
- print_error('cannotsaveagreement');
- }
- }
- $USER->policyagreed = 1;
-
- if (!empty($SESSION->wantsurl)) {
- $wantsurl = $SESSION->wantsurl;
- unset($SESSION->wantsurl);
- redirect($wantsurl);
- } else {
- redirect($CFG->wwwroot.'/');
+$url = new moodle_url($CFG->wwwroot.'/user/policy.php');
+if ($agree !== 0) {
+ $url->param('agree', $agree);
+}
+$PAGE->set_url($url);
+
+define('MESSAGE_WINDOW', true); // This prevents the message window coming up
+
+if (!isloggedin()) {
+ require_login();
+}
+
+if ($agree and confirm_sesskey()) { // User has agreed
+ if (!isguestuser()) { // Don't remember guests
+ if (!$DB->set_field('user', 'policyagreed', 1, array('id'=>$USER->id))) {
+ print_error('cannotsaveagreement');
}
- exit;
}
+ $USER->policyagreed = 1;
- $strpolicyagree = get_string('policyagree');
- $strpolicyagreement = get_string('policyagreement');
- $strpolicyagreementclick = get_string('policyagreementclick');
+ if (!empty($SESSION->wantsurl)) {
+ $wantsurl = $SESSION->wantsurl;
+ unset($SESSION->wantsurl);
+ redirect($wantsurl);
+ } else {
+ redirect($CFG->wwwroot.'/');
+ }
+ exit;
+}
- $PAGE->set_title($strpolicyagreement);
- $PAGE->set_heading($SITE->fullname);
- $PAGE->navbar->add($strpolicyagreement);
+$strpolicyagree = get_string('policyagree');
+$strpolicyagreement = get_string('policyagreement');
+$strpolicyagreementclick = get_string('policyagreementclick');
- echo $OUTPUT->header();
- echo $OUTPUT->heading($strpolicyagreement);
+$PAGE->set_title($strpolicyagreement);
+$PAGE->set_heading($SITE->fullname);
+$PAGE->navbar->add($strpolicyagreement);
- $mimetype = mimeinfo('type', $CFG->sitepolicy);
- if ($mimetype == 'document/unknown') {
- //fallback for missing index.php, index.html
- $mimetype = 'text/html';
- }
+echo $OUTPUT->header();
+echo $OUTPUT->heading($strpolicyagreement);
+
+$mimetype = mimeinfo('type', $CFG->sitepolicy);
+if ($mimetype == 'document/unknown') {
+ //fallback for missing index.php, index.html
+ $mimetype = 'text/html';
+}
+
+echo '
';
+echo '
';
- echo '
';
- echo '
';
-
- $formcontinue = html_form::make_button('policy.php', array('agree'=>1), get_string('yes'));
- $formcancel = html_form::make_button($CFG->wwwroot.'/login/logout.php', array(), get_string('no'));
- echo $OUTPUT->confirm($strpolicyagree, $formcontinue, $formcancel);
+$formcontinue = html_form::make_button('policy.php', array('agree'=>1), get_string('yes'));
+$formcancel = html_form::make_button($CFG->wwwroot.'/login/logout.php', array(), get_string('no'));
+echo $OUTPUT->confirm($strpolicyagree, $formcontinue, $formcancel);
- echo $OUTPUT->footer();
+echo $OUTPUT->footer();
-?>
+?>
\ No newline at end of file
diff --git a/user/portfolio.php b/user/portfolio.php
index 84a204f5c0..d9a4f8c59f 100644
--- a/user/portfolio.php
+++ b/user/portfolio.php
@@ -1,5 +1,28 @@
.
+
+/**
+ * This file is part of the User section Moodle
+ *
+ * @copyright 1999 Martin Dougiamas http://dougiamas.com
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package user
+ */
+
require_once(dirname(dirname(__FILE__)) . '/config.php');
if (empty($CFG->enableportfolios)) {
@@ -10,9 +33,17 @@ require_once($CFG->libdir . '/portfoliolib.php');
$config = optional_param('config', 0, PARAM_INT);
$hide = optional_param('hide', 0, PARAM_INT);
-
$course = optional_param('course', SITEID, PARAM_INT);
+$url = new moodle_url($CFG->wwwroot.'/user/portfolio.php', array('course'=>$course));
+if ($hide !== 0) {
+ $url->param('hide', $hide);
+}
+if ($config !== 0) {
+ $url->param('config', $config);
+}
+$PAGE->set_url($url);
+
if (! $course = $DB->get_record("course", array("id"=>$course))) {
print_error('invalidcourseid');
}
@@ -91,4 +122,4 @@ if ($display) {
}
echo $OUTPUT->footer();
-?>
+?>
\ No newline at end of file
diff --git a/user/portfoliologs.php b/user/portfoliologs.php
index d2ef8b1794..c08f11c775 100644
--- a/user/portfoliologs.php
+++ b/user/portfoliologs.php
@@ -1,5 +1,28 @@
.
+
+/**
+ * This file is part of the User section Moodle
+ *
+ * @copyright 1999 Martin Dougiamas http://dougiamas.com
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package user
+ */
+
require_once(dirname(dirname(__FILE__)) . '/config.php');
if (empty($CFG->enableportfolios)) {
@@ -9,6 +32,9 @@ if (empty($CFG->enableportfolios)) {
require_once($CFG->libdir . '/portfoliolib.php');
$course = optional_param('course', SITEID, PARAM_INT);
+
+$url = new moodle_url($CFG->wwwroot.'/user/portfoliologs.php', array('course'=>$course));
+
if (! $course = $DB->get_record("course", array("id"=>$course))) {
print_error('invalidcourseid');
}
@@ -22,6 +48,14 @@ require_login($course, false);
$page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 10, PARAM_INT);
+if ($page !== 0) {
+ $url->param('page', $page);
+}
+if ($perpage !== 0) {
+ $url->param('perpage', $perpage);
+}
+$PAGE->set_url($url);
+
$PAGE->set_title("$course->fullname: $fullname: $strportfolios");
$PAGE->set_heading($course->fullname);
diff --git a/user/repository.php b/user/repository.php
index db59f2e30f..087c066f4e 100644
--- a/user/repository.php
+++ b/user/repository.php
@@ -1,12 +1,40 @@
-.
+
+/**
+ * This file is part of the User section Moodle
+ *
+ * @copyright 1999 Martin Dougiamas http://dougiamas.com
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package user
+ */
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->dirroot . '/repository/lib.php');
$config = optional_param('config', 0, PARAM_INT);
-
$course = optional_param('course', SITEID, PARAM_INT);
+$url = new moodle_url($CFG->wwwroot.'/user/repository.php', array('course'=>$course));
+if ($config !== 0) {
+ $url->param('config', $config);
+}
+$PAGE->set_url($url);
+
if (! $course = $DB->get_record("course", array("id"=>$course))) {
print_error('invalidcourseid');
}
diff --git a/user/selector/search.php b/user/selector/search.php
index b7f198a85a..d5f71903ae 100644
--- a/user/selector/search.php
+++ b/user/selector/search.php
@@ -1,38 +1,33 @@
-.
/**
* Code to search for users in response to an ajax call from a user selector.
*
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- * @package userselector
- *//** */
+ * @copyright 1999 Martin Dougiamas http://dougiamas.com
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package user
+ */
require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->dirroot . '/user/selector/lib.php');
+$PAGE->set_url(new moodle_url($CFG->wwwroot.'/user/selector/search.php'));
+
// In developer debug mode, when there is a debug=1 in the URL send as plain text
// for easier debugging.
if (debugging('', DEBUG_DEVELOPER) && optional_param('debug', false, PARAM_BOOL)) {
diff --git a/user/view.php b/user/view.php
index 37e07871e7..a841cadc7d 100644
--- a/user/view.php
+++ b/user/view.php
@@ -1,181 +1,214 @@
-dirroot.'/user/profile/lib.php');
- require_once($CFG->dirroot.'/tag/lib.php');
-
- $id = optional_param('id', 0, PARAM_INT); // user id
- $course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site)
- $enable = optional_param('enable', 0, PARAM_BOOL); // enable email
- $disable = optional_param('disable', 0, PARAM_BOOL); // disable email
+.
+
+/**
+ * Display profile for a particular user
+ *
+ * @copyright 1999 Martin Dougiamas http://dougiamas.com
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package user
+ */
+
+require_once("../config.php");
+require_once($CFG->dirroot.'/user/profile/lib.php');
+require_once($CFG->dirroot.'/tag/lib.php');
+
+$id = optional_param('id', 0, PARAM_INT); // user id
+$course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site)
+$enable = optional_param('enable', 0, PARAM_BOOL); // enable email
+$disable = optional_param('disable', 0, PARAM_BOOL); // disable email
+
+if (empty($id)) { // See your own profile by default
+ require_login();
+ $id = $USER->id;
+}
- if (empty($id)) { // See your own profile by default
- require_login();
- $id = $USER->id;
- }
+$url = new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$id));
+if ($course !== 0) {
+ $url->param('course', $course);
+}
+if ($enable !== 0) {
+ $url->param('enable', $enable);
+}
+if ($disable !== 0) {
+ $url->param('disable', $disable);
+}
+$PAGE->set_url($url);
- if (! $user = $DB->get_record("user", array("id"=>$id))) {
- print_error('invaliduserid');
- }
+if (! $user = $DB->get_record("user", array("id"=>$id))) {
+ print_error('invaliduserid');
+}
- if (! $course = $DB->get_record("course", array("id"=>$course))) {
- print_error('invalidcourseid');
- }
+if (! $course = $DB->get_record("course", array("id"=>$course))) {
+ print_error('invalidcourseid');
+}
- // special hack for cli installer - continue to site settings
- $systemcontext = get_context_instance(CONTEXT_SYSTEM);
- if ($SITE->shortname === '' and has_capability('moodle/site:config', $systemcontext)) {
- redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php');
- }
+// special hack for cli installer - continue to site settings
+$systemcontext = get_context_instance(CONTEXT_SYSTEM);
+if ($SITE->shortname === '' and has_capability('moodle/site:config', $systemcontext)) {
+ redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php');
+}
/// Set up page URL for blocks etc
- if ($course->id == SITEID) {
- $PAGE->set_url('user/view.php', array('id' => $user->id));
- } else {
- $PAGE->set_url('user/view.php', array('id' => $user->id, 'course' => $course->id));
- }
+if ($course->id == SITEID) {
+ $PAGE->set_url('user/view.php', array('id' => $user->id));
+} else {
+ $PAGE->set_url('user/view.php', array('id' => $user->id, 'course' => $course->id));
+}
/// Make sure the current user is allowed to see this user
- if (empty($USER->id)) {
- $currentuser = false;
- } else {
- $currentuser = ($user->id == $USER->id);
- }
+if (empty($USER->id)) {
+ $currentuser = false;
+} else {
+ $currentuser = ($user->id == $USER->id);
+}
- if ($course->id == SITEID) {
- $coursecontext = get_context_instance(CONTEXT_SYSTEM); // SYSTEM context
- } else {
- $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); // Course context
- }
- $usercontext = get_context_instance(CONTEXT_USER, $user->id); // User context
+if ($course->id == SITEID) {
+ $coursecontext = $systemcontext; // SYSTEM context
+} else {
+ $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); // Course context
+}
+$usercontext = get_context_instance(CONTEXT_USER, $user->id); // User context
- $PAGE->set_context($usercontext);
+$PAGE->set_context($usercontext);
- if (!empty($CFG->forcelogin) || $course->id != SITEID) {
- // do not force parents to enrol
- if (!$DB->get_record('role_assignments', array('userid'=>$USER->id, 'contextid'=>$usercontext->id))) {
- require_login($course->id);
- }
+if (!empty($CFG->forcelogin) || $course->id != SITEID) {
+ // do not force parents to enrol
+ if (!$DB->get_record('role_assignments', array('userid'=>$USER->id, 'contextid'=>$usercontext->id))) {
+ require_login($course->id);
}
+}
- if (!empty($CFG->forceloginforprofiles)) {
- require_login();
- if (isguest()) {
- redirect(get_login_url());
- }
+if (!empty($CFG->forceloginforprofiles)) {
+ require_login();
+ if (has_capability('moodle/legacy:guest', $systemcontext, 0, false)) {
+ redirect(get_login_url());
}
+}
- $strpersonalprofile = get_string('personalprofile');
- $strparticipants = get_string("participants");
- $struser = get_string("user");
+$strpersonalprofile = get_string('personalprofile');
+$strparticipants = get_string("participants");
+$struser = get_string("user");
- $fullname = fullname($user, has_capability('moodle/site:viewfullnames', $coursecontext));
+$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $coursecontext));
- $link = null;
- if (has_capability('moodle/course:viewparticipants', $coursecontext) || has_capability('moodle/site:viewparticipants', $systemcontext)) {
- $link = new moodle_url($CFG->wwwroot."/user/index.php", array('id'=>$course->id));
- }
- if ($course->id===SITEID) {
- $PAGE->navbar->ignore_active();
- }
- $PAGE->navbar->add($strparticipants, $link);
+$link = null;
+if (has_capability('moodle/course:viewparticipants', $coursecontext) || has_capability('moodle/site:viewparticipants', $systemcontext)) {
+ $link = new moodle_url($CFG->wwwroot."/user/index.php", array('id'=>$course->id));
+}
+if ($course->id===SITEID) {
+ $PAGE->navbar->ignore_active();
+}
+$PAGE->navbar->add($strparticipants, $link);
/// If the user being shown is not ourselves, then make sure we are allowed to see them!
- if (!$currentuser) {
+if (!$currentuser) {
- $PAGE->set_title("$strpersonalprofile: ");
- $PAGE->set_heading("$strpersonalprofile: ");
+ $PAGE->set_title("$strpersonalprofile: ");
+ $PAGE->set_heading("$strpersonalprofile: ");
- if ($course->id == SITEID) { // Reduce possibility of "browsing" userbase at site level
- if ($CFG->forceloginforprofiles and !isteacherinanycourse()
- and !isteacherinanycourse($user->id)
- and !has_capability('moodle/user:viewdetails', $usercontext)) { // Teachers can browse and be browsed at site level. If not forceloginforprofiles, allow access (bug #4366)
+ if ($course->id == SITEID) { // Reduce possibility of "browsing" userbase at site level
+ if ($CFG->forceloginforprofiles and !isteacherinanycourse()
+ and !isteacherinanycourse($user->id)
+ and !has_capability('moodle/user:viewdetails', $usercontext)) { // Teachers can browse and be browsed at site level. If not forceloginforprofiles, allow access (bug #4366)
- $PAGE->navbar->add($struser);
- echo $OUTPUT->header();
- echo $OUTPUT->heading(get_string('usernotavailable', 'error'));
- echo $OUTPUT->footer();
- exit;
- }
- } else { // Normal course
- // check capabilities
- if (!has_capability('moodle/user:viewdetails', $coursecontext) &&
- !has_capability('moodle/user:viewdetails', $usercontext)) {
- print_error('cannotviewprofile');
- }
+ $PAGE->navbar->add($struser);
+ echo $OUTPUT->header();
+ echo $OUTPUT->heading(get_string('usernotavailable', 'error'));
+ echo $OUTPUT->footer();
+ exit;
+ }
+ } else { // Normal course
+ // check capabilities
+ if (!has_capability('moodle/user:viewdetails', $coursecontext) &&
+ !has_capability('moodle/user:viewdetails', $usercontext)) {
+ print_error('cannotviewprofile');
+ }
- if (!has_capability('moodle/course:view', $coursecontext, $user->id, false)) {
- if (has_capability('moodle/course:view', $coursecontext)) {
- $PAGE->navbar->add($fullname);
- echo $OUTPUT->heading(get_string('notenrolled', $fullname));
- } else {
- $PAGE->navbar->add($struser);
- echo $OUTPUT->heading(get_string('notenrolledprofile'));
- }
- echo $OUTPUT->continue_button($_SERVER['HTTP_REFERER']);
- echo $OUTPUT->footer();
- exit;
+ if (!has_capability('moodle/course:view', $coursecontext, $user->id, false)) {
+ if (has_capability('moodle/course:view', $coursecontext)) {
+ $PAGE->navbar->add($fullname);
+ echo $OUTPUT->heading(get_string('notenrolled', $fullname));
+ } else {
+ $PAGE->navbar->add($struser);
+ echo $OUTPUT->heading(get_string('notenrolledprofile'));
}
+ echo $OUTPUT->continue_button($_SERVER['HTTP_REFERER']);
+ echo $OUTPUT->footer();
+ exit;
}
+ }
- // If groups are in use, make sure we can see that group
- if (groups_get_course_groupmode($course) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $coursecontext)) {
- require_login();
- ///this is changed because of mygroupid
- $gtrue = (bool)groups_get_all_groups($course->id, $user->id);
- if (!$gtrue) {
- print_error("groupnotamember", '', "../course/view.php?id=$course->id");
- }
+ // If groups are in use, make sure we can see that group
+ if (groups_get_course_groupmode($course) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $coursecontext)) {
+ require_login();
+ ///this is changed because of mygroupid
+ $gtrue = (bool)groups_get_all_groups($course->id, $user->id);
+ if (!$gtrue) {
+ print_error("groupnotamember", '', "../course/view.php?id=$course->id");
}
}
+}
/// We've established they can see the user's name at least, so what about the rest?
- $PAGE->navbar->add($struser);
- $PAGE->set_title("$course->fullname: $strpersonalprofile: $fullname");
- $PAGE->set_heading($course->fullname);
- echo $OUTPUT->header();
+$PAGE->navbar->add($struser);
+$PAGE->set_title("$course->fullname: $strpersonalprofile: $fullname");
+$PAGE->set_heading($course->fullname);
+echo $OUTPUT->header();
- if (($course->id != SITEID) and ! isguest() ) { // Need to have access to a course to see that info
- if (!has_capability('moodle/course:view', $coursecontext, $user->id)) {
- echo $OUTPUT->heading(get_string('notenrolled', '', $fullname));
- echo $OUTPUT->footer();
- die;
- }
+if (($course->id != SITEID) and ! has_capability('moodle/legacy:guest', $systemcontext, 0, false) ) { // Need to have access to a course to see that info
+ if (!has_capability('moodle/course:view', $coursecontext, $user->id)) {
+ echo $OUTPUT->heading(get_string('notenrolled', '', $fullname));
+ echo $OUTPUT->footer();
+ die;
}
+}
- if ($user->deleted) {
- echo $OUTPUT->heading(get_string('userdeleted'));
- if (!has_capability('moodle/user:update', $coursecontext)) {
- echo $OUTPUT->footer();
- die;
- }
+if ($user->deleted) {
+ echo $OUTPUT->heading(get_string('userdeleted'));
+ if (!has_capability('moodle/user:update', $coursecontext)) {
+ echo $OUTPUT->footer();
+ die;
}
+}
/// OK, security out the way, now we are showing the user
- add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id");
+add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id");
- if ($course->id != SITEID) {
- $user->lastaccess = false;
- if ($lastaccess = $DB->get_record('user_lastaccess', array('userid'=>$user->id, 'courseid'=>$course->id))) {
- $user->lastaccess = $lastaccess->timeaccess;
- }
+if ($course->id != SITEID) {
+ $user->lastaccess = false;
+ if ($lastaccess = $DB->get_record('user_lastaccess', array('userid'=>$user->id, 'courseid'=>$course->id))) {
+ $user->lastaccess = $lastaccess->timeaccess;
}
+}
/// Get the hidden field list
- if (has_capability('moodle/user:viewhiddendetails', $coursecontext)) {
- $hiddenfields = array();
- } else {
- $hiddenfields = array_flip(explode(',', $CFG->hiddenuserfields));
- }
+if (has_capability('moodle/user:viewhiddendetails', $coursecontext)) {
+ $hiddenfields = array();
+} else {
+ $hiddenfields = array_flip(explode(',', $CFG->hiddenuserfields));
+}
/// Print tabs at top
/// This same call is made in:
@@ -183,366 +216,366 @@
/// /user/edit.php
/// /course/user.php
- $currenttab = 'profile';
- $showroles = 1;
- if (!$user->deleted) {
- include('tabs.php');
- }
+$currenttab = 'profile';
+$showroles = 1;
+if (!$user->deleted) {
+ include('tabs.php');
+}
- if (is_mnet_remote_user($user)) {
- $sql = "
- SELECT DISTINCT h.id, h.name, h.wwwroot,
- a.name as application, a.display_name
- FROM {mnet_host} h, {mnet_application} a
- WHERE h.id = ? AND h.applicationid = a.id
- ORDER BY a.display_name, h.name";
+if (is_mnet_remote_user($user)) {
+ $sql = "
+ SELECT DISTINCT h.id, h.name, h.wwwroot,
+ a.name as application, a.display_name
+ FROM {mnet_host} h, {mnet_application} a
+ WHERE h.id = ? AND h.applicationid = a.id
+ ORDER BY a.display_name, h.name";
- $remotehost = $DB->get_record_sql($sql, array($user->mnethostid));
+ $remotehost = $DB->get_record_sql($sql, array($user->mnethostid));
- echo '
'.get_string('remoteappuser', $remotehost->application)." \n";
- if ($USER->id == $user->id) {
- if ($remotehost->application =='moodle') {
- echo "Remote {$remotehost->display_name}: wwwroot}/user/edit.php\">{$remotehost->name} ".get_string('editremoteprofile')."