Skip to content

Commit

Permalink
User preferences were not getting set!
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 23, 2005
1 parent 0353801 commit 108adee
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,10 @@ function set_user_preferences($prefarray, $userid=NULL) {
}

if (empty($userid)){
if(!empty($USER) && !empty($USER->id)) {
$userid = $USER->id;
}
else {
return false;
if (!empty($USER) && !empty($USER->id)) {
$userid = NULL; // Continue with the current user below
} else {
return false; // No-one to set!
}
}

Expand Down

0 comments on commit 108adee

Please sign in to comment.