MDL-30625 fail gracefully when admins not defined

This commit is contained in:
Petr Skoda
2011-12-09 09:04:43 +01:00
parent bb6ccfa53d
commit b8d13becf9
+4
View File
@@ -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;