From 4534b00cb8ae4d8b65c40f7fe1cf917a0a3f60ae Mon Sep 17 00:00:00 2001 From: wlx Date: Mon, 22 Oct 2012 14:20:20 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0FTP=E5=B8=90=E5=8F=B7?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E4=BB=A5=E5=8F=8A=E9=BB=91=E6=B2=B3=E4=B8=93?= =?UTF-8?q?=E9=A2=98=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/HeiheController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/application/default/controllers/HeiheController.php b/application/default/controllers/HeiheController.php index 9c891309..a44da492 100644 --- a/application/default/controllers/HeiheController.php +++ b/application/default/controllers/HeiheController.php @@ -500,7 +500,7 @@ class HeiheController extends DataController $this->db->query($sql,array($changelog,$u_id,$row['uuid'])); // 处理文件权限和数据信息 - $ftp_user = "qherc".$u_id."upload"; + $ftp_user = "heihe".$u_id."upload"; $sql = "SELECT * FROM pureftp WHERE userid=? AND homedir LIKE ?"; $sth = $this->db->prepare($sql); $sth->execute(array($ftp_user,'%'.$uuid.'%')); @@ -519,6 +519,10 @@ class HeiheController extends DataController $sql="delete from dataset where uuid=?"; $sth = $this->db->prepare($sql); $sth->execute(array($uuid)); + //自动添加数据分类为黑河 + $sql="insert into datasource (uuid,sourceid) values(?,1)"; + $sth=$this->db->prepare($sql); + try{$sth->execute(array($uuid));}catch(Exception $e) {} $sql = "INSERT INTO dataset (uuid,path) VALUES (?,?) RETURNING id"; $sth = $this->db->prepare($sql); @@ -532,7 +536,7 @@ class HeiheController extends DataController $this->jsonexit($data); return true; */ - } + } $temp = $sth->fetch(PDO::FETCH_ASSOC); @@ -637,10 +641,10 @@ class HeiheController extends DataController } //ftp 用户名 - $uname = 'qherc'.$userid.'upload'; + $uname = 'heihe'.$u_id.'upload'; //ftp路径 - $homedir = "/home/wlx/qhhdata/upload/".$uuid."/"; + $homedir = "/var/www/westdc.westgis.ac.cn/data/heihe_upload/".$uuid."/"; $sql = "SELECT * FROM pureftp WHERE userid='$uname' ORDER BY pkid DESC"; $sth = $this->db->prepare($sql);