实现FTP帐号控制以及黑河专题分类
This commit is contained in:
parent
c16f0485ee
commit
4534b00cb8
|
@ -500,7 +500,7 @@ class HeiheController extends DataController
|
||||||
$this->db->query($sql,array($changelog,$u_id,$row['uuid']));
|
$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 ?";
|
$sql = "SELECT * FROM pureftp WHERE userid=? AND homedir LIKE ?";
|
||||||
$sth = $this->db->prepare($sql);
|
$sth = $this->db->prepare($sql);
|
||||||
$sth->execute(array($ftp_user,'%'.$uuid.'%'));
|
$sth->execute(array($ftp_user,'%'.$uuid.'%'));
|
||||||
|
@ -519,6 +519,10 @@ class HeiheController extends DataController
|
||||||
$sql="delete from dataset where uuid=?";
|
$sql="delete from dataset where uuid=?";
|
||||||
$sth = $this->db->prepare($sql);
|
$sth = $this->db->prepare($sql);
|
||||||
$sth->execute(array($uuid));
|
$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";
|
$sql = "INSERT INTO dataset (uuid,path) VALUES (?,?) RETURNING id";
|
||||||
$sth = $this->db->prepare($sql);
|
$sth = $this->db->prepare($sql);
|
||||||
|
@ -637,10 +641,10 @@ class HeiheController extends DataController
|
||||||
}
|
}
|
||||||
|
|
||||||
//ftp 用户名
|
//ftp 用户名
|
||||||
$uname = 'qherc'.$userid.'upload';
|
$uname = 'heihe'.$u_id.'upload';
|
||||||
|
|
||||||
//ftp路径
|
//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";
|
$sql = "SELECT * FROM pureftp WHERE userid='$uname' ORDER BY pkid DESC";
|
||||||
$sth = $this->db->prepare($sql);
|
$sth = $this->db->prepare($sql);
|
||||||
|
|
Loading…
Reference in New Issue