@param \stdClass $login

@return int

@throws \Exception
510000
public function signUp($login)
	{
		$stmntSingup = $this->db->prepare("
			INSERT INTO login SET
				username = ?,
				email = ?,
				password = ?,
				registeredby = ?,
				salt = ?,
				confirmed = NULL,
				active = ?,
				lastlogin = NULL,
				wronglogins = 0,
				token = ?,
				tokentime = ?
		");

		$salt = $this->generateSalt();

		try {
			$this->db->beginTransaction();

			$userID = $this->db->insert($stmntSingup, array(
				isset($login->username)?$login->username:null,
				$login->email,
				isset($login->password)?$this->encryptPassword($login->password, $salt):null,
				isset($login->registeredBy)?$login->registeredBy:null,
				$salt,
				isset($login->active)?$login->active:0,
				isset($login->token)?$login->token:null,
				isset($login->token)?date('Y-m-d H:i:s'):null
			));

			if(!isset($login->rightGroups) || !is_array($login->rightGroups)) {
				$this->db->commit();
				return $userID;
			}

			$stmntRghtGrps = $this->db->prepare("
				INSERT INTO login_has_rightgroup SET
					 loginIDFK = ?
					,rightgroupIDFK = ?
					,datefrom = NOW() 
			");

			foreach($login->rightGroups as $rg) {
				$this->db->insert($stmntRghtGrps, array($userID, $rg));
			}

			$this->db->commit();

			return $userID;
		} catch(\Exception $e) {
			$this->db->rollBack();

			throw $e;
		}
	}
449542
public static function getPhone($login)
	{
		$login = self::pregMatchLogin($login);
		$login = self::splitLogin($login);
		return $login['country_code']. $login['phone'];
	}
449907
public function removeByLoginField($login)
    {
        $user = $this->getByLoginField($login);

        if ($user !== null) {
            return $this->removeUserById($user->getUserid());
        }

        return false;
    }
528583
protected function getNewRecord($login)
    {
        $record = new Record();
        $record->setPlayer($this->playerDb->get($login));
        $record->setNbLaps($this->currentNbLaps);
        $record->setNbFinish(0);
        $record->setMapUid($this->currentMapUid);

        return $record;
    }
1174802
public function deleteAdmin($login)
	{
		$login = urlencode($login);
		if (strlen($login) < 1) {
			throw new InvalidArgumentException("Login can't be empty");
		}

		try {
			$client = new CouchClient($this->client->dsn(), $this->usersdb);
			$doc = $client->getDoc("org.couchdb.user:" . $login);
			$client->deleteDoc($doc);
		} catch (Exception $e) {
			
		}

		$url = '/_node/' . urlencode($this->node) . '/_config/admins/' . urlencode($login);
		$raw = $this->client->query(
				"DELETE", $url
		);
		$resp = Couch::parseRawResponse($raw);
		if ($resp['status_code'] != 200) {
			throw new CouchException($raw);
		}
		return $resp["body"];
	}
827178
public function handle(Login $event)
    {
        $user = $event->user;
        $ip = $this->request->ip();
        $userAgent = $this->request->userAgent();
        $known = $user->authentications()->whereIpAddress($ip)->whereUserAgent($userAgent)->first();

        $authenticationLog = new AuthenticationLog([
            'ip_address' => $ip,
            'user_agent' => $userAgent,
            'login_at' => Carbon::now(),
        ]);

        $user->authentications()->save($authenticationLog);

        if (! $known && config('authentication-log.notify')) {
            $user->notify(new NewDevice($authenticationLog));
        }
    }
274982
public function getUserCompanies($login)
    {
        $this->checkAliasName($login);

        return $this->adapter->get(sprintf('/users/%s/companies', $login));
    }
602238
public function removeLogin($login)
    {
        if (isset($this->logins[$login])) {
            unset($this->logins[$login]);

            $this->dispatcher->dispatch(self::EVENT_REMOVE_USER, [$this, $login]);
        }

        if (!$this->isPersistent() && empty($this->logins)) {
            $this->dispatcher->dispatch(self::EVENT_DESTROY, [$this, $login]);
        }
    }
776167
public function login(string $login, string $password)
    {
        $user = $this->auth_repository->login($login, $password);

        if (null === $user) {
            return null;
        }

        if ($this->container->has('user')) {
            unset($this->container['user']);
        }
        $this->container['user'] = $user;

        return $this->auth_storage->setUser($user);
    }
352068
public function getPlayerInfo($login, $forceNew = false)
    {
        if (!isset($this->online[$login]) || $forceNew) {
            // to make sure even if an exception happens, player has login and basic nickname
            $playerInformation = new PlayerInfo();
            $playerInformation->login = $login;
            $playerDetails = new PlayerDetailedInfo();
            $playerDetails->nickName = $login;

            try {
                //fetch additional informations
                $playerInformation = $this->factory->getConnection()->getPlayerInfo($login);
                $playerDetails = $this->factory->getConnection()->getDetailedPlayerInfo($login);
            } catch (InvalidArgumentException $e) {
                $this->logger->error("Login unknown: $login", ["exception" => $e]);
                $this->console->writeln('$f00Login Unknown: '.$login.' dedicated server said: $fff'.$e->getMessage());
            } catch (FaultException $ex) {
                $this->logger->error("Login unknown: $login", ["exception" => $ex]);
                $this->console->writeln('$f00Login Unknown: '.$login.' dedicated server said: $fff'.$ex->getMessage());
            }
            return $this->playerFactory->createPlayer($playerInformation, $playerDetails);
        }

        return $this->online[$login];
    }
89787
static function maxNumberOfFailedLogin()
    {
        $ini = eZINI::instance();

        $maxNumberOfFailedLogin = $ini->hasVariable( 'UserSettings', 'MaxNumberOfFailedLogin' ) ? $ini->variable( 'UserSettings', 'MaxNumberOfFailedLogin' ) : '0';
        return $maxNumberOfFailedLogin;
    }
451714
public function handle(Login $event)
    {
        $user = $event->user;
        if (method_exists($user, 'updateLoginTimestamp')) {
            $user->updateLoginTimestamp();
        }
    }
910022
protected function execute(InputInterface $input, OutputInterface $output): ?int
    {
        $username = $this->getUsername($input, $output);
        $user = $this->findUser($output, $username);
        if (null === $user) {
            return 1;
        }

        $password = $this->getPassword($input, $output);
        if ($password) {
            $this->userManager->setPlainTextPassword($user, $password);
        } else {
            $this->userManager->requestNewPassword($user);
        }
        $this->userManager->save($user);

        if ($password) {
            $message = $this->translator->trans(
                'user.password_changed_success',
                ['%username%' => $username],
                'security'
            );
        } else {
            $message = $this->translator->trans(
                'user.password_request_sent',
                ['%username%' => $username],
                'security'
            );
        }
        $output->writeln("<info>{$message}</info>");

        return 0;
    }
1208904
private function getPasswordToResetTo($login)
    {
        $optionName = self::getPasswordResetInfoOptionName($login);
        $optionValue = Option::get($optionName);
        $optionValue = json_decode($optionValue, $isAssoc = true);
        return $optionValue;
    }
787395
function doCount(PDO $conn = null) {
		$q = clone $this;

		if (!$q->getTable()) {
			throw new RuntimeException('No table specified.');
		}

		$q->setAction(self::ACTION_COUNT);
		return (int) $q->getQuery($conn)->bindAndExecute()->fetchColumn();
	}
1329295
public function onPlayerAlliesChanged($login)
    {
        $playerData = $this->playerStorage->getPlayerInfo($login);
        $newPlayerData = $this->playerStorage->getPlayerInfo($login, true);

        $this->playerStorage->onPlayerAlliesChanged($playerData, $newPlayerData);
        $this->dispatch(__FUNCTION__, [$playerData, $newPlayerData]);
    }
635188
public function getRequestCount(AuthenticationRecordInterface $authenticationRecord): int
    {
        $fiveMinutesAgo = new \DateTime('now', new \DateTimeZone('UTC'));
        $fiveMinutesAgo->modify('-5 minutes');

        $query = $this->getRepository()->createQueryBuilder('r')
            ->select('COUNT(r.id) AS total')
            ->where('r.authentication = :authentication')
            ->andWhere('r.request_time > :since')
            ->setParameter('authentication', $authenticationRecord)
            ->setParameter('since', $fiveMinutesAgo)
            ->getQuery();

        return $query->getSingleScalarResult();
    }