1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-16 13:48:58 +01:00

[ticket/17135] Remove SMTP auth method option

Symfony Mailer handles SMTP auth method internally.

PHPBB3-17135
This commit is contained in:
rxu 2023-05-05 23:31:01 +07:00
parent 715496b76d
commit d5f411a16d
No known key found for this signature in database
GPG Key ID: 955F0567380E586A
12 changed files with 38 additions and 62 deletions

View File

@ -23,7 +23,6 @@ installer:
smtp_delivery : ~ smtp_delivery : ~
smtp_host: ~ smtp_host: ~
smtp_port: ~ smtp_port: ~
smtp_auth: ~
smtp_user: ~ smtp_user: ~
smtp_pass: ~ smtp_pass: ~

View File

@ -473,7 +473,6 @@ class acp_board
'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => true), 'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => true),
'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true), 'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true),
'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true), 'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true),
'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true), 'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true),
'smtp_verify_peer' => array('lang' => 'SMTP_VERIFY_PEER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'smtp_verify_peer' => array('lang' => 'SMTP_VERIFY_PEER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
@ -884,30 +883,6 @@ class acp_board
]; ];
} }
/**
* Select mail authentication method
*/
function mail_auth_select($selected_method, $key = '')
{
global $user;
$auth_methods = ['PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP'];
$s_smtp_auth_options = [];
foreach ($auth_methods as $method)
{
$s_smtp_auth_options[] = [
'value' => $method,
'selected' => $selected_method == $method,
'label' => $user->lang('SMTP_' . str_replace('-', '_', $method)),
];
}
return [
'options' => $s_smtp_auth_options,
];
}
/** /**
* Select full folder action * Select full folder action
*/ */

View File

@ -435,7 +435,6 @@ class phpbb_questionnaire_phpbb_data_provider
'secure_downloads' => true, 'secure_downloads' => true,
'session_gc' => true, 'session_gc' => true,
'session_length' => true, 'session_length' => true,
'smtp_auth_method' => true,
'smtp_delivery' => true, 'smtp_delivery' => true,
'topics_per_page' => true, 'topics_per_page' => true,
'version' => true, 'version' => true,

View File

@ -287,7 +287,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename_short', '
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path', 'images/smilies'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path', 'images/smilies');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_per_page', '50'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_per_page', '50');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_allow_self_signed', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_allow_self_signed', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_auth_method', 'PLAIN');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_delivery', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_delivery', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25');

View File

