예제 #1
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     //--Get the id
     $id = $this->URL->getParameter(1);
     //--check if the id is not empty
     if (empty($id)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Explode the id
     $ids = explode("-", $id);
     //--check if the id contains 2 elements
     if (count($ids) != 2) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Get the ids and decrypt
     $link_id = (int) FrontendMailengineModel::decryptId($ids[0]);
     $user_id = (int) FrontendMailengineModel::decryptId($ids[1]);
     //--check if the ids are integers
     if ($link_id <= 0) {
         //--Redirect to 404
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Only if userid > 0 (because of the preview on the frontend)
     if ($user_id > 0) {
         $data = array();
         $data["link_id"] = $link_id;
         $data["user_id"] = $user_id;
         //--Add click-link to the database
         FrontendMailengineModel::insertLinkClicked($data);
     }
     //--Redirect the page
     $this->redirectLink($link_id);
     //--Stop the script
     die;
 }