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