@ -553,15 +553,8 @@ $lang = array_merge($lang, array(
'SEND_TEST_EMAIL_EXPLAIN' => 'This will send a test email to the address defined in your account.', 'SEND_TEST_EMAIL_EXPLAIN' => 'This will send a test email to the address defined in your account.',
'SMTP_ALLOW_SELF_SIGNED' => 'Allow self-signed SSL certificates', 'SMTP_ALLOW_SELF_SIGNED' => 'Allow self-signed SSL certificates',
'SMTP_ALLOW_SELF_SIGNED_EXPLAIN'=> 'Allow connections to SMTP server with self-signed SSL certificate. <br><em><strong>Warning:</strong> Allowing self-signed SSL certificates may cause security implications.</em>', 'SMTP_ALLOW_SELF_SIGNED_EXPLAIN'=> 'Allow connections to SMTP server with self-signed SSL certificate. <br><em><strong>Warning:</strong> Allowing self-signed SSL certificates may cause security implications.</em>',
'SMTP_AUTH_METHOD' => 'Authentication method for SMTP',
'SMTP_AUTH_METHOD_EXPLAIN' => 'Only used if a username/password is set, ask your provider if you are unsure which method to use.',
'SMTP_CRAM_MD5' => 'CRAM-MD5',
'SMTP_DIGEST_MD5' => 'DIGEST-MD5',
'SMTP_LOGIN' => 'LOGIN',
'SMTP_PASSWORD' => 'SMTP password', 'SMTP_PASSWORD' => 'SMTP password',
'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.<br><em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>', 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.<br><em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>',
'SMTP_PLAIN' => 'PLAIN',
'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP',
'SMTP_PORT' => 'SMTP server port', 'SMTP_PORT' => 'SMTP server port',
'SMTP_PORT_EXPLAIN' => 'Only change this if you know your SMTP server is on a different port.', 'SMTP_PORT_EXPLAIN' => 'Only change this if you know your SMTP server is on a different port.',
'SMTP_SERVER' => 'SMTP server address', 'SMTP_SERVER' => 'SMTP server address',

View File

@ -0,0 +1,38 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v400;
use phpbb\db\migration\migration;
class remove_smtp_auth_method extends migration
{
public function effectively_installed()
{
return !$this->config->offsetExists('smtp_auth_method');
}
public static function depends_on()
{
return [
'\phpbb\db\migration\data\v400\dev',
];
}
public function update_data()
{
return [
['config.remove', ['smtp_auth_method']],
];
}
}

View File

@ -195,7 +195,6 @@ class install extends \phpbb\console\command\command
$iohandler->set_input('smtp_delivery', $config['email']['smtp_delivery']); $iohandler->set_input('smtp_delivery', $config['email']['smtp_delivery']);
$iohandler->set_input('smtp_host', $config['email']['smtp_host']); $iohandler->set_input('smtp_host', $config['email']['smtp_host']);
$iohandler->set_input('smtp_port', $config['email']['smtp_port']); $iohandler->set_input('smtp_port', $config['email']['smtp_port']);
$iohandler->set_input('smtp_auth', $config['email']['smtp_auth']);
$iohandler->set_input('smtp_user', $config['email']['smtp_user']); $iohandler->set_input('smtp_user', $config['email']['smtp_user']);
$iohandler->set_input('smtp_pass', $config['email']['smtp_pass']); $iohandler->set_input('smtp_pass', $config['email']['smtp_pass']);
$iohandler->set_input('submit_email', 'submit'); $iohandler->set_input('submit_email', 'submit');

View File

@ -97,9 +97,6 @@ class installer_configuration implements ConfigurationInterface
->scalarNode('smtp_port') ->scalarNode('smtp_port')
->defaultValue(null) ->defaultValue(null)
->end() ->end()
->scalarNode('smtp_auth')
->defaultValue(null)
->end()
->scalarNode('smtp_user') ->scalarNode('smtp_user')
->defaultValue(null) ->defaultValue(null)
->end() ->end()

View File

@ -150,7 +150,6 @@ class add_config_settings extends database_task
'smtp_delivery' => $this->install_config->get('smtp_delivery'), 'smtp_delivery' => $this->install_config->get('smtp_delivery'),
'smtp_host' => $this->install_config->get('smtp_host'), 'smtp_host' => $this->install_config->get('smtp_host'),
'smtp_port' => $this->install_config->get('smtp_port'), 'smtp_port' => $this->install_config->get('smtp_port'),
'smtp_auth_method' => $this->install_config->get('smtp_auth'),
'smtp_username' => $this->install_config->get('smtp_user'), 'smtp_username' => $this->install_config->get('smtp_user'),
'smtp_password' => $this->install_config->get('smtp_pass'), 'smtp_password' => $this->install_config->get('smtp_pass'),

View File

@ -52,12 +52,9 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta
$smtp_delivery = $this->io_handler->get_input('smtp_delivery', ''); $smtp_delivery = $this->io_handler->get_input('smtp_delivery', '');
$smtp_host = $this->io_handler->get_input('smtp_host', '', true); $smtp_host = $this->io_handler->get_input('smtp_host', '', true);
$smtp_port = $this->io_handler->get_input('smtp_port', ''); $smtp_port = $this->io_handler->get_input('smtp_port', '');
$smtp_auth = $this->io_handler->get_input('smtp_auth', '');
$smtp_user = $this->io_handler->get_input('smtp_user', '', true); $smtp_user = $this->io_handler->get_input('smtp_user', '', true);
$smtp_passwd = $this->io_handler->get_input('smtp_pass', '', true); $smtp_passwd = $this->io_handler->get_input('smtp_pass', '', true);
$auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP');
// Check if data is sent // Check if data is sent
if ($this->io_handler->get_input('submit_email', false)) if ($this->io_handler->get_input('submit_email', false))
{ {
@ -65,22 +62,11 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta
$this->install_config->set('smtp_delivery', $smtp_delivery); $this->install_config->set('smtp_delivery', $smtp_delivery);
$this->install_config->set('smtp_host', $smtp_host); $this->install_config->set('smtp_host', $smtp_host);
$this->install_config->set('smtp_port', $smtp_port); $this->install_config->set('smtp_port', $smtp_port);
$this->install_config->set('smtp_auth', $smtp_auth);
$this->install_config->set('smtp_user', $smtp_user); $this->install_config->set('smtp_user', $smtp_user);
$this->install_config->set('smtp_pass', $smtp_passwd); $this->install_config->set('smtp_pass', $smtp_passwd);
} }
else else
{ {
$auth_options = array();
foreach ($auth_methods as $method)
{
$auth_options[] = array(
'value' => $method,
'label' => 'SMTP_' . str_replace('-', '_', $method),
'selected' => false,
);
}
$email_form = array( $email_form = array(
'email_enable' => array( 'email_enable' => array(
'label' => 'ENABLE_EMAIL', 'label' => 'ENABLE_EMAIL',
@ -126,12 +112,6 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta
'type' => 'text', 'type' => 'text',
'default' => $smtp_port, 'default' => $smtp_port,
), ),
'smtp_auth' => array(
'label' => 'SMTP_AUTH_METHOD',
'description' => 'SMTP_AUTH_METHOD_EXPLAIN',
'type' => 'select',
'options' => $auth_options,
),
'smtp_user' => array( 'smtp_user' => array(
'label' => 'SMTP_USERNAME', 'label' => 'SMTP_USERNAME',
'description' => 'SMTP_USERNAME_EXPLAIN', 'description' => 'SMTP_USERNAME_EXPLAIN',

View File

@ -419,7 +419,6 @@ class phpbb_functional_test_case extends phpbb_test_case
$iohandler->set_input('email_enable', true); $iohandler->set_input('email_enable', true);
$iohandler->set_input('smtp_delivery', '1'); $iohandler->set_input('smtp_delivery', '1');
$iohandler->set_input('smtp_host', ''); $iohandler->set_input('smtp_host', '');
$iohandler->set_input('smtp_auth', 'PLAIN');
$iohandler->set_input('smtp_user', 'nxuser'); $iohandler->set_input('smtp_user', 'nxuser');
$iohandler->set_input('smtp_pass', 'nxpass'); $iohandler->set_input('smtp_pass', 'nxpass');
$iohandler->set_input('submit_email', 'submit'); $iohandler->set_input('submit_email', 'submit');

View File

@ -38,7 +38,6 @@ installer:
enabled: false enabled: false
smtp_delivery : ~ smtp_delivery : ~
smtp_host: ~ smtp_host: ~
smtp_auth: ~
smtp_user: ~ smtp_user: ~
smtp_pass: ~ smtp_pass: ~