From 8b9ce436838b3e2eaf44fb6fda2597c28eeda561 Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Fri, 6 Jan 2012 15:20:45 +0000 Subject: [PATCH] [-] BO : #PSTEST-335 - Fixed problem with test email --- admin-dev/ajax_send_mail_test.php | 2 +- controllers/admin/AdminEmailsController.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin-dev/ajax_send_mail_test.php b/admin-dev/ajax_send_mail_test.php index e669ff5cb..dc83778e7 100644 --- a/admin-dev/ajax_send_mail_test.php +++ b/admin-dev/ajax_send_mail_test.php @@ -38,7 +38,7 @@ $type = 'text/html'; $to = $_POST['testEmail']; $from = Configuration::get('PS_SHOP_EMAIL'); $smtpLogin = $_POST['smtpLogin']; -$smtpPassword = urldecode($_POST['smtpPassword']); +$smtpPassword = (!empty($_POST['smtpPassword'])) ? urldecode($_POST['smtpPassword']) : Configuration::get('PS_MAIL_PASSWD'); $smtpPort = $_POST['smtpPort']; $smtpEncryption = $_POST['smtpEnc']; diff --git a/controllers/admin/AdminEmailsController.php b/controllers/admin/AdminEmailsController.php index 929a0508b..9de88c2e9 100644 --- a/controllers/admin/AdminEmailsController.php +++ b/controllers/admin/AdminEmailsController.php @@ -57,7 +57,7 @@ class AdminEmailsControllerCore extends AdminController 'PS_MAIL_DOMAIN' => array('title' => $this->l('Mail domain:'), 'desc' => $this->l('Fully qualified domain name (keep it empty if you do not know)'), 'empty' => true, 'validation' => 'isUrl', 'size' => 30, 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL), 'PS_MAIL_SERVER' => array('title' => $this->l('SMTP server:'), 'desc' => $this->l('IP or server name (e.g., smtp.mydomain.com)'), 'validation' => 'isGenericName', 'size' => 30, 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL), 'PS_MAIL_USER' => array('title' => $this->l('SMTP user:'), 'desc' => $this->l('Leave blank if not applicable'), 'validation' => 'isGenericName', 'size' => 30, 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL), - 'PS_MAIL_PASSWD' => array('title' => $this->l('SMTP password:'), 'desc' => $this->l('Leave blank if not applicable'), 'validation' => 'isAnything', 'size' => 30, 'type' => 'password', 'visibility' => Shop::CONTEXT_ALL), + 'PS_MAIL_PASSWD' => array('title' => $this->l('SMTP password:'), 'desc' => $this->l('Leave blank if not applicable'), 'validation' => 'isAnything', 'size' => 30, 'type' => 'password', 'visibility' => Shop::CONTEXT_ALL, 'autocomplete' => false), 'PS_MAIL_SMTP_ENCRYPTION' => array('title' => $this->l('Encryption:'), 'desc' => $this->l('Use an encrypt protocol'), 'type' => 'select', 'cast' => 'strval', 'identifier' => 'mode', 'list' => array(array('mode' => 'off', 'name' => $this->l('None')), array('mode' => 'tls', 'name' => $this->l('TLS')), array('mode' => 'ssl', 'name' => $this->l('SSL'))), 'visibility' => Shop::CONTEXT_ALL), 'PS_MAIL_SMTP_PORT' => array('title' => $this->l('Port:'), 'desc' => $this->l('Number of port to use'), 'validation' => 'isInt', 'size' => 5, 'type' => 'text', 'cast' => 'intval', 'visibility' => Shop::CONTEXT_ALL), ), @@ -67,9 +67,9 @@ class AdminEmailsControllerCore extends AdminController 'title' => $this->l('Test your e-mail configuration'), 'icon' => 'email', 'fields' => array( - 'PS_SHOP_EMAIL' => array('title' => $this->l('Send a test e-mail to'), 'type' => 'text', 'size' => 40, 'id' => 'testEmail'), + 'PS_SHOP_EMAIL' => array('title' => $this->l('Send a test e-mail to'), 'type' => 'text', 'size' => 40, 'id' => 'testEmail'), ), - 'bottom' => '

+ 'bottom' => '

', ) );