/** * @param array $data * @param UserInterface $user * @return bool */ public function changeInGamePwd(array $data, UserInterface $user) { $user = $this->userService->getUser4Id($user->getId()); if (!$this->isPwdChangeAllowed($data, $user, 'InGame')) { return false; } // check if we have to change it at web too if ($this->isSamePasswordOption()) { $user = $this->userService->setNewPasswordAtUser($user, $data['password']); } $this->gameBackendService->setUser($user, $data['password']); return $user; }
/** * @param $userId * @return bool */ public function userExists($userId) { $user = $this->userService->getUser4Id($userId); return (bool) $user; }