change ftp1 to ftp2

This commit is contained in:
wlx 2013-05-24 09:02:54 +00:00
parent 170df8fbea
commit 703c42f778
2 changed files with 10 additions and 11 deletions

View File

@ -2384,7 +2384,7 @@ class AuthorController extends Zend_Controller_Action
// 2. 保存变化记录 save changelog & userid for the latest version // 2. 保存变化记录 save changelog & userid for the latest version
$sql = "UPDATE mdversion SET changelog=?,userid=? WHERE id in (select id from mdversion where uuid=? order by ts_created desc limit 1)"; $sql = "UPDATE mdversion SET changelog=?,userid=? WHERE id in (select id from mdversion where uuid=? order by ts_created desc limit 1)";
$this->db->query($sql,array($changelog,$u_id,$row['uuid'])); $this->db->query($sql,array($changelog,$u_id,$row['uuid']));
file_get_contents("http://ftp1.westgis.ac.cn/proftp_upload.php?uuid=".$row['uuid']."&filelist=1"); file_get_contents("http://ftp2.westgis.ac.cn/proftp_upload.php?uuid=".$row['uuid']."&filelist=1");
// 3. 保存数据评审状态 // 3. 保存数据评审状态
//导入元数据 //导入元数据
@$iso->saveDB($this->db); @$iso->saveDB($this->db);
@ -2484,8 +2484,12 @@ class AuthorController extends Zend_Controller_Action
//ftp路径 //ftp路径
$homedir = "/disk1/WestDC/upload/".$uuid."/"; $homedir = "/disk1/WestDC/upload/".$uuid."/";
//ftp用户表
$ftptable=' pureftp ';//ftp2.westgis.ac.cn
$uid = 1002;
$gid = 1002;
$sql = "SELECT * FROM proftpusers WHERE userid='$uname' ORDER BY pkid DESC"; $sql = "SELECT * FROM $ftptable WHERE userid='$uname' ORDER BY pkid DESC";
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
$sth->execute(); $sth->execute();
$row = $sth->fetch(); $row = $sth->fetch();
@ -2495,7 +2499,7 @@ class AuthorController extends Zend_Controller_Action
//$old=umask(0); //$old=umask(0);
//@mkdir($homedir,0777); //@mkdir($homedir,0777);
//umask($old); //umask($old);
$page=file_get_contents('http://ftp1.westgis.ac.cn/proftp_upload.php?uuid='.$uuid); $page=file_get_contents('http://ftp2.westgis.ac.cn/proftp_upload.php?uuid='.$uuid);
if (!empty($page)) die($page);//there are errors in visit ftp page if (!empty($page)) die($page);//there are errors in visit ftp page
@ -2513,14 +2517,11 @@ class AuthorController extends Zend_Controller_Action
return true; return true;
}else{ }else{
$uid = 109;
$gid = 1002;
$passwd = $this->genRandomString(16); $passwd = $this->genRandomString(16);
//$sql = "UPDATE proftpusers SET passwd=?,uid=?,gid=?,homedir=? WHERE userid=?"; //$sql = "UPDATE proftpusers SET passwd=?,uid=?,gid=?,homedir=? WHERE userid=?";
//$sth = $this->db->prepare($sql); //$sth = $this->db->prepare($sql);
//$rs = $sth->execute(array($passwd,$uid,$gid,$homedir,$uname)); //$rs = $sth->execute(array($passwd,$uid,$gid,$homedir,$uname));
$sql="update proftpusers SET passwd='".$passwd."',uid=".$uid.",gid=".$gid.",homedir='".$homedir."' WHERE userid='".$uname."'"; $sql="update ".$ftptable." SET passwd='".$passwd."',uid=".$uid.",gid=".$gid.",homedir='".$homedir."' WHERE userid='".$uname."'";
$rs=$this->db->query($sql); $rs=$this->db->query($sql);
if($rs) if($rs)
{ {
@ -2542,14 +2543,12 @@ class AuthorController extends Zend_Controller_Action
} }
else{ else{
$uid = 109;
$gid = 1002;
$passwd = $this->genRandomString(16); $passwd = $this->genRandomString(16);
//$sql = "INSERT INTO proftpusers (userid,passwd,uid,gid,homedir) VALUES (?,?,?,?,?)"; //$sql = "INSERT INTO proftpusers (userid,passwd,uid,gid,homedir) VALUES (?,?,?,?,?)";
//$sth = $this->db->prepare($sql); //$sth = $this->db->prepare($sql);
//$rs = $sth->execute(array($uname,$passwd,$uid,$gid,$homedir)); //$rs = $sth->execute(array($uname,$passwd,$uid,$gid,$homedir));
$sql="insert into proftpusers (userid,passwd,uid,gid,homedir) values('".$uname."','".$passwd."',109,1002,'".$homedir."')"; $sql="insert into ".$ftptable." (userid,passwd,uid,gid,homedir) values('".$uname."','".$passwd."',".$uid.",".$gid.",'".$homedir."')";
$rs=$this->db->query($sql); $rs=$this->db->query($sql);
if($rs) if($rs)
{ {

View File

@ -96,7 +96,7 @@ function getFtp(uuid){
{ {
if(data.statu > 0) if(data.statu > 0)
{ {
var html = '<p>临时FTP帐号信息<b>(此帐号仅对应当前数据集!)</b></p><p>ftp://ftp1.westgis.ac.cn/</p>'+ var html = '<p>临时FTP帐号信息<b>(此帐号仅对应当前数据集!)</b></p><p>ftp://ftp2.westgis.ac.cn/</p>'+
'<p>用户名:'+data.user+ '<p>用户名:'+data.user+
'</p><p>密码:'+data.passwd+'</p>' '</p><p>密码:'+data.passwd+'</p>'
+'<p><a href="ftp://'+data.user+':'+data.passwd+'@ftp1.westgis.ac.cn/">或直接点击此链接</a></p>'; +'<p><a href="ftp://'+data.user+':'+data.passwd+'@ftp1.westgis.ac.cn/">或直接点击此链接</a></p>';