MDL-30625 fail gracefully when admins not defined

This commit is contained in:
Petr Skoda
2011-12-09 10:57:42 +01:00
committed by Eloy Lafuente (stronk7)
parent 9cd8fdda3c
commit 81dda1da15
+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;