fixed problem on user edit page when user not fully setup

This commit is contained in:
skodak
2007-02-15 20:43:00 +00:00
parent e503869636
commit 03a2aac1ec
+13 -4
View File
@@ -14,12 +14,21 @@
error('Course ID was incorrect');
}
require_login($course->id);
if (isguest()) { //TODO: add proper capability to edit own profile and change password too
print_error('guestnoeditprofile');
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 (isguestuser()) {
print_error('guestnoeditprofile');
}
if (!$user = get_record('user', 'id', $USER->id)) {
error('User ID was incorrect');
}