#430 在线下载邮件通知

This commit is contained in:
Li Jianxuan 2012-12-06 03:16:43 +00:00
parent e3c233010a
commit d7fe98efae
1 changed files with 29 additions and 9 deletions

View File

@ -1102,7 +1102,14 @@ class DataController extends Zend_Controller_Action
$onlineappid=$this->_request->getParam('onlineappid'); $onlineappid=$this->_request->getParam('onlineappid');
if (empty($uuid)) $this->_redirect('/data'); if (empty($uuid)) $this->_redirect('/data');
$userid=Zend_Auth::getInstance()->getIdentity()->id;
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$userid = $user->id;
}
$testsql="select id from onlineapp where userid='$userid' and uuid='$uuid' order by id desc"; $testsql="select id from onlineapp where userid='$userid' and uuid='$uuid' order by id desc";
$result=$this->db->query($testsql); $result=$this->db->query($testsql);
$rows = $result->fetch(); $rows = $result->fetch();
@ -1196,7 +1203,7 @@ class DataController extends Zend_Controller_Action
{ {
//添加FTP1帐号信息以及时间控制信息只更新一次 //添加FTP1帐号信息以及时间控制信息只更新一次
$updateftp1=true; $updateftp1=true;
$proftp=new Proftp(); $proftp=new Proftp();
$proftp->db=$this->db; $proftp->db=$this->db;
//proftp离线用户名和g6的用户名稍有不同 //proftp离线用户名和g6的用户名稍有不同
$this->view->username='westdc_'.Zend_Auth::getInstance()->getIdentity()->id; $this->view->username='westdc_'.Zend_Auth::getInstance()->getIdentity()->id;
@ -1207,11 +1214,11 @@ class DataController extends Zend_Controller_Action
"param"=>"onlineappid=".$onlineappid, "param"=>"onlineappid=".$onlineappid,
"maxdata"=>$this->view->config->download->max, "maxdata"=>$this->view->config->download->max,
"time"=>$this->view->ftptime, "time"=>$this->view->ftptime,
"datacount"=>$datacount); "datacount"=>$datacount);
if ($proftp->createuser($uu)) if ($proftp->createuser($uu))
{ {
$this->view->userpass=$proftp->pwd; $this->view->userpass=$proftp->pwd;
$this->view->ftptime=$proftp->time; $this->view->ftptime=$proftp->time;
} }
} }
if ($p['host']=='ftp.westgis.ac.cn') if ($p['host']=='ftp.westgis.ac.cn')
@ -1239,8 +1246,21 @@ class DataController extends Zend_Controller_Action
if (empty($u)) { if (empty($u)) {
$sql="insert into dataorder (userid,uuid,ts_created) values(?,?,now())"; $sql="insert into dataorder (userid,uuid,ts_created) values(?,?,now())";
$this->db->query($sql,array($userid,$uuid)); $this->db->query($sql,array($userid,$uuid));
}*/ }*/
} $data = array(
"url"=> "http://" . $_SERVER['HTTP_HOST']."/data/download/uuid/fecdec71-77d1-43c2-b472-8b1c729874cb/onlineappid/5475",
"username"=>$this->view->username,
"password"=>$this->view->userpass,
"time"=>$this->view->ftptime,
);
$mailtp=new EmailText($this->db,'onlineapp-download',$data);
$mail=new WestdcMailer($this->view->config->smtp);
$mail->setBodyText($mailtp->getBody());
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->addTo($user->email);
$mail->setSubject($mailtp->getSubject());
$mail->send();
}
/* /*
* 离线申请(可以包括在线数据),在无数据参数时,则显示已有列表 * 离线申请(可以包括在线数据),在无数据参数时,则显示已有列表
*/ */