mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-45961 Customise this page button on user profile page only works correctly for users own profile
This commit is contained in:
parent
5c1049f72b
commit
2479cecad9
1 changed files with 2 additions and 2 deletions
|
@ -156,7 +156,7 @@ if ($PAGE->user_allowed_editing()) {
|
|||
// If we are viewing a system page as ordinary user, and the user turns
|
||||
// editing on, copy the system pages as new user pages, and get the
|
||||
// new page record
|
||||
if (!$currentpage = my_copy_page($USER->id, MY_PAGE_PUBLIC, 'user-profile')) {
|
||||
if (!$currentpage = my_copy_page($userid, MY_PAGE_PUBLIC, 'user-profile')) {
|
||||
print_error('mymoodlesetup');
|
||||
}
|
||||
$PAGE->set_context($usercontext);
|
||||
|
@ -175,7 +175,7 @@ if ($PAGE->user_allowed_editing()) {
|
|||
}
|
||||
|
||||
// Add button for editing page
|
||||
$params = array('edit' => !$edit);
|
||||
$params = array('edit' => !$edit, 'id' => $userid);
|
||||
|
||||
if (!$currentpage->userid) {
|
||||
// viewing a system page -- let the user customise it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue