MDL-8323 Add proper setup of course $CFG variables, fix use of global $COURSE
new function course_setup() thats does proper $CFG-> , locale and themes setup much sooner than print_header() originally (needed for MDL-8067), cleanup of forgotten global $course issues MDL-8067 Fixed several $HTTPSREQUIRED issues - html editor now loads from https (the old hack did not wotk with IE7, new hack is uglier but works), fixed formlibs images (we can not set them in library global scope, we must wait for httpsrequired() and require_login() and od that in function), fixed links in meta.php, fixed help images fixed setting of new $USER values in user edit forms
This commit is contained in:
+3
-2
@@ -6,6 +6,8 @@
|
||||
require_once($CFG->dirroot.'/user/editlib.php');
|
||||
require_once($CFG->dirroot.'/user/profile/lib.php');
|
||||
|
||||
httpsrequired();
|
||||
|
||||
$course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site)
|
||||
|
||||
if (!$course = get_record('course', 'id', $course)) {
|
||||
@@ -13,7 +15,6 @@
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
httpsrequired();
|
||||
|
||||
if (isguest()) { //TODO: add proper capability to edit own profile and change password too
|
||||
print_error('guestnoeditprofile');
|
||||
@@ -77,7 +78,7 @@
|
||||
profile_save_data($usernew);
|
||||
|
||||
// Override old $USER session variable
|
||||
$usernew = (array)get_record('user', 'id', $newuser->id); // reload from db
|
||||
$usernew = (array)get_record('user', 'id', $usernew->id); // reload from db
|
||||
foreach ($usernew as $variable => $value) {
|
||||
$USER->$variable = $value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user