mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-9574 + MDL-9607 fixed undefined $user->id in personal context
This commit is contained in:
parent
69f2e553e3
commit
e6eea4f2f4
1 changed files with 4 additions and 4 deletions
|
@ -24,9 +24,6 @@
|
|||
redirect($CFG->httpswwwroot.'/login/index.php');
|
||||
}
|
||||
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$personalcontext = get_context_instance(CONTEXT_USER, $user->id);
|
||||
|
||||
// Guest can not edit
|
||||
if (isguestuser()) {
|
||||
print_error('guestnoeditprofile');
|
||||
|
@ -45,7 +42,7 @@
|
|||
// User interests separated by commas
|
||||
if (!empty($CFG->usetags)) {
|
||||
require_once($CFG->dirroot.'/tag/lib.php');
|
||||
$user->interests = tag_names_csv(get_item_tags('user',$userid));
|
||||
$user->interests = tag_names_csv(get_item_tags('user', $user->id));
|
||||
}
|
||||
|
||||
// remote users cannot be edited
|
||||
|
@ -53,6 +50,9 @@
|
|||
redirect($CFG->wwwroot . "/user/view.php?course={$course->id}");
|
||||
}
|
||||
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$personalcontext = get_context_instance(CONTEXT_USER, $user->id);
|
||||
|
||||
// check access control
|
||||
if ($user->id == $USER->id) {
|
||||
//editing own profile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue