From 603d4c7226bfbb9cf26cd61895625cad42dcc389 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 10 Jun 2002 04:33:46 +0000 Subject: [PATCH] Better handling of guest user --- user/edit.php | 4 ++++ user/view.php | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/user/edit.php b/user/edit.php index 1b5aca55e8..36db01e35f 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 73be896783..e1026d09c5 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\">"; -- 2.39.5