diff --git a/admin/settings/development.php b/admin/settings/development.php index 58493dda8d9..09a8a82636e 100644 --- a/admin/settings/development.php +++ b/admin/settings/development.php @@ -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)); diff --git a/config-dist.php b/config-dist.php index 5f4258a3b16..ac730124279 100644 --- a/config-dist.php +++ b/config-dist.php @@ -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! // diff --git a/lang/en/admin.php b/lang/en/admin.php index ad040429e68..680aa0711a0 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -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 w3cvalidator, 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'; diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 62a7d442d8f..a259c6ea872 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -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; } diff --git a/lib/moodlelib.php b/lib/moodlelib.php index d6ffcdefcff..19319dde27b 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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. diff --git a/version.php b/version.php index cb6e8af4e5b..bbd728ff037 100644 --- a/version.php +++ b/version.php @@ -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.