Merged feature to email database connection erorrs to someone into stable
This commit is contained in:
@@ -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];
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
//=========================================================================
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user