-
Bug
-
Resolution: Fixed
-
Minor
-
2.3.2
-
MOODLE_23_STABLE
-
MOODLE_24_STABLE
-
w42_
MDL-35904_m24_mainadmin -
Today, our moodle installation started to send out the update notification mails with some secondary admin's name as sender, not with the primary admin's name.
Looking into /lib/pluginlib.php in cron_notify(), I realized that you fetch the list of all admins who should be notified with
$admins = get_admins();
|
and later derive the mainadmin as the first element of this list with
$mainadmin = reset($admins);
|
This derivation can be equal to the result of get_admin(), but you can't be sure. It would be great if you could replace
reset($admins);
|
with
get_admin();
|
Furthermore, this approach seems to be used several times as a quick grep showed to me:
$ grep -r "reset(\$admins)" .
|
./lib/pluginlib.php: $mainadmin = reset($admins);
|
./lib/installlib.php: $admin = reset($admins);
|
./portfolio/googledocs/db/upgrade.php: $mainadmin = reset($admins);
|
./portfolio/picasa/db/upgrade.php: $mainadmin = reset($admins);
|
./repository/googledocs/db/upgrade.php: $mainadmin = reset($admins);
|
./repository/picasa/db/upgrade.php: $mainadmin = reset($admins);
|
./admin/cli/upgrade.php:$admin = reset($admins);
|
Thanks in advance
Alex