From 703c42f7781ebfd08c936ee6233ca589beedd324 Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 24 May 2013 09:02:54 +0000 Subject: [PATCH] change ftp1 to ftp2 --- .../default/controllers/AuthorController.php | 19 +++++++++---------- .../views/scripts/author/newdata.phtml | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index e8240980..0b9d6f0e 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -2384,7 +2384,7 @@ class AuthorController extends Zend_Controller_Action // 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)"; $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. 保存数据评审状态 //导入元数据 @$iso->saveDB($this->db); @@ -2484,8 +2484,12 @@ class AuthorController extends Zend_Controller_Action //ftp路径 $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->execute(); $row = $sth->fetch(); @@ -2495,7 +2499,7 @@ class AuthorController extends Zend_Controller_Action //$old=umask(0); //@mkdir($homedir,0777); //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 @@ -2513,14 +2517,11 @@ class AuthorController extends Zend_Controller_Action return true; }else{ - $uid = 109; - $gid = 1002; - $passwd = $this->genRandomString(16); //$sql = "UPDATE proftpusers SET passwd=?,uid=?,gid=?,homedir=? WHERE userid=?"; //$sth = $this->db->prepare($sql); //$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); if($rs) { @@ -2542,14 +2543,12 @@ class AuthorController extends Zend_Controller_Action } else{ - $uid = 109; - $gid = 1002; $passwd = $this->genRandomString(16); //$sql = "INSERT INTO proftpusers (userid,passwd,uid,gid,homedir) VALUES (?,?,?,?,?)"; //$sth = $this->db->prepare($sql); //$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); if($rs) { diff --git a/application/default/views/scripts/author/newdata.phtml b/application/default/views/scripts/author/newdata.phtml index abe534ac..b9452845 100644 --- a/application/default/views/scripts/author/newdata.phtml +++ b/application/default/views/scripts/author/newdata.phtml @@ -96,7 +96,7 @@ function getFtp(uuid){ { if(data.statu > 0) { - var html = '

临时FTP帐号信息(此帐号仅对应当前数据集!)

ftp://ftp1.westgis.ac.cn/

'+ + var html = '

临时FTP帐号信息(此帐号仅对应当前数据集!)

ftp://ftp2.westgis.ac.cn/

'+ '

用户名:'+data.user+ '

密码:'+data.passwd+'

' +'

或直接点击此链接

';