add more error control when submit new metadata

This commit is contained in:
wlx 2012-10-31 00:56:39 +00:00
parent be8b6ef2b5
commit a2745777c2
1 changed files with 9 additions and 4 deletions

View File

@ -442,8 +442,8 @@ class HeiheController extends DataController
$this->_helper->viewRenderer->setNoRender();
$data = "";
try{
$id = $this->_request->getParam('id');
try{
if(empty($id) || !is_numeric($id))
{
$data = array("error"=>"参数错误");
@ -609,6 +609,11 @@ class HeiheController extends DataController
$this->jsonexit($data);
return true;
}catch(Exception $e) {
$sql="delete from mdstatus where uuid in (select uuid from geonetworkmetadata where id=?)";
$this->db->query($sql,array($id));
$sql="delete from mdauthor where userid=? and uuid in (select uuid from geonetworkmetadata where id=?)";
$this->db->query($sql,array($u_id,$id));
$msg = "提交失败,请确认权限后重试";
if($this->debug>0)
{$msg .= $e->getMessage();}