From 2479cecad96b930239b1b480fe770d4c0c69500b Mon Sep 17 00:00:00 2001 From: NeillM Date: Fri, 13 Jun 2014 09:32:16 +0100 Subject: [PATCH] MDL-45961 Customise this page button on user profile page only works correctly for users own profile --- user/profile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user/profile.php b/user/profile.php index 708d6b02338..7a66f3cc6ee 100644 --- a/user/profile.php +++ b/user/profile.php @@ -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