From d7fe98efae87c06bfc641bc02a2785b71c318270 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 6 Dec 2012 03:16:43 +0000 Subject: [PATCH] =?UTF-8?q?#430=20=E5=9C=A8=E7=BA=BF=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/DataController.php | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index fbe5ba7b..8ae7db72 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1102,7 +1102,14 @@ class DataController extends Zend_Controller_Action $onlineappid=$this->_request->getParam('onlineappid'); 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"; $result=$this->db->query($testsql); $rows = $result->fetch(); @@ -1196,7 +1203,7 @@ class DataController extends Zend_Controller_Action { //添加FTP1帐号信息以及时间控制信息,只更新一次 $updateftp1=true; - $proftp=new Proftp(); + $proftp=new Proftp(); $proftp->db=$this->db; //proftp离线用户名和g6的用户名稍有不同 $this->view->username='westdc_'.Zend_Auth::getInstance()->getIdentity()->id; @@ -1207,11 +1214,11 @@ class DataController extends Zend_Controller_Action "param"=>"onlineappid=".$onlineappid, "maxdata"=>$this->view->config->download->max, "time"=>$this->view->ftptime, - "datacount"=>$datacount); - if ($proftp->createuser($uu)) - { - $this->view->userpass=$proftp->pwd; - $this->view->ftptime=$proftp->time; + "datacount"=>$datacount); + if ($proftp->createuser($uu)) + { + $this->view->userpass=$proftp->pwd; + $this->view->ftptime=$proftp->time; } } if ($p['host']=='ftp.westgis.ac.cn') @@ -1239,8 +1246,21 @@ class DataController extends Zend_Controller_Action if (empty($u)) { $sql="insert into dataorder (userid,uuid,ts_created) values(?,?,now())"; $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(); + } /* * 离线申请(可以包括在线数据),在无数据参数时,则显示已有列表 */