Example #1
0
 public function confirm()
 {
     $ReturnResult = new ReturnResultVO();
     $id = DataHandler::getValueByArrayIndex($this->arrayVariable, "id");
     $UserDetail = new UserDetailVO();
     $ResultUser = $UserDetail->setId($id, TRUE);
     if ($ResultUser->success) {
         if ($UserDetail->getEmail() == DataHandler::getValueByArrayIndex($this->arrayVariable, "mail")) {
             $token = DataHandler::getValueByArrayIndex($this->arrayVariable, "token");
             if ($token == $this->getTokenFromUser($id, $UserDetail->getEmail())) {
                 $UserDetail->setActive(1);
                 $ReturnResult = $UserDetail->commit();
             } else {
                 $ReturnResult->addMessage("token incorreto");
             }
         } else {
             $ReturnResult->addMessage("email não confere com usuario");
         }
     } else {
         $ReturnResult->addMessage("usuario não encontrado");
     }
     $returnResult = new HttpResult();
     $retornoDaPaginaHTML = new HttpAdminGenericResult();
     $retornoDaPaginaHTML->result = $ReturnResult;
     $returnResult->setHttpContentResult($retornoDaPaginaHTML);
     return $returnResult;
 }