Merge branch 'MDL-53234-support-email' of https://github.com/brendanheywood/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 15 Mar 2016 05:43:22 +0000 (13:43 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Tue, 15 Mar 2016 05:43:22 +0000 (13:43 +0800)
admin/settings/server.php

index cc43e70..573ed4b 100644 (file)
@@ -18,11 +18,10 @@ $ADMIN->add('server', $temp);
 
 // "supportcontact" settingpage
 $temp = new admin_settingpage('supportcontact', new lang_string('supportcontact','admin'));
-if (isloggedin()) {
-    global $USER;
-    $primaryadminemail = $USER->email;
-    $primaryadminname  = fullname($USER, true);
-
+$primaryadmin = get_admin();
+if ($primaryadmin) {
+    $primaryadminemail = $primaryadmin->email;
+    $primaryadminname  = fullname($primaryadmin, true);
 } else {
     // no defaults during installation - admin user must be created first
     $primaryadminemail = NULL;