public function reset_new() { $linkData = $this->linkData($_POST['link']); if ($linkData['error'] > 0) { \ipinga\cookie::add('message_for_next_screen', $linkData['message']); header('location: /login'); } else { $v = new \ipinga\validator($_POST, true); $v->checkPassword('passwd1', 'Password', 4, 20, true, false); $v->checkMatch('passwd1', 'passwd2', 'Passwords'); if (empty($v->message) == false) { $this->template->message = 'Please fix input errors.'; $this->template->user = $linkData['user']; $this->template->link = $_POST['link']; $this->template->show('password.reset.form'); } else { /** @var \ipinga\userTable $u */ $u = $linkData['user']; $u->passwd = $_POST['passwd1']; $u->save(); \ipinga\cookie::add('message_for_next_screen', 'Your password has been changed. You may now login.'); header('location: /login'); } } }
private function shutdown() { \ipinga\cookie::add('loggedInDetails', $this->loggedInDetails); }