diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index cd31e0a6..93780c91 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -2701,6 +2701,7 @@ class Admin_DataController extends Zend_Controller_Action $uuid = $this->_getParam('uuid'); $this->view->uuid = $uuid; + $submd=$this->view->config->sub->metadata; if(empty($uuid) || !preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid)) { @@ -2710,10 +2711,10 @@ class Admin_DataController extends Zend_Controller_Action $this->jsonexit($data); return true; } - //安全检查: uuid必须是当前用户且为新建数据 - $sql="select * from geonetworkmetadata where uuid=? and uuid not in (select uuid from metadata) and owner=?"; + //安全检查: uuid必须是当前子平台数据 + $sql="select * from $submd where uuid=?"; $sth=$this->db->prepare($sql); - $sth->execute(array($uuid,$u_id)); + $sth->execute(array($uuid)); $row=$sth->fetch(); if (empty($row)) { @@ -2724,8 +2725,10 @@ class Admin_DataController extends Zend_Controller_Action return true; } - //ftp 用户名 - $uname = 'sjy'.$u_id.'upload'; + //ftp admin 用户名 + $auth = Zend_Auth::getInstance(); + $uid=$auth->->getIdentity()->id; + $uname = $submd.'admin'.$uid; //ftp路径 $homedir = "/data/upload/".$uuid."/";