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'; include 'core/layout/mail.php';
$layout = ob_get_clean(); $layout = ob_get_clean();
$mail = new PHPMailer\PHPMailer\PHPMailer; $mail = new PHPMailer\PHPMailer\PHPMailer;
// $mail->SMTPDebug = PHPMailer\PHPMailer\SMTP::DEBUG_SERVER;
// Mail // Mail
try{ try{
// Paramètres SMTP // Paramètres SMTP
if ($this->getdata(['config','smtp','enable'])) { if ($this->getdata(['config','smtp','enable'])) {
// $mail->SMTPDebug = PHPMailer\PHPMailer\SMTP::DEBUG_SERVER;
$mail->isSMTP(); $mail->isSMTP();
$mail->SMTPAutoTLS = false;
$mail->Host = $this->getdata(['config','smtp','host']); $mail->Host = $this->getdata(['config','smtp','host']);
$mail->Port = (int) $this->getdata(['config','smtp','port']); $mail->Port = (int) $this->getdata(['config','smtp','port']);
if ($this->getData(['config','smtp','auth'])) { if ($this->getData(['config','smtp','auth'])) {

View File

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

View File

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