update email config

This commit is contained in:
jack 2018-07-20 12:57:24 +08:00
parent f3d1ba6d3f
commit d3217b11ce
3 changed files with 5 additions and 3 deletions

View File

@ -6,6 +6,7 @@ class Admin_UserController extends Zend_Controller_Action
function preDispatch() function preDispatch()
{ {
$this->db=Zend_Registry::get('db'); $this->db=Zend_Registry::get('db');
$this->config = Zend_Registry::get('config');
$this->view->config = Zend_Registry::get('config'); $this->view->config = Zend_Registry::get('config');
$this->messenger=$this->_helper->getHelper('FlashMessenger'); $this->messenger=$this->_helper->getHelper('FlashMessenger');
$this->view->messages = $this->messenger->getMessages(); $this->view->messages = $this->messenger->getMessages();
@ -256,7 +257,7 @@ class Admin_UserController extends Zend_Controller_Action
$sql="update users set activation=? where email=?"; $sql="update users set activation=? where email=?";
$uid=uniqid(); $uid=uniqid();
$this->db->query($sql,array($uid,$email)); $this->db->query($sql,array($uid,$email));
$mail=new WestdcMailer($this->view->config->smtp); $mail=new WestdcMailer($this->config->smtp);
$body="尊敬的时空三极环境大数据平台用户: $body="尊敬的时空三极环境大数据平台用户:
有人提出了针对此用户名的密码重置请求。 有人提出了针对此用户名的密码重置请求。
@ -268,7 +269,7 @@ class Admin_UserController extends Zend_Controller_Action
"; ";
$body.="http://westdc.westgis.ac.cn/account/fetchpwd/".$username."/".$uid; $body.="http://westdc.westgis.ac.cn/account/fetchpwd/".$username."/".$uid;
$mail->setBodyText($body); $mail->setBodyText($body);
$mail->setFrom($this->view->config->service->email,'时空三极环境大数据平台服务组'); $mail->setFrom($this->config->service->email,'时空三极环境大数据平台服务组');
$mail->addTo($email); $mail->addTo($email);
$mail->setSubject('密码已重置'); $mail->setSubject('密码已重置');
$mail->send(); $mail->send();

View File

@ -60,7 +60,7 @@ offline.security=../data/security.pdf
offline.water_template=../data/water_offline.pdf offline.water_template=../data/water_offline.pdf
offline.font=../data/simhei.ttf offline.font=../data/simhei.ttf
offline.savepath=../data/offlineapp offline.savepath=../data/offlineapp
service.email=westdc@lzb.ac.cn service.email=poles@itpcas.ac.cn
offline.email.template=../data/offline-email.txt offline.email.template=../data/offline-email.txt
offline.email.start_template=../data/offline-start-email.txt offline.email.start_template=../data/offline-start-email.txt
offline.email.finish_template=../data/offline-finish-email.txt offline.email.finish_template=../data/offline-finish-email.txt

View File

@ -5,6 +5,7 @@ class WestdcMailer extends Zend_Mail {
$this->tr=new Zend_Mail_Transport_Smtp($smtp->host, $this->tr=new Zend_Mail_Transport_Smtp($smtp->host,
array('ssl' => $smtp->ssl, array('ssl' => $smtp->ssl,
'auth'=>$smtp->auth, 'auth'=>$smtp->auth,
'port'=> 994,
'username'=>$smtp->username, 'username'=>$smtp->username,
'password'=>$smtp->password)); 'password'=>$smtp->password));
parent::__construct('utf-8'); parent::__construct('utf-8');