public function sendRecoverInstructions() { $session = new SessionHelper(); $mail = new MailHelper(); $formval = new FormHelper(); $usermodel = new UserModel(); // Form validation // Email $email = $formval->testInput($_POST['email']); // Set the recoverid in the DB if ($usermodel->setRecoverLink($email)) { // Send the link to the user // recoverid is now in $_SESSION['recoverid'] $mail->sendRecoverMail($email); $session->setMessage('We have just send the link', 4); redirectTo(BASE_URL . 'index.php?c=user&a=viewrecoverpassword'); } else { $session->setMessage('E-mail address is unknown to us.', 3); redirectTo(BASE_URL . 'index.php?c=user&a=viewrecoverpassword'); } }