Amélioreation form + param smtp false

This commit is contained in:
Fred Tempez 2020-05-11 12:15:51 +02:00
parent 5542ba5193
commit 73cd16b953
3 changed files with 59 additions and 56 deletions

View File

@ -853,12 +853,13 @@ class common {
include 'core/layout/mail.php';
$layout = ob_get_clean();
$mail = new PHPMailer\PHPMailer\PHPMailer;
// $mail->SMTPDebug = PHPMailer\PHPMailer\SMTP::DEBUG_SERVER;
// Mail
try{
// Paramètres SMTP
if ($this->getdata(['config','smtp','enable'])) {
// $mail->SMTPDebug = PHPMailer\PHPMailer\SMTP::DEBUG_SERVER;
$mail->isSMTP();
$mail->SMTPAutoTLS = false;
$mail->Host = $this->getdata(['config','smtp','host']);
$mail->Port = (int) $this->getdata(['config','smtp','port']);
if ($this->getData(['config','smtp','auth'])) {

View File

@ -14,12 +14,12 @@
* Modification de l'affichage de l'icône de langues
*/
var configdisablei18nDOM = $("#configdisablei18n");
configdisablei18nDOM.on("change", function() {
if ($("input[name=configdisablei18n]").is(':checked')) {
$(".zwiico-flag").css('display','none');
$("input[name=configSmtpEnable]").on("change", function() {
if ($("input[name=configSmtpEnable]").is(':checked')) {
$(".configSmtpParam").addClass("disabled");
$(".configSmtpParam").slideDown();
} else {
$(".zwiico-flag").css('display','block');
$(".configSmtpParam").removeClass("disabled");
$(".configSmtpParam").slideUp();
}
});

View File

@ -335,53 +335,55 @@
]); ?>
</div>
</div>
<div class="row">
<div class="col5">
<?php echo template::text('configSmtpHost', [
'label' => 'Adresse SMTP',
'placeholder' => 'smtp.fr',
'value' => $this->getData(['config', 'smtp','host'])
]); ?>
<div class="configSmtpParam">
<div class="row">
<div class="col5">
<?php echo template::text('configSmtpHost', [
'label' => 'Adresse SMTP',
'placeholder' => 'smtp.fr',
'value' => $this->getData(['config', 'smtp','host'])
]); ?>
</div>
<div class="col5">
<?php echo template::text('configSmtpSender', [
'label' => 'Mail expéditeur',
'value' => $this->getData(['config', 'smtp','sender'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('configSmtpPort', [
'label' => 'Port SMTP',
'placeholder' => '589',
'value' => $this->getData(['config', 'smtp','port'])
]); ?>
</div>
</div>
<div class="col5">
<?php echo template::text('configSmtpSender', [
'label' => 'Mail expéditeur',
'value' => $this->getData(['config', 'smtp','sender'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('configSmtpPort', [
'label' => 'Port SMTP',
'placeholder' => '589',
'value' => $this->getData(['config', 'smtp','port'])
]); ?>
</div>
</div>
<div class="row">
<div class="col2">
<?php echo template::select('configSmtpAuth', $module::$SMTPauth, [
'label' => 'Authentification',
'selected' => $this->getData(['config', 'smtp','auth'])
]); ?>
</div>
<div class="col4">
<?php echo template::text('configSmtpUsername', [
'label' => 'Nom utilisateur',
'value' => $this->getData(['config', 'smtp','username' ])
]); ?>
</div>
<div class="col4">
<?php echo template::password('configSmtpPassword', [
'label' => 'Mot de passe',
'autocomplete' => 'off',
'value' => $this->getData(['config', 'smtp','password' ])
]); ?>
</div>
<div class="col2">
<?php echo template::select('configSmtpSecure', $module::$SMTPEnc , [
'label' => 'Sécurité',
'selected' => $this->getData(['config', 'smtp','secure'])
]); ?>
<div class="row">
<div class="col2">
<?php echo template::select('configSmtpAuth', $module::$SMTPauth, [
'label' => 'Authentification',
'selected' => $this->getData(['config', 'smtp','auth'])
]); ?>
</div>
<div class="col4">
<?php echo template::text('configSmtpUsername', [
'label' => 'Nom utilisateur',
'value' => $this->getData(['config', 'smtp','username' ])
]); ?>
</div>
<div class="col4">
<?php echo template::password('configSmtpPassword', [
'label' => 'Mot de passe',
'autocomplete' => 'off',
'value' => $this->getData(['config', 'smtp','password' ])
]); ?>
</div>
<div class="col2">
<?php echo template::select('configSmtpSecure', $module::$SMTPEnc , [
'label' => 'Sécurité',
'selected' => $this->getData(['config', 'smtp','secure'])
]); ?>
</div>
</div>
</div>
</div>