/** * POST: /manage/delete */ public function deletePost() { $model = new ManageDeleteModel(Language::$DELETE_ACCOUNT[Config::$LANGUAGE], true); if ($model->validation) { $userDAO = new UserDAO(); $errorMessage = $userDAO->passwordVerify($model->authenticatedUserEntity->id, $model->password, $model->authenticatedUserEntity->passwordHash, $model->authenticatedUserEntity->lockoutEnabled, $model->authenticatedUserEntity->lockoutEndDate, $model->authenticatedUserEntity->accessFailedCount); if ($errorMessage == '') { $userDAO->delete($model->authenticatedUserEntity->id); Authentication::signOut(); parent::redirectToUrlFromAction('main', 'index'); } $model->passwordValidation = Language::$INVALID_PASSWORD[Config::$LANGUAGE] . " {$errorMessage}"; $model->validation = false; } parent::view(new Delete(), $model); }
/** * POST: /account/login */ public function loginPost() { $model = new AccountLoginModel(Language::$LOG_IN[Config::$LANGUAGE], true); if ($model->validation) { $userDAO = new UserDAO(); $userEntity = $userDAO->getUserWithRolesByEmail($model->email); $errorMessage = $userDAO->passwordVerify($userEntity->id, $model->password, $userEntity->passwordHash, $userEntity->lockoutEnabled, $userEntity->lockoutEndDate, $userEntity->accessFailedCount); if ($errorMessage == '') { Authentication::signIn($userEntity->uniqueId); (new BrowsingDAO())->addedBrowsingToUser($userEntity->id, Browsing::getBrowsingId()); parent::redirectToUrlFromArray(explode('/', $model->url)); } $model->emailValidation = Language::$INVALID_EMAIL_OR_PASSWORD[Config::$LANGUAGE] . ' ' . $errorMessage; $model->validation = false; } parent::view(new Login(), $model); }