add inviteok action in review controller

This commit is contained in:
wlx 2013-05-03 01:43:49 +00:00
parent 75e47abb23
commit 34f836b551
2 changed files with 58 additions and 1 deletions

View File

@ -760,6 +760,50 @@ class ReviewController extends Zend_Controller_Action
} }
}// denyinviteAction() 专家拒绝邀请 }// denyinviteAction() 专家拒绝邀请
//parameters are same as denyinviteAction
function inviteokAction()
{
$id = $this->_request->getParam('id');
$uuid = $this->_request->getParam('uuid');
if(empty($id) || empty($uuid) || !is_numeric($id) ||!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))
{
$this->view->message = "参数错误";
}else{
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$userid = $user->id;
if($id==$userid)
{
try{
$sql = "update mdexpertreview set status=1 where id='$id' and uuid='$uuid'";
if($this->db->exec($sql))
$this->view->message = "感谢您同意对该数据的评审邀请,如遇到任何问题,请联系数据中心服务人员。";
else
$this->view->message = "您无权限进行此操作";
}catch(Exception $e){
$this->view->message = $e->getMessage();
}
}//end if
else
{
$this->view->message = "您无权使用此通知";
}//非本人操作,或尝试删除他人信息
}//end if
else
{
$this->view->message = '请登录后再执行此操作,请<a href="/account/login/?href=/review/inviteok/id/'.$id.'/uuid/'.$uuid.'">点击此处登录</a>';
}//未登录
}
}// denyinviteAction() 专家拒绝邀请
} }

View File

@ -0,0 +1,13 @@
<?php
$config = Zend_Registry::get('config');
$this->headTitle($config->title->site);
$this->headTitle($config->title->review);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > ');
?>
<div>
<?php echo $this->message;?>
</div>