Try to maintain user preferences synchronised between DB and $USER.

Merged from MOODLE_15_STABLE
This commit is contained in:
stronk7 2005-07-21 18:48:26 +00:00
parent 861480ccab
commit 49d005eefa

View File

@ -763,6 +763,12 @@ function unset_user_preference($name, $userid=NULL) {
}
}
//Delete the preference from $USER
if (isset($USER->preference[$name])) {
unset($USER->preference[$name]);
}
//Then from DB
return delete_records('user_preferences', 'userid', $userid, 'name', $name);
}