MDL-45961 Customise this page button on user profile page only works correctly for users own profile

This commit is contained in:
NeillM 2014-06-13 09:32:16 +01:00
parent 5c1049f72b
commit 2479cecad9

View file

@ -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