Projekt

Obecné

Profil

« Předchozí | Další » 

Revize d5af6f06

Přidáno uživatelem Ondřej Fibich před více než 7 roky(ů)

Ref #1068: add support connecting to encrypted SMTP servers.

Zobrazit rozdíly:

application/controllers/settings.php
->value(Settings::get('email_port'))
->help(__('For SMTP settings only.'));
$this->form->dropdown('email_encryption')
->label('Connection encryption')
->options(array
(
'none' => __('none'),
'tsl' => __('TSL'),
'ssl' => __('SSL')
))->selected(Settings::get('email_encryption'))
->help(__('For SMTP settings only.'));
$this->form->input('email_username')
->label('User name')
->value(Settings::get('email_username'))
application/helpers/email.php
switch ($email_driver)
{
case 'smtp':
$conn_encryption = null;
switch (Settings::get('email_encryption')) {
case 'tsl':
$conn_encryption = Swift_Connection_SMTP::ENC_TLS;
break;
case 'ssl':
$conn_encryption = Swift_Connection_SMTP::ENC_SSL;
break;
}
// Create a SMTP connection
$connection = new Swift_Connection_SMTP
(
Settings::get('email_hostname'),
Settings::get('email_port')
Settings::get('email_port'),
$conn_encryption
);
// Do authentication, if part of the DSN
application/i18n/cs_CZ/texts.php
'connected to' => 'Připojeno k',
'connected to device' => 'Připojeno k zařízení',
'connected to interface' => 'Připojeno k rozhraní',
'connection encryption' => 'Šifrování spojení',
'connecting place' => 'Přípojné místo',
'connection request' => 'Žádost o připojení',
'connection owner' => 'Vlastník připojení',
application/libraries/Settings.php
'email_driver' => 'native',
// default email port
'email_port' => 25,
// default email connection encryption
'email_encryption' => 'none',
// default value for prefix of subject of notification
// e-mails to members
'email_subject_prefix' => 'FreenetIS',
application/views/js/settings_email.php
var driver = $("#email_driver option:selected").val();
if (driver != "smtp")
{
$("#email_hostname,#email_port,#email_username,#email_password").attr("disabled", true);
$("#email_hostname,#email_port,#email_encryption,#email_username,#email_password").attr("disabled", true);
}
$("#email_driver").live("change", function()
......
var driver = $("#email_driver option:selected").val();
if (driver != "smtp")
$("#email_hostname,#email_port,#email_username,#email_password").attr("disabled", true);
$("#email_hostname,#email_port,#email_encryption,#email_username,#email_password").attr("disabled", true);
else
$("#email_hostname,#email_port,#email_username,#email_password").removeAttr("disabled");
$("#email_hostname,#email_port,#email_encryption,#email_username,#email_password").removeAttr("disabled");
});

Také k dispozici: Unified diff