MDL-21655 big scary enrolment and roles improvements - see tacker for list of changes, includes other minor fixes too

This commit is contained in:
Petr Skoda
2010-03-31 07:41:31 +00:00
parent d1d4813ff2
commit 4f0c2d0009
225 changed files with 2941 additions and 3097 deletions
+4 -3
View File
@@ -113,10 +113,11 @@ if (!empty($CFG->usetags)) {
}
if ($user->id !== -1) {
$user->context = get_context_instance(CONTEXT_USER, $user->id);
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
$editoroptions = array('maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$CFG->maxbytes, 'trusttext'=>false, 'forcehttps'=>false);
$user = file_prepare_standard_editor($user, 'description', $editoroptions, $user->context, 'user_profile', $user->id);
$user = file_prepare_standard_editor($user, 'description', $editoroptions, $usercontext, 'user_profile', $user->id);
} else {
$usercontext = null;
// This is a new user, we don't want to add files here
$editoroptions = array('maxfiles'=>0, 'maxbytes'=>0, 'trusttext'=>false, 'forcehttps'=>false);
}
@@ -151,7 +152,7 @@ if ($usernew = $userform->get_data()) {
$usercreated = true;
} else {
$usernew = file_postupdate_standard_editor($usernew, 'description', $editoroptions, $user->context, 'user_profile', $usernew->id);
$usernew = file_postupdate_standard_editor($usernew, 'description', $editoroptions, $usercontext, 'user_profile', $usernew->id);
$DB->update_record('user', $usernew);
// pass a true $userold here
if (! $authplugin->user_update($user, $userform->get_data())) {