diff --git a/user/edit.php b/user/edit.php index 1b5aca55e84..36db01e35fe 100644 --- a/user/edit.php +++ b/user/edit.php @@ -21,6 +21,10 @@ error("You can only edit your own information"); } + if (isguest()) { + error("The guest user cannot edit their profile."); + } + /// If data submitted, then process and store. diff --git a/user/view.php b/user/view.php index 73be896783d..e1026d09c52 100644 --- a/user/view.php +++ b/user/view.php @@ -35,7 +35,7 @@ print_header("Personal profile: $fullname", "Personal profile: $fullname", "$fullname", ""); } - if ($course->category) { + if ($course->category and ! isguest() ) { if (!isstudent($course->id, $user->id) && !isteacher($course->id, $user->id)) { print_heading("$fullname is not enrolled in this course"); print_footer($course); @@ -59,7 +59,7 @@ echo "
"; echo "

$user->firstname $user->lastname

"; echo "
"; - if ($id == $USER->id) { + if ($id == $USER->id and !isguest()) { echo "

"; echo ""; echo "id\">"; @@ -80,7 +80,9 @@ echo "city, ".$COUNTRIES["$user->country"]); + if ($user->city or $user->country) { + print_row("Location:", "$user->city, ".$COUNTRIES["$user->country"]); + } if (isteacher($course->id)) { if ($user->address) { @@ -112,7 +114,7 @@ echo "
"; // Print other functions - if ($id == $USER->id) { + if ($id == $USER->id and !isguest() ) { echo "
"; echo "

"; echo "id\">";