1 一条元数据项目对应的多个虚拟目录对应到一个数据下载项

2 修正了多个虚拟目录不能下载的问题(ticket #63)
This commit is contained in:
wlx 2009-03-08 02:57:48 +00:00
parent f3b6fc5849
commit 1ad1451c4d
2 changed files with 9 additions and 4 deletions

View File

@ -544,6 +544,7 @@ class DataController extends Zend_Controller_Action
}
/*
* 数据下载根据UUID进行判断
* 一次只下载一个数据(一个元数据项)
*/
function downloadAction()
{
@ -559,6 +560,9 @@ class DataController extends Zend_Controller_Action
$bigfile=($this->view->md['filesize']>5);
$this->view->userpass=md5('westdc'.rand(1000,9999));
$this->view->ftptime=date('Y-m-d H:i:s', strtotime('+1 week'));
$sql=$this->db->quoteInto("select * from ftpuser where userid=?",$userid);
$row=$this->db->fetchRow($sql);
$datacount=$row['datacount']+1;
foreach ($rows as $row) {
$url=$row['linkage'];
$p=parse_url($url);
@ -585,7 +589,7 @@ class DataController extends Zend_Controller_Action
->setBody(file_get_contents($url));
} else {
//是一个FTP返回用户名称和密码说明
if (!$updateftp && $p['host']=='ftp.westgis.ac.cn')
if ($p['host']=='ftp.westgis.ac.cn')
{
//添加FTP帐号信息以及时间控制信息只更新一次
$updateftp=true;
@ -599,7 +603,8 @@ class DataController extends Zend_Controller_Action
"password"=>$this->view->userpass,
"path"=>$path,
"maxdata"=>$this->view->config->download->max,
"time"=>$this->view->ftptime);
"time"=>$this->view->ftptime,
"datacount"=>$datacount);
if ($g6->createuser($uu)) {
$this->view->userpass=$g6->pwd;
$this->view->ftptime=$g6->time;

View File

@ -120,8 +120,8 @@ class G6ftp
if ($this->getuserpath1($user->path)) {
$sql=$this->db->quoteInto("update g6ftpusersettings set configvalue=configvalue||'\n'||? where configname='AccessList' and userid=".$userid,$this->getuserpath1($user->path));
$this->db->query($sql);
$sql="update ftpuser set ts_invalid=?,datacount=datacount+1 where userid=?";
$this->db->query($sql,array($user->time,$user->id));
$sql="update ftpuser set ts_invalid=?,datacount=? where userid=?";
$this->db->query($sql,array($user->time,$user->datacount,$user->id));
} else {
$sql="select pwd,ts_invalid from ftpuser where userid=?";
$u=$this->db->fetchRow($sql,array($user->id));