Skip to content

Commit

Permalink
MDL-18066 - import_backup_file_silently - better handling of missing …
Browse files Browse the repository at this point in the history
…$USER. Credit goes to Gabriel Mazetto.
  • Loading branch information
stronk7 committed Jan 30, 2009
1 parent 613d0f8 commit 5648e66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backup/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ function backup_file2data ($file,&$data) {
function import_backup_file_silently($pathtofile,$destinationcourse,$emptyfirst=false,$userdata=false, $preferences=array()) {
global $CFG,$SESSION,$USER; // is there such a thing on cron? I guess so..
global $restore; // ick
if (empty($USER)) {
if (empty($USER) || empty($USER->id)) {
$USER = get_admin();
$USER->admin = 1; // not sure why, but this doesn't get set
}
Expand Down

0 comments on commit 5648e66

Please sign in to comment.