]> git.mjollnir.org Git - moodle.git/commitdiff
fixed problem on user edit page when user not fully setup
authorskodak <skodak>
Thu, 15 Feb 2007 20:43:00 +0000 (20:43 +0000)
committerskodak <skodak>
Thu, 15 Feb 2007 20:43:00 +0000 (20:43 +0000)
user/edit.php

index 81adcbb434173b41fde0ff4b07d12196664cdd80..4c49b9534fda7a8c2782124ba0dc812017f622b4 100644 (file)
         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');
     }