在删除评审附件时增加了用户判断,防止附件被其他用户误删
This commit is contained in:
parent
e0b5d8a252
commit
46260303a6
|
@ -70,7 +70,7 @@ class UploadController extends Zend_Controller_Action {
|
||||||
$row= $re->fetch();
|
$row= $re->fetch();
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
function delreviewattAction(){
|
function delreviewattAction(){
|
||||||
$this->_helper->layout()->disableLayout();
|
$this->_helper->layout()->disableLayout();
|
||||||
$this->_helper->viewRenderer->setNoRender();
|
$this->_helper->viewRenderer->setNoRender();
|
||||||
|
@ -79,7 +79,6 @@ class UploadController extends Zend_Controller_Action {
|
||||||
$basepath = $this->view->config->upload;
|
$basepath = $this->view->config->upload;
|
||||||
$info = $this->getFileinfo($id);
|
$info = $this->getFileinfo($id);
|
||||||
$filepath = $basepath.$info['filename'];
|
$filepath = $basepath.$info['filename'];
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$auth = Zend_Auth::getInstance();
|
$auth = Zend_Auth::getInstance();
|
||||||
if($auth->hasIdentity())
|
if($auth->hasIdentity())
|
||||||
|
@ -87,11 +86,12 @@ class UploadController extends Zend_Controller_Action {
|
||||||
$user = $auth->getIdentity();
|
$user = $auth->getIdentity();
|
||||||
$userid = $user->id;
|
$userid = $user->id;
|
||||||
$sql = "delete from attachments where id='$id' and userid='$userid'";
|
$sql = "delete from attachments where id='$id' and userid='$userid'";
|
||||||
if($this->db->exec($sql))
|
if($this->db->exec($sql)>0)
|
||||||
{
|
{
|
||||||
@unlink($filepath);
|
@unlink($filepath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception $e){}
|
}catch(Exception $e){}
|
||||||
//不输出任何错误
|
//不输出任何错误
|
||||||
}//删除评审附件
|
}//删除评审附件
|
||||||
|
|
Loading…
Reference in New Issue