public function password() { $this->setTitle('Change your password - Savely.co'); $f = new Form('password'); if ($f->isValid()) { $v = $f->getValues(); if (ModelAuthentication::getInstance()->changePassword($v['currentPassword'], $v['newPassword'])) { AuthenticationHandler::unsetUserSession(); AuthenticationHandler::setUserSession(ModelAuthentication::getInstance()->getLogin(), $v['newPassword']); $this->addContent('confirmation', 'New Password Saved'); } else { $this->addContent('error', 'You current password does not match'); } } else { $this->addContent('error', $f->getError()); } $this->addForm('password', $f); }
public function signout() { AuthenticationHandler::unsetUserSession(); Go::to(); }