/** * POST /orders[/:id] * POST /comandes[/:id] * @return Html */ public function httpPostForHtml() { $id = $this->getRequest()->getParameter('id'); $operation = $this->getRequest()->getParameter('operation'); $response = NULL; switch ($operation) { case 'authenticate': $response = $this->getAuthenticationResponse($id); break; case 'resend': try { $order = $this->getEntity($id); // Resend the confirmation. $order->sendConfirmationRequestMessage(); } catch (NotFoundException $exception) { // If the order was not found, just go ahead and pretend it // does, to avoid enumeration. } $response = new Redirection($this->getRequest()); $response->setNextUrl("/comandes/{$id}"); $response->addNotice(_('The confirmation e-mail has been resent.')); break; default: throw new BadRequestException('Operation not recognised.'); } return $response; }