From 03a2aac1ecc3a982fb8ec47ce28a2a65e7c2cf9e Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 15 Feb 2007 20:43:00 +0000 Subject: [PATCH] fixed problem on user edit page when user not fully setup --- user/edit.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/user/edit.php b/user/edit.php index 81adcbb434..4c49b9534f 100644 --- a/user/edit.php +++ b/user/edit.php @@ -14,12 +14,21 @@ error('Course ID was incorrect'); } - require_login($course->id); + if ($course->id != SITEID) { + require_login($course); + } else if (!isloggedin()) { + // user might not be fully setup, do not use require login here! + if (empty($CFG->loginhttps)) { + redirect($CFG->wwwroot .'/login/index.php'); + } else { + $wwwroot = str_replace('http:','https:', $CFG->wwwroot); + redirect($wwwroot .'/login/index.php'); + } + } - if (isguest()) { //TODO: add proper capability to edit own profile and change password too + if (isguestuser()) { print_error('guestnoeditprofile'); } - if (!$user = get_record('user', 'id', $USER->id)) { error('User ID was incorrect'); } -- 2.39.5