OEModule\OphCoCvi\controllers\DefaultController::actionSignCVI PHP Method

actionSignCVI() public method

public actionSignCVI ( $id )
$id
    public function actionSignCVI($id)
    {
        $pin = $this->getApp()->getRequest()->getParam('signature_pin', null);
        if ($pin !== null) {
            $user = \User::model()->findByPk($this->getApp()->user->id);
            if ($this->getManager()->signCvi($this->event, $user, $pin)) {
                $this->getApp()->user->setFlash('success.cvi_consultant_signature', 'CVI signed.');
                $this->updateEventInfo();
            } else {
                $this->getApp()->user->setFlash('error.cvi_consultant_signature', 'Unable to sign the CVI');
            }
        } else {
            throw new \CHttpException(403, "Invalid Request");
        }
        $this->redirect(array('/' . $this->event->eventType->class_name . '/default/view/' . $id));
    }