diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index b28592ff..2061905d 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -581,7 +581,7 @@ class Admin_DownController extends Zend_Controller_Action foreach($rs as $data) { if ($data['host']=='ftp1.westgis.ac.cn') $has_ftp1=true; - if ($data['host']=='ftp2.westgis.ac.cn') + if ($data['host']=='ftp.sanjiangyuan.org.cn') $has_ftp2=true; // deal with ftp.westgis.ac.cn, use g6 to add path @@ -594,7 +594,7 @@ class Admin_DownController extends Zend_Controller_Action if ($has_ftp1) { $user=(object)array("id"=>$row['userid'], - "username"=>"westdc_".$row['userid'], + "username"=>"sjy_".$row['userid'], "password"=>$password, "time"=>date('Y-m-d H:i:s', strtotime('+2 week')), //"path"=>$path, @@ -621,12 +621,12 @@ class Admin_DownController extends Zend_Controller_Action if ($has_ftp2) { $user=(object)array("id"=>$row['userid'], - "username"=>"westdc_".$row['userid'], + "username"=>"sjy_".$row['userid'], "password"=>$password, "time"=>date('Y-m-d H:i:s', strtotime('+2 week')), //"path"=>$path, "param"=>"offlineappid=".$finish, - "host"=>'ftp2.westgis.ac.cn', + "host"=>'ftp.sanjiangyuan.org.cn', "maxdata"=>$this->view->config->download->max, "datacount"=>1 //represent one offline application ); @@ -649,10 +649,10 @@ class Admin_DownController extends Zend_Controller_Action $ftphost='ftp://ftp1.westgis.ac.cn'; } else if (!$has_ftp1 && $has_ftp2) { - $ftphost='ftp://ftp2.westgis.ac.cn'; + $ftphost='ftp://ftp.sanjiangyuan.org.cn'; } else if ($has_ftp1 && $has_ftp2) { - $ftphost='ftp://ftp1.westgis.ac.cn 以及 ftp://ftp2.westgis.ac.cn'; + $ftphost='ftp://ftp1.westgis.ac.cn 以及 ftp://ftp.sanjiangyuan.org.cn'; } //发送用户邮件进行信息提示和说明 $mail = new WestdcMailer($this->view->config->smtp); diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 007644fd..cdfda5c7 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1552,16 +1552,16 @@ class DataController extends Zend_Controller_Action $this->view->userpass=$proftp->pwd; $this->view->ftptime=$proftp->time; } - } elseif ($data['host']=='ftp2.westgis.ac.cn') + } elseif ($data['host']=='ftp.sanjiangyuan.org.cn') { //添加FTP2帐号信息以及时间控制信息 $proftp=new Pureftp(); $proftp->db=$this->db; - $this->view->username='westdc_'.$userid; + $this->view->username='sjy_'.$userid; $uu=(object)array("id"=>$userid, "username"=>$this->view->username, "password"=>$this->view->userpass, - "host"=>'ftp2.westgis.ac.cn', + "host"=>'ftp.sanjiangyuan.org.cn', "param"=>"onlineappid=".$onlineappid, "maxdata"=>$this->view->config->download->max, "time"=>$this->view->ftptime, diff --git a/application/default/views/scripts/author/newdata.phtml b/application/default/views/scripts/author/newdata.phtml index b9452845..e5588fe5 100644 --- a/application/default/views/scripts/author/newdata.phtml +++ b/application/default/views/scripts/author/newdata.phtml @@ -96,10 +96,10 @@ function getFtp(uuid){ { if(data.statu > 0) { - var html = '
临时FTP帐号信息(此帐号仅对应当前数据集!)
ftp://ftp2.westgis.ac.cn/
'+ + var html = '临时FTP帐号信息(此帐号仅对应当前数据集!)
ftp://ftp.sanjiangyuan.org.cn/
'+ '用户名:'+data.user+ '
密码:'+data.passwd+'
' - +''; + +''; Alert(html); } } diff --git a/tools/proftp.php b/tools/proftp.php index f7ec1c9e..ab257c05 100644 --- a/tools/proftp.php +++ b/tools/proftp.php @@ -1,5 +1,5 @@ '' and dataorder.selection is null"; + where dataorder.status in (0,5) and dataset.host='ftp.sanjiangyuan.org.cn' and dataset.path<>'' and dataorder.selection is null"; if ($onlineappid>0) $sql.=" and dataorder.onlineappid=".$onlineappid; else if ($offlineappid>0) @@ -36,24 +36,24 @@ { $row = pg_fetch_array($result, $ri); $content.='# path: '.$row['path']."\n"; - $content.='mkdir -p "/home/ftp/westdc_'.$row['userid'].'/'.preg_replace('/^.+[\\\\\\/]/', '', rtrim($row['path'],'/')).'"'."\n"; - $content.='mount --bind "'.$row['path'].'" "/home/ftp/westdc_'.$row['userid'].'/'.preg_replace('/^.+[\\\\\\/]/', '', rtrim($row['path'],'/')).'"'."\n"; + $content.='mkdir -p "/home/ftp/sjy_'.$row['userid'].'/'.preg_replace('/^.+[\\\\\\/]/', '', rtrim($row['path'],'/')).'"'."\n"; + $content.='mount --bind "'.$row['path'].'" "/home/ftp/sjy_'.$row['userid'].'/'.preg_replace('/^.+[\\\\\\/]/', '', rtrim($row['path'],'/')).'"'."\n"; } $sql="select distinct dataorder.userid,dataset.path,dataservice.uuid from dataorder left join dataset on dataorder.uuid=dataset.uuid left join dataservice on dataorder.uuid=dataservice.uuid - where dataorder.status in (0,5) and dataset.host='ftp2.westgis.ac.cn' and dataset.path<>'' and dataorder.selection is not null and dataservice.service_type in (1,2)"; + where dataorder.status in (0,5) and dataset.host='ftp.sanjiangyuan.org.cn' and dataset.path<>'' and dataorder.selection is not null and dataservice.service_type in (1,2)"; if ($onlineappid>0) $sql.=" and dataorder.onlineappid=".$onlineappid; else if ($offlineappid>0) $sql.=" and dataorder.offlineappid=".$offlineappid; $result = pg_query($link, $sql); $numrows = pg_num_rows($result); - $basepath='/disk1/WestDC/wsndata/'; + $basepath='/data/wsndata/'; for($ri = 0; $ri < $numrows; $ri++) { $row = pg_fetch_array($result, $ri); $content.='# path: '.$row['path']."\n"; - $content.='mkdir -p "/home/ftp/westdc_'.$row['userid'].'/wsn_'.$row['userid'].'"'."\n"; - $content.='mount --bind "'.$basepath.'wsn_'.$row['userid'].'" "/home/ftp/westdc_'.$row['userid'].'/wsn_'.$row['userid'].'"'."\n"; + $content.='mkdir -p "/home/ftp/sjy_'.$row['userid'].'/wsn_'.$row['userid'].'"'."\n"; + $content.='mount --bind "'.$basepath.'wsn_'.$row['userid'].'" "/home/ftp/wsjy_'.$row['userid'].'/wsn_'.$row['userid'].'"'."\n"; } $filename='./proftp-user.sh';