/** * @param $code string * @return bool */ public function confirmParticipationByCode($code) { $participation = Participation::getByConfirmationCode($code, 1); if (is_object($participation)) { $participation->SetIpConfirmed($_SERVER['REMOTE_ADDR']); $participation->setConfirmed(true); $participation->save(); $note = new Note(); $note->setElement($participation); $note->setDate(time()); $note->setType("confirmation"); $note->setTitle("Code confirmed"); $note->addData("code", "text", $code); $note->setUser(0); $note->save(); return true; } return false; }