add ftp2 support
This commit is contained in:
parent
9938873d23
commit
3ca45e3618
|
@ -397,17 +397,24 @@ class Admin_DownController extends Zend_Controller_Action
|
||||||
$sql="select * from dataorder left join dataset on dataset.uuid=dataorder.uuid where dataorder.offlineappid=?";
|
$sql="select * from dataorder left join dataset on dataset.uuid=dataorder.uuid where dataorder.offlineappid=?";
|
||||||
$rs=$this->db->fetchAll($sql,array($finish));
|
$rs=$this->db->fetchAll($sql,array($finish));
|
||||||
$has_ftp1=false;
|
$has_ftp1=false;
|
||||||
|
$has_ftp2=false;
|
||||||
foreach($rs as $data) {
|
foreach($rs as $data) {
|
||||||
if ($data['host']=='ftp1.westgis.ac.cn')
|
if ($data['host']=='ftp1.westgis.ac.cn')
|
||||||
$has_ftp1=true;
|
$has_ftp1=true;
|
||||||
|
if ($data['host']=='ftp2.westgis.ac.cn')
|
||||||
|
$has_ftp2=true;
|
||||||
|
|
||||||
// deal with ftp.westgis.ac.cn, use g6 to add path
|
// deal with ftp.westgis.ac.cn, use g6 to add path
|
||||||
// todo ...
|
// todo ...
|
||||||
}
|
}
|
||||||
//deal with ftp1 account
|
//deal with ftp1&ftp2 account, for offline data
|
||||||
if ($has_ftp1) {
|
if ($has_ftp1 || $has_ftp2) {
|
||||||
$user=(object)array("id"=>$row['userid'],
|
$password=md5('westdc'.$row['userid'].rand(1000,9999));
|
||||||
|
if ($has_ftp1)
|
||||||
|
{
|
||||||
|
$user=(object)array("id"=>$row['userid'],
|
||||||
"username"=>"westdc_".$row['userid'],
|
"username"=>"westdc_".$row['userid'],
|
||||||
"password"=>md5('westdc'.$row['userid'].rand(1000,9999)),
|
"password"=>$password,
|
||||||
"time"=>date('Y-m-d H:i:s', strtotime('+2 week')),
|
"time"=>date('Y-m-d H:i:s', strtotime('+2 week')),
|
||||||
//"path"=>$path,
|
//"path"=>$path,
|
||||||
"param"=>"offlineappid=".$finish,
|
"param"=>"offlineappid=".$finish,
|
||||||
|
@ -415,33 +422,70 @@ class Admin_DownController extends Zend_Controller_Action
|
||||||
"maxdata"=>$this->view->config->download->max,
|
"maxdata"=>$this->view->config->download->max,
|
||||||
"datacount"=>1 //represent one offline application
|
"datacount"=>1 //represent one offline application
|
||||||
);
|
);
|
||||||
$proftp=new Proftp();
|
$proftp=new Proftp();
|
||||||
$proftp->db=$this->db;
|
$proftp->db=$this->db;
|
||||||
if (!$proftp->createuser($user))
|
if (!$proftp->createuser($user))
|
||||||
{
|
{
|
||||||
$user->datacount=0; //force this offline to be true
|
$user->datacount=0; //force this offline to be true
|
||||||
$proftp->createuser($user);
|
$proftp->createuser($user);
|
||||||
$data = array(
|
$data = array(
|
||||||
'error' => "该用户申请的数据过多,请检查该用户之前已完成的申请",
|
'error' => "该用户申请的数据过多,请检查该用户之前已完成的申请",
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->jsonexit($data);
|
$this->jsonexit($data);
|
||||||
return true;
|
return true;
|
||||||
//$this->messenger->addMessage('提示信息:该用户申请的数据过多,请检查该用户之前已完成的申请。');
|
//$this->messenger->addMessage('提示信息:该用户申请的数据过多,请检查该用户之前已完成的申请。');
|
||||||
}
|
}
|
||||||
//发送用户邮件进行信息提示和说明
|
}
|
||||||
$mail = new WestdcMailer($this->view->config->smtp);
|
if ($has_ftp2)
|
||||||
//实例化EmailText
|
{
|
||||||
$mailtp=new EmailText($this->db,'offline-finish',
|
$user=(object)array("id"=>$row['userid'],
|
||||||
array('user'=>$row['username'],'datalist'=>str_replace(";","\n",$row['datalist']),
|
"username"=>"westdc_".$row['userid'],
|
||||||
'ftpuser'=>$user->username,'ftppwd'=>$proftp->pwd,'ftptime'=>$proftp->time));
|
"password"=>$password,
|
||||||
$mail->setBodyText($mailtp->getBody());
|
"time"=>date('Y-m-d H:i:s', strtotime('+2 week')),
|
||||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
//"path"=>$path,
|
||||||
$mail->addTo($row['email']);
|
"param"=>"offlineappid=".$finish,
|
||||||
$mail->addCc($this->view->config->service->email,'西部数据中心服务组');
|
"host"=>'ftp2.westgis.ac.cn',
|
||||||
$mail->setSubject($mailtp->getSubject());
|
"maxdata"=>$this->view->config->download->max,
|
||||||
$mail->send();
|
"datacount"=>1 //represent one offline application
|
||||||
} //ftp1 deal
|
);
|
||||||
|
$proftp=new Pureftp();
|
||||||
|
$proftp->db=$this->db;
|
||||||
|
if (!$proftp->createuser($user))
|
||||||
|
{
|
||||||
|
$user->datacount=0; //force this offline to be true
|
||||||
|
$proftp->createuser($user);
|
||||||
|
$data = array(
|
||||||
|
'error' => "该用户申请的数据过多,请检查该用户之前已完成的申请",
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->jsonexit($data);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($has_ftp1 && !$has_ftp2)
|
||||||
|
{
|
||||||
|
$ftphost='ftp://ftp1.westgis.ac.cn';
|
||||||
|
} else if (!$has_ftp1 && $has_ftp2)
|
||||||
|
{
|
||||||
|
$ftphost='ftp://ftp2.westgis.ac.cn';
|
||||||
|
} else if ($has_ftp1 && $has_ftp2)
|
||||||
|
{
|
||||||
|
$ftphost='ftp://ftp1.westgis.ac.cn 以及 ftp://ftp2.westgis.ac.cn';
|
||||||
|
}
|
||||||
|
//发送用户邮件进行信息提示和说明
|
||||||
|
$mail = new WestdcMailer($this->view->config->smtp);
|
||||||
|
//实例化EmailText
|
||||||
|
$mailtp=new EmailText($this->db,'offline-finish',
|
||||||
|
array('user'=>$row['username'],'datalist'=>str_replace(";","\n",$row['datalist']),
|
||||||
|
'ftpuser'=>$user->username,'ftppwd'=>$proftp->pwd,'ftptime'=>$proftp->time,'ftphost'=>$ftphost));
|
||||||
|
$mail->setBodyText($mailtp->getBody());
|
||||||
|
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||||
|
$mail->addTo($row['email']);
|
||||||
|
$mail->addCc($this->view->config->service->email,'西部数据中心服务组');
|
||||||
|
$mail->setSubject($mailtp->getSubject());
|
||||||
|
$mail->send();
|
||||||
|
} //offline deal
|
||||||
|
|
||||||
//$this->messenger->addMessage('提示信息:该离线数据已经处理完成。');
|
//$this->messenger->addMessage('提示信息:该离线数据已经处理完成。');
|
||||||
$data = array(
|
$data = array(
|
||||||
|
|
|
@ -1297,7 +1297,7 @@ class DataController extends Zend_Controller_Action
|
||||||
$testsql="select id,has_send_mail from onlineapp where userid='$userid' and uuid='$uuid' order by id desc";
|
$testsql="select id,has_send_mail from onlineapp where userid='$userid' and uuid='$uuid' order by id desc";
|
||||||
$result=$this->db->query($testsql);
|
$result=$this->db->query($testsql);
|
||||||
$rows = $result->fetch();
|
$rows = $result->fetch();
|
||||||
$has_send_mail=$rows['has_send_mail'];
|
$has_send_mail=$rows['has_send_mail'];
|
||||||
if (empty($rows['id']))
|
if (empty($rows['id']))
|
||||||
{
|
{
|
||||||
$this->_redirect('/data/'.$uuid);
|
$this->_redirect('/data/'.$uuid);
|
||||||
|
@ -1323,109 +1323,83 @@ class DataController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->username='westdc'.Zend_Auth::getInstance()->getIdentity()->id;
|
|
||||||
$sql=$this->db->quoteInto("select o.* from onlineresource o left join metadata m on o.uuid=m.uuid where m.datatype=0 and m.uuid=?",$uuid);
|
$sql=$this->db->quoteInto("select * from dataset o left join metadata m on o.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid where s.status>4 and m.datatype=0 and m.uuid=?",$uuid);
|
||||||
$rows=$this->db->fetchAll($sql);
|
$data=$this->db->fetchRow($sql);
|
||||||
$updateftp=$updateftp1=false;
|
$updateftp=$updateftp1=false;
|
||||||
$sql=$this->db->quoteInto("select * from metadata where uuid=?",$uuid);
|
$this->view->md=$data;
|
||||||
$this->view->md=$this->db->fetchRow($sql);
|
|
||||||
$bigfile=($this->view->md['filesize']>5);
|
|
||||||
$this->view->userpass=md5('westdc'.rand(1000,9999));
|
$this->view->userpass=md5('westdc'.rand(1000,9999));
|
||||||
$this->view->ftptime=date('Y-m-d H:i:s', strtotime('+1 week'));
|
$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'];
|
$datacount=$row['datacount'];
|
||||||
foreach ($rows as $row) {
|
if ($data['host']=='ftp.westgis.ac.cn')
|
||||||
$url=$row['linkage'];
|
{
|
||||||
$p=parse_url($url);
|
//添加FTP帐号信息以及时间控制信息
|
||||||
if ($p['scheme']=='ftp')
|
$updateftp=true;
|
||||||
//if ($row['protocol']=="WWW:DOWNLOAD-1.0-ftp--download")
|
$g6=new G6ftp();
|
||||||
{
|
$g6->db=$this->db;
|
||||||
//判断FTP URL是否附带了用户名和密码
|
//不进行判断,每个元数据中的下载地址都对应一个虚拟路径
|
||||||
if ($p['host']=='ftp.westgis.ac.cn')
|
$path[]=$data['path'];
|
||||||
$url='ftp://'.$this->view->config->ftp->user.':'.$this->view->config->ftp->password.'@ftp.westgis.ac.cn'.$p['path'];
|
$this->view->username='westdc'.$userid;
|
||||||
/*if (!$bigfile &&is_file($url) && file_exists($url))
|
$uu=(object)array("id"=>$userid,
|
||||||
{
|
"username"=>$this->view->username,
|
||||||
$this->_helper->layout->disableLayout();
|
"password"=>$this->view->userpass,
|
||||||
$this->_helper->viewRenderer->setNoRender();
|
"path"=>$path,
|
||||||
$content=file_get_contents($url);
|
"maxdata"=>$this->view->config->download->max,
|
||||||
$this->getResponse()->setHeader('Content-Type', 'application/octet-stream')
|
"time"=>$this->view->ftptime,
|
||||||
->setHeader('Content-Disposition','attachment; filename="'.basename($url).'"')
|
"datacount"=>$datacount);
|
||||||
->setHeader('Content-Length', strlen($content))
|
if ($g6->createuser($uu)) {
|
||||||
->setHeader('Content-Type','application/force-download')
|
$this->view->userpass=$g6->pwd;
|
||||||
->setHeader('Content-Type','application/download')
|
$this->view->ftptime=$g6->time;
|
||||||
->setHeader('Content-Description','File Transfer')
|
} else {
|
||||||
->setHeader('Content-Transfer-Encoding','binary')
|
$this->messenger->addMessage('错误:您正在进行下载的在线数据数已经超过系统允许的最大值,请在下面点击“完成”或“取消”对应的在线数据下载!');
|
||||||
->setHeader('Expires',0)
|
$this->_redirect('/data/order');
|
||||||
->setHeader('Cache-Control','must-revalidate, post-check=0, pre-check=0')
|
|
||||||
->setHeader('Pragma','public')
|
|
||||||
->setBody($content);
|
|
||||||
} else */{
|
|
||||||
//是一个FTP,返回用户名称和密码说明
|
|
||||||
if ($p['host']=='ftp.westgis.ac.cn')
|
|
||||||
{
|
|
||||||
//添加FTP帐号信息以及时间控制信息,只更新一次
|
|
||||||
$updateftp=true;
|
|
||||||
$g6=new G6ftp();
|
|
||||||
$g6->db=$this->db;
|
|
||||||
//不进行判断,每个元数据中的下载地址都对应一个虚拟路径
|
|
||||||
//if (is_file($url)) $path=dirname($p['path']); else $path[]=$p['path'];
|
|
||||||
$path[]=$p['path'];
|
|
||||||
$uu=(object)array("id"=>$userid,
|
|
||||||
"username"=>$this->view->username,
|
|
||||||
"password"=>$this->view->userpass,
|
|
||||||
"path"=>$path,
|
|
||||||
"maxdata"=>$this->view->config->download->max,
|
|
||||||
"time"=>$this->view->ftptime,
|
|
||||||
"datacount"=>$datacount);
|
|
||||||
if ($g6->createuser($uu)) {
|
|
||||||
$this->view->userpass=$g6->pwd;
|
|
||||||
$this->view->ftptime=$g6->time;
|
|
||||||
} else {
|
|
||||||
$this->messenger->addMessage('错误:您正在进行下载的在线数据数已经超过系统允许的最大值,请在下面点击“完成”或“取消”对应的在线数据下载!');
|
|
||||||
$this->_redirect('/data/order');
|
|
||||||
}
|
|
||||||
} elseif (!$updateftp1 && $p['host']=='ftp1.westgis.ac.cn')
|
|
||||||
{
|
|
||||||
//添加FTP1帐号信息以及时间控制信息,只更新一次
|
|
||||||
$updateftp1=true;
|
|
||||||
$proftp=new Proftp();
|
|
||||||
$proftp->db=$this->db;
|
|
||||||
//proftp离线用户名和g6的用户名稍有不同
|
|
||||||
$this->view->username='westdc_'.Zend_Auth::getInstance()->getIdentity()->id;
|
|
||||||
$uu=(object)array("id"=>$userid,
|
|
||||||
"username"=>$this->view->username,
|
|
||||||
"password"=>$this->view->userpass,
|
|
||||||
"host"=>'ftp1.westgis.ac.cn',
|
|
||||||
"param"=>"onlineappid=".$onlineappid,
|
|
||||||
"maxdata"=>$this->view->config->download->max,
|
|
||||||
"time"=>$this->view->ftptime,
|
|
||||||
"datacount"=>$datacount);
|
|
||||||
if ($proftp->createuser($uu))
|
|
||||||
{
|
|
||||||
$this->view->userpass=$proftp->pwd;
|
|
||||||
$this->view->ftptime=$proftp->time;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($p['host']=='ftp.westgis.ac.cn')
|
|
||||||
{
|
|
||||||
//更新URL
|
|
||||||
$ftpurls[]='ftp://'.$this->view->username.'@ftp.westgis.ac.cn'.$p['path'];
|
|
||||||
} elseif ($p['host']=='ftp1.westgis.ac.cn')
|
|
||||||
$ftpurls[]='ftp://ftp1.westgis.ac.cn'.$p['path'];
|
|
||||||
else
|
|
||||||
$ftpurls[]=$url;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//若不清楚协议,只是列出来?
|
|
||||||
$links[]=$row;
|
|
||||||
}
|
}
|
||||||
}
|
} elseif ($data['host']=='ftp1.westgis.ac.cn')
|
||||||
|
{
|
||||||
|
//添加FTP1帐号信息以及时间控制信息
|
||||||
|
$proftp=new Proftp();
|
||||||
|
$proftp->db=$this->db;
|
||||||
|
//proftp离线用户名和g6的用户名稍有不同
|
||||||
|
$this->view->username='westdc_'.$userid;
|
||||||
|
$uu=(object)array("id"=>$userid,
|
||||||
|
"username"=>$this->view->username,
|
||||||
|
"password"=>$this->view->userpass,
|
||||||
|
"host"=>'ftp1.westgis.ac.cn',
|
||||||
|
"param"=>"onlineappid=".$onlineappid,
|
||||||
|
"maxdata"=>$this->view->config->download->max,
|
||||||
|
"time"=>$this->view->ftptime,
|
||||||
|
"datacount"=>$datacount);
|
||||||
|
if ($proftp->createuser($uu))
|
||||||
|
{
|
||||||
|
$this->view->userpass=$proftp->pwd;
|
||||||
|
$this->view->ftptime=$proftp->time;
|
||||||
|
}
|
||||||
|
} elseif ($data['host']=='ftp2.westgis.ac.cn')
|
||||||
|
{
|
||||||
|
//添加FTP2帐号信息以及时间控制信息
|
||||||
|
$proftp=new Pureftp();
|
||||||
|
$proftp->db=$this->db;
|
||||||
|
$this->view->username='westdc_'.$userid;
|
||||||
|
$uu=(object)array("id"=>$userid,
|
||||||
|
"username"=>$this->view->username,
|
||||||
|
"password"=>$this->view->userpass,
|
||||||
|
"host"=>'ftp2.westgis.ac.cn',
|
||||||
|
"param"=>"onlineappid=".$onlineappid,
|
||||||
|
"maxdata"=>$this->view->config->download->max,
|
||||||
|
"time"=>$this->view->ftptime,
|
||||||
|
"datacount"=>$datacount);
|
||||||
|
if ($proftp->createuser($uu))
|
||||||
|
{
|
||||||
|
$this->view->userpass=$proftp->pwd;
|
||||||
|
$this->view->ftptime=$proftp->time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$ftpurl='ftp://'.$this->view->username.'@'.$data['host'].$data['path'];
|
||||||
|
|
||||||
//设置输出
|
//设置输出
|
||||||
//if ($updateftp || $updateftp1) $this->view->userpass=$password;
|
//if ($updateftp || $updateftp1) $this->view->userpass=$password;
|
||||||
@$this->view->ftpurls=$ftpurls;
|
$this->view->ftpurls=$ftpurl;
|
||||||
@$this->view->links=$links;
|
//更新下载记录
|
||||||
//更新下载记录
|
|
||||||
//todo: 尝试添加一个RULE:若有对应数据存在,则不插入( userid,uuid,status=0,ts_approved:null)
|
//todo: 尝试添加一个RULE:若有对应数据存在,则不插入( userid,uuid,status=0,ts_approved:null)
|
||||||
/*$sql="select * from dataorder where userid=? and uuid=? and status=0 and (ts_approved is null)";
|
/*$sql="select * from dataorder where userid=? and uuid=? and status=0 and (ts_approved is null)";
|
||||||
$u=$this->db->fetchRow($sql,array($userid,$uuid));
|
$u=$this->db->fetchRow($sql,array($userid,$uuid));
|
||||||
|
@ -1433,29 +1407,29 @@ class DataController extends Zend_Controller_Action
|
||||||
$sql="insert into dataorder (userid,uuid,ts_created) values(?,?,now())";
|
$sql="insert into dataorder (userid,uuid,ts_created) values(?,?,now())";
|
||||||
$this->db->query($sql,array($userid,$uuid));
|
$this->db->query($sql,array($userid,$uuid));
|
||||||
}*/
|
}*/
|
||||||
if (!empty($ftpurls) && ($updateftp || $updateftp1) && !$has_send_mail)
|
if (!empty($ftpurl) && !$has_send_mail)
|
||||||
{
|
{
|
||||||
$data = array(
|
$data = array(
|
||||||
"uuid"=>$uuid,
|
"uuid"=>$uuid,
|
||||||
"title"=>$this->view->md['title']."(".$this->view->md['filesize']."MB)",
|
"title"=>$this->view->md['title']."(".$this->view->md['filesize']."MB)",
|
||||||
"user"=>$user->username,
|
"user"=>$user->username,
|
||||||
"ftpuser"=>$this->view->username,
|
"ftpuser"=>$this->view->username,
|
||||||
"ftppwd"=>$this->view->userpass,
|
"ftppwd"=>$this->view->userpass,
|
||||||
"ftptime"=>$this->view->ftptime,
|
"ftptime"=>$this->view->ftptime,
|
||||||
"ftpurl"=>$this->view->ftpurls[0],
|
"ftpurl"=>$this->view->ftpurl,
|
||||||
"note"=>$updateftp?'BTW:请注意登陆后要手工进入对应的目录!':''
|
"note"=>$updateftp?'BTW:请注意登陆后要手工进入对应的目录!':''
|
||||||
);
|
);
|
||||||
$mailtp=new EmailText($this->db,'online-download',$data);
|
$mailtp=new EmailText($this->db,'online-download',$data);
|
||||||
$mail=new WestdcMailer($this->view->config->smtp);
|
$mail=new WestdcMailer($this->view->config->smtp);
|
||||||
$mail->setBodyText($mailtp->getBody());
|
$mail->setBodyText($mailtp->getBody());
|
||||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||||
$mail->addTo($user->email);
|
$mail->addTo($user->email);
|
||||||
$mail->setSubject($mailtp->getSubject());
|
$mail->setSubject($mailtp->getSubject());
|
||||||
@$mail->send();
|
@$mail->send();
|
||||||
$sql="update onlineapp set has_send_mail=true where id=?";
|
$sql="update onlineapp set has_send_mail=true where id=?";
|
||||||
$sth=$this->db->prepare($sql);
|
$sth=$this->db->prepare($sql);
|
||||||
$sth->execute(array($onlineappid));
|
$sth->execute(array($onlineappid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* 离线申请(可以包括在线数据),在无数据参数时,则显示已有列表
|
* 离线申请(可以包括在线数据),在无数据参数时,则显示已有列表
|
||||||
|
|
|
@ -3,11 +3,9 @@
|
||||||
$this->headTitle('我的账户');
|
$this->headTitle('我的账户');
|
||||||
$this->headTitle()->setSeparator(' - ');
|
$this->headTitle()->setSeparator(' - ');
|
||||||
$this->theme->AppendPlus($this,'jquery');
|
$this->theme->AppendPlus($this,'jquery');
|
||||||
$this->theme->AppendPlus($this,'bootstarp');
|
|
||||||
$this->theme->AppendPlus($this,'colorbox');
|
$this->theme->AppendPlus($this,'colorbox');
|
||||||
?>
|
?>
|
||||||
<div class="container-fluid">
|
<div class="row">
|
||||||
<div class="row-fluid">
|
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
<div class="well sidebar-nav">
|
<div class="well sidebar-nav">
|
||||||
<?= $this->partial('account/left.phtml'); ?>
|
<?= $this->partial('account/left.phtml'); ?>
|
||||||
|
@ -50,13 +48,13 @@
|
||||||
<div class="control-group ">
|
<div class="control-group ">
|
||||||
<label class="control-label">工作单位</label>
|
<label class="control-label">工作单位</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" name="unit" value="<?php echo empty($this->info['unit']) ? "":$this->info['unit']; ?>" class="span8" />
|
<input type="text" name="unit" value="<?php echo empty($this->info['unit']) ? "":$this->info['unit']; ?>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group ">
|
<div class="control-group ">
|
||||||
<label class="control-label">联系地址</label>
|
<label class="control-label">联系地址</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" name="address" value="<?php echo empty($this->info['address']) ? "":$this->info['address']; ?>" class="span8" />
|
<input type="text" name="address" value="<?php echo empty($this->info['address']) ? "":$this->info['address']; ?>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group ">
|
<div class="control-group ">
|
||||||
|
@ -110,13 +108,13 @@
|
||||||
<div class="control-group ">
|
<div class="control-group ">
|
||||||
<label class="control-label">项目名称</label>
|
<label class="control-label">项目名称</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" name="project_title" value="<?php echo empty($this->info['project_title']) ? "":$this->info['project_title']; ?>" class="span8" />
|
<input type="text" name="project_title" value="<?php echo empty($this->info['project_title']) ? "":$this->info['project_title']; ?>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group ">
|
<div class="control-group ">
|
||||||
<label class="control-label">项目简介</label>
|
<label class="control-label">数据用途</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<textarea name="project" class="span8"><?php echo empty($this->info['project']) ? "":$this->info['project']; ?></textarea>
|
<textarea name="project"><?php echo empty($this->info['project']) ? "":$this->info['project']; ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group ">
|
<div class="control-group ">
|
||||||
|
@ -145,5 +143,4 @@
|
||||||
</form>
|
</form>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</div><!--/span-->
|
</div><!--/span-->
|
||||||
</div><!--/row-->
|
</div><!--/row-->
|
||||||
</div>
|
|
|
@ -17,6 +17,8 @@ class Pureftp
|
||||||
{
|
{
|
||||||
$this->insert_user($user);
|
$this->insert_user($user);
|
||||||
// add system link directory
|
// add system link directory
|
||||||
|
// use for same web server & ftp server
|
||||||
|
/*
|
||||||
if (is_array($user->path))
|
if (is_array($user->path))
|
||||||
{
|
{
|
||||||
foreach ($user->path as $path)
|
foreach ($user->path as $path)
|
||||||
|
@ -25,6 +27,14 @@ class Pureftp
|
||||||
//online path, only one path
|
//online path, only one path
|
||||||
symlink($this->data_path.$user->path,'/home/ftp/'.$user->username.'/'.str_replace('/','-',substr($user->path,1)));
|
symlink($this->data_path.$user->path,'/home/ftp/'.$user->username.'/'.str_replace('/','-',substr($user->path,1)));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
//处理FTP用户目录
|
||||||
|
if (!empty($user->host))
|
||||||
|
{
|
||||||
|
//vist $user->host web
|
||||||
|
$page=file_get_contents('http://'.$user->host.'/proftp.php?'.$user->param);
|
||||||
|
if (!empty($page)) die($page);//there are errors in visit ftp page
|
||||||
|
}
|
||||||
return $this->update_pwd($user);
|
return $this->update_pwd($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue