/** * * @param Command $command */ private function savePassword(Command $command) { $hash = $command->entity()->getPassword(); if (!HashPass::verifyPassword($this->http->request->get('userPassword'), $hash)) { Server::setReferData(['error' => ['validPassword' => 1]]); Server::headerLocationReferer(); } else { $command->setPassword($this->http->request->get('userNewPassword'))->update(['password' => []]); } }
/** * * @param Command $command */ private function updatePassword(Command $command) { $command->setPassword($this->randomPassword)->update(['password' => []]); }