From 83424373503e8fcdbe8e147b0a20f254084749a4 Mon Sep 17 00:00:00 2001 From: wlx Date: Wed, 16 Jul 2014 08:24:16 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=89=E5=85=A8=E8=AE=A4?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controllers/DataController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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."/";