Merged feature to email database connection erorrs to someone into stable

This commit is contained in:
moodler
2006-03-01 09:09:03 +00:00
parent b21be43f6b
commit 528d1ca043
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -264,6 +264,12 @@ $CFG->admin = 'admin';
// If you are going to publish your log, or the output of your web stats analyzer
// this will weaken the security of your website.
//
// Email database connection errors to someone. If Moodle cannot connect to the
// database, then email this address with a notice.
//
// $CFG->emailconnectionerrors = [email protected];
//
//
//=========================================================================
+6
View File
@@ -137,6 +137,12 @@ $CFG->httpswwwroot = $CFG->wwwroot;
echo '<p>The site administrator should also check that the database details have been correctly specified in config.php</p>';
echo '</td></tr></table>';
echo '</body></html>';
if (!empty($CFG->emailconnectionerrorsto)) {
mail($CFG->emailconnectionerrorsto,
'WARNING: Database connection error: '.$CFG->wwwroot,
'Connection error: '.$CFG->wwwroot);
}
die;
}