Skip to content

Commit

Permalink
MDL-30625 fail gracefully when admins not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak authored and stronk7 committed Dec 9, 2011
1 parent 9cd8fdd commit 81dda1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/datalib.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function get_admin() {
return clone($mainadmin);
}

if (empty($CFG->siteadmins)) { // Should not happen on an ordinary site
return false;
}

foreach (explode(',', $CFG->siteadmins) as $id) {
if ($user = $DB->get_record('user', array('id'=>$id, 'deleted'=>0))) {
$mainadmin = $user;
Expand Down

0 comments on commit 81dda1d

Please sign in to comment.