Permalink
Browse files

MDL-30625 fail gracefully when admins not defined

  • Loading branch information...
1 parent 9cd8fdd commit 81dda1da152f253b4280acafb8e23b1016bc397d @skodak skodak committed with stronk7 Dec 9, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/datalib.php
View
@@ -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;

0 comments on commit 81dda1d

Please sign in to comment.