Fix encryption settings to reflect laravel encryption config.

This commit is contained in:
Jérémy Gaulin 2015-08-27 20:50:13 +02:00
parent 942a8c000e
commit aa5e9c6034
4 changed files with 30 additions and 4 deletions

View File

@ -146,6 +146,10 @@ return [
'smtp_password' => 'Password',
'smtp_port' => 'SMTP port',
'smtp_ssl' => 'SSL connection required',
'smtp_encryption' => 'SMTP encryption protocol',
'smtp_encryption_none' => 'No encryption',
'smtp_encryption_tls' => 'TLS',
'smtp_encryption_ssl' => 'SSL',
'sendmail' => 'Sendmail',
'sendmail_path' => 'Sendmail path',
'sendmail_path_comment' => 'Please specify the path of the sendmail program.',

View File

@ -146,6 +146,8 @@ return [
'smtp_password' => 'Mot de passe',
'smtp_port' => 'Port SMTP',
'smtp_ssl' => 'Connexion SSL requise',
'smtp_encryption' => 'Protocole de sécurisation des échanges SMTP',
'smtp_encryption_none' => 'Aucun cryptage',
'sendmail' => 'Sendmail',
'sendmail_path' => 'Chemin vers Sendmail',
'sendmail_path_comment' => 'Saisir le chemin du programme Sendmail.',

View File

@ -44,7 +44,8 @@ class MailSettings extends Model
$this->smtp_port = $config->get('mail.port', 587);
$this->smtp_user = $config->get('mail.username');
$this->smtp_password = $config->get('mail.password');
$this->smtp_authorization = strlen($this->smtp_user);
$this->smtp_authorization = !!strlen($this->smtp_user);
$this->smtp_encryption = $config->get('mail.encryption');
}
public function getSendModeOptions()
@ -80,6 +81,11 @@ class MailSettings extends Model
$config->set('mail.username', null);
$config->set('mail.password', null);
}
if ($settings->smtp_encryption) {
$config->set('mail.encryption', $settings->smtp_encryption);
} else {
$config->set('mail.encryption', null);
}
break;
case self::MODE_SENDMAIL:
@ -97,4 +103,17 @@ class MailSettings extends Model
}
}
/**
* @return array smtp_encryption options values
*/
public function getSmtpEncryptionOptions()
{
return [
'' => 'system::lang.mail.smtp_encryption_none',
'tls' => 'system::lang.mail.smtp_encryption_tls',
'ssl' => 'system::lang.mail.smtp_encryption_ssl',
];
}
}

View File

@ -73,10 +73,11 @@ tabs:
field: send_mode
condition: value[smtp]
smtp_ssl:
type: checkbox
label: system::lang.mail.smtp_ssl
smtp_encryption:
type: dropdown
label: system::lang.mail.smtp_encryption
tab: system::lang.mail.general
span: left
trigger:
action: show
field: send_mode