实现FTP帐号控制以及黑河专题分类

This commit is contained in:
wlx 2012-10-22 14:20:20 +00:00
parent c16f0485ee
commit 4534b00cb8
1 changed files with 8 additions and 4 deletions

View File

@ -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);