From 9ba3704e88a6fbe6f273c86e815b3910d4c90bab Mon Sep 17 00:00:00 2001 From: Aram HARUTYUNYAN Date: Fri, 14 Jun 2013 14:14:20 +0000 Subject: [PATCH] Issue #0001636: reste encore travailler sur les styles du dialog --- application/controllers/UserController.php | 17 +++-------------- .../views/default/scripts/user/login.phtml | 3 ++- .../views/default/scripts/user/motpasse.phtml | 10 +++++++--- library/Application/Controller/Plugin/Auth.php | 4 ++++ library/Scores/Mail.php | 15 ++++++++++++++- public/themes/default/scripts/motpasse.js | 2 +- 6 files changed, 31 insertions(+), 20 deletions(-) diff --git a/application/controllers/UserController.php b/application/controllers/UserController.php index b721e6fb6..128dfdd16 100644 --- a/application/controllers/UserController.php +++ b/application/controllers/UserController.php @@ -553,7 +553,7 @@ class UserController extends Zend_Controller_Action * Sends email to the specific client, who requests for forgotten password */ public function motpasseAction() - { + { $request = $this->getRequest(); $name = 'Mot de passe, Identifiant oubliés'; $params = array( @@ -602,25 +602,14 @@ class UserController extends Zend_Controller_Action $mail->setBodyHTML($params['mailbody']); $mail->setFrom('support'); $mail->addToKey('support'); + $mail->setReplyTo($params['email']); try { $mail->send(); $message = "Votre demande avec les informations suivantes a été envoyée. Nous vous contacterons prochainement."; } catch ( Zend_Mail_Transport_Exception $e ){ $message = $e->getMessage(); - } - - // this is temporary mail sending, changing to Zend_mail is needed - $header = 'MIME-Version: 1.0' . "\r\n"; - $header .= 'Content-type: text/html; charset=utf-8' . "\r\n"; - $header .= 'FROM: '.$params['email']. "\r\n" ; - $header .= 'Reply-To: '.$params['email']; - if (mail('support@scores-decisions.com', $name, $params['mailbody'], $header)){ - $message = "Votre demande avec les informations suivantes a été envoyée. Nous vous contacterons prochainement."; - } else { - $message = "Votre demande n'a pas été envoyé à cause d'un problème technique. Essaye dans 10 minutes."; - } - // end of temporary mail sending + } } $this->view->assign('message', $message); } diff --git a/application/views/default/scripts/user/login.phtml b/application/views/default/scripts/user/login.phtml index ec15f9fa0..3016244bb 100644 --- a/application/views/default/scripts/user/login.phtml +++ b/application/views/default/scripts/user/login.phtml @@ -1,6 +1,7 @@ doctype()?> + headMeta();?> headTitle();?> @@ -606,7 +607,7 @@ $(document).ready(function(){ - +
action('motpasse','user', null); ?>
diff --git a/application/views/default/scripts/user/motpasse.phtml b/application/views/default/scripts/user/motpasse.phtml index 699602aad..37422962d 100644 --- a/application/views/default/scripts/user/motpasse.phtml +++ b/application/views/default/scripts/user/motpasse.phtml @@ -38,7 +38,7 @@ label#frm { font-weight: bold; } input#frm { - width: 28em; + width: 28em !important; } .brsr { border-style:solid; @@ -69,6 +69,10 @@ input#frm { height:25px; } +#htxt #ftxt { + width:400px; +} + #alwayshidden { display:none; } @@ -82,7 +86,7 @@ input#frm { $params = $this->params; ?> -
+
Cher client,
 
 Pour recevoir votre mot de passe ou votre identifiant oubliés, nous vous invitons à saisir les informations ci-dessous et cliquer sur valider.
@@ -151,7 +155,7 @@ S'il vous plaît envoyez-moi encore une fois l'identifiant et(ou) le mot de pass
 
 
-
+
 Les informations que vous nous communiquez dans ce formulaire seront utilisées exclusivement par nos services internes pour le traitement de votre demande et pour personnaliser la communication.
 
diff --git a/library/Application/Controller/Plugin/Auth.php b/library/Application/Controller/Plugin/Auth.php index 5cabace8f..e9ded6048 100644 --- a/library/Application/Controller/Plugin/Auth.php +++ b/library/Application/Controller/Plugin/Auth.php @@ -13,6 +13,10 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract if ($request->getControllerName()=='user' && $request->getActionName()=='login') { $checkAuth = false; } + + if ($request->getControllerName()=='user' && $request->getActionName()=='motpasse') { + $checkAuth = false; + } if ($request->getControllerName()=='fichier' && $request->getClientIp(false)=='78.31.45.206') { diff --git a/library/Scores/Mail.php b/library/Scores/Mail.php index fa64a7066..70b2400ef 100644 --- a/library/Scores/Mail.php +++ b/library/Scores/Mail.php @@ -11,10 +11,14 @@ class Mail { $c = Zend_Registry::get('config'); $this->config = $c->profil->mail; + + $cnfg = array('auth' => 'login', + 'username' => $this->config->username, + 'password' => $this->config->password); $this->mail = new Zend_Mail(); if ($this->config->method == 'smtp') { - $tr = new Zend_Mail_Transport_Smtp($this->config->smtp_host); + $tr = new Zend_Mail_Transport_Smtp($this->config->smtp_host, $cnfg); $this->mail->setDefaultTransport($tr); } else { $tr = new Zend_Mail_Transport_Sendmail(); @@ -32,6 +36,15 @@ class Mail $this->mail->setFrom($email, ucfirst($configKey)); } + /** + * Set Reply-To address + * @param string $email + */ + public function setReplyTo($email) + { + $this->mail->setReplyTo($email); + } + /** * Champ To en fonction de la clé de configuration * @param string $configKey diff --git a/public/themes/default/scripts/motpasse.js b/public/themes/default/scripts/motpasse.js index b56de5996..acd056e8d 100644 --- a/public/themes/default/scripts/motpasse.js +++ b/public/themes/default/scripts/motpasse.js @@ -54,7 +54,7 @@ $('#dlg').dialog({ buttons: [ $.post('/user/motpasse', values, function(data) { $('#dlg').html(data); $('pre').hide(); - $('#vspace').height(50); + $('#htxt').height(50); $('input#frm').attr("disabled", "disabled"); $(".ui-dialog-buttonpane button:contains('Valider')").hide(); });