MDL-60347 core: debugsmtp should be a developer only setting.

This commit is contained in:
Dan Marsden 2019-05-14 21:55:34 +12:00 committed by Eloy Lafuente (stronk7)
parent 7d12c365ca
commit 22dfa6d31d
6 changed files with 14 additions and 5 deletions

View File

@ -35,7 +35,6 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp = new admin_settingpage('debugging', new lang_string('debugging', 'admin'));
$temp->add(new admin_setting_special_debug());
$temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'), new lang_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
$temp->add(new admin_setting_configcheckbox('debugsmtp', new lang_string('debugsmtp', 'admin'), new lang_string('configdebugsmtp', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('perfdebug', new lang_string('perfdebug', 'admin'), new lang_string('configperfdebug', 'admin'), '7', '15', '7'));
$temp->add(new admin_setting_configcheckbox('debugstringids', new lang_string('debugstringids', 'admin'), new lang_string('debugstringids_desc', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('debugvalidators', new lang_string('debugvalidators', 'admin'), new lang_string('configdebugvalidators', 'admin'), 0));

View File

@ -641,6 +641,10 @@ $CFG->admin = 'admin';
// Enable verbose debug information during fetching of email messages from IMAP server.
// $CFG->debugimap = true;
//
// Enable verbose debug information during sending of email messages to SMTP server.
// Note: also requires $CFG->debug set to DEBUG_DEVELOPER.
// $CFG->debugsmtp = true;
//
// Prevent JS caching
// $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!
//

View File

@ -199,7 +199,6 @@ $string['configdbsessions'] = 'If enabled, this setting will use the database to
$string['configdebug'] = 'If you turn this on, then PHP\'s error_reporting will be increased so that more warnings are printed. This is only useful for developers.';
$string['configdebugdisplay'] = 'Set to on, the error reporting will go to the HTML page. This is practical, but breaks XHTML, JS, cookies and HTTP headers in general. Set to off, it will send the output to your server logs, allowing better debugging. The PHP setting error_log controls which log this goes to.';
$string['configdebugpageinfo'] = 'Enable if you want page information printed in page footer.';
$string['configdebugsmtp'] = 'Enable verbose debug information during sending of email messages to SMTP server.';
$string['configdebugvalidators'] = 'Enable if you want to have links to external validator servers in page footer. You may need to create new user with username <em>w3cvalidator</em>, and enable guest access. These changes may allow unauthorized access to server, do not enable on production sites!';
$string['configdefaulthomepage'] = 'This determines the home page for logged in users';
$string['configdefaultrequestcategory'] = 'Courses requested by users will be automatically placed in this category.';
@ -448,7 +447,6 @@ $string['debugminimal'] = 'MINIMAL: Show only fatal errors';
$string['debugnone'] = 'NONE: Do not show any errors or warnings';
$string['debugnormal'] = 'NORMAL: Show errors, warnings and notices';
$string['debugpageinfo'] = 'Show page information';
$string['debugsmtp'] = 'Debug email sending';
$string['debugstringids'] = 'Show origin of languages strings';
$string['debugstringids_desc'] = 'If enabled, language string components and identifiers are displayed when ?strings=1 or &strings=1 is appended to the page URL.';
$string['debugvalidators'] = 'Show validator links';

View File

@ -3394,5 +3394,13 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2019060600.02);
}
if ($oldversion < 2019062900.00) {
// Debugsmtp is now only available via config.php.
$DB->delete_records('config', array('name' => 'debugsmtp'));
// Main savepoint reached.
upgrade_main_savepoint(true, 2019062900.00);
}
return true;
}

View File

@ -5770,7 +5770,7 @@ function get_mailer($action='get') {
} else {
// Use SMTP directly.
$mailer->isSMTP();
if (!empty($CFG->debugsmtp)) {
if (!empty($CFG->debugsmtp) && (!empty($CFG->debugdeveloper))) {
$mailer->SMTPDebug = 3;
}
// Specify main and backup servers.

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2019062800.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2019062900.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.