@param string            $password
@param DatabaseInterface $database
@param string            $userCondition
@param string            $shopCondition

@deprecated since v6.4.0 (2019-03-15); This method will be removed completely.

@return string
5314
protected function formQueryPartForSha512Password(string $password, DatabaseInterface $database, string $userCondition, string $shopCondition): string
    {
        $salt = $database->getOne("SELECT `oxpasssalt` FROM `oxuser` WHERE  1 AND $userCondition $shopCondition");
        if (false !== $salt) {
            $passwordSelect = ' oxuser.oxpassword = ' . $database->quote($this->encodePassword($password, $salt));
        } else {
            $passwordSelect = ' 1 ';
        }

        return $passwordSelect;
    }
598439
public static function create($password): string
    {
        if (!$password) {
            throw new \RuntimeException('Password hashing failed: no password provided.');
        }

        $hash = password_hash($password, PASSWORD_DEFAULT);

        if (!$hash) {
            throw new \RuntimeException('Password hashing failed: internal error.');
        }

        return $hash;
    }
1049868
public function withUserInfo($user, $password = null): UriInterface
    {
        if (! is_string($user)) {
            throw new InvalidArgumentException('Uri user must be a string');
        }

        $clone = clone $this;
        $clone->user = $this->filterUserInfo($user);

        if ($clone->user) {
            $clone->password = $password ? $this->filterUserInfo($password) : '';
        } else {
            $clone->password = '';
        }

        return $clone;
    }
567737
public function connect($host, $user, $password, $database, $newLink = false)
    {
        if (!$this->pdo) {
            try {
                $this->pdo = $this->getAdapter()->connect($host, $user, $password, $database, $newLink);
                $this->setDatabase($database);
            } catch (Exception $e) {
                $e->log();
            }
        }

        return $this;
    }
185885
public static function match($password, array $userInputs = [])
    {
        $matches = [];
        $passwordLength = strlen($password);

        $sequences = self::LOWER.self::UPPER.self::DIGITS;
        $revSequences = strrev($sequences);

        for ($i = 0; $i < $passwordLength; ++$i) {
            $pattern = false;
            $j = $i + 2;
            // Check for sequence sizes of 3 or more.
            if ($j < $passwordLength) {
                $pattern = substr($password, $i, 3);
            }
            // Find beginning of pattern and then extract full sequences intersection.
            if ($pattern && false !== ($pos = strpos($sequences, $pattern))) {
                // Match only remaining password characters.
                $remainder = substr($password, $j + 1);
                $pattern .= static::intersect($sequences, $remainder, $pos + 3);
                $params = [
                    'ascending' => true,
                    'sequenceName' => static::getSequenceName($pos),
                    'sequenceSpace' => static::getSequenceSpace($pos),
                ];
                $matches[] = new static($password, $i, $i + strlen($pattern) - 1, $pattern, $params);
                // Skip intersecting characters on next loop.
                $i += strlen($pattern) - 1;
            }
            // Search the reverse sequence for pattern.
            elseif ($pattern && false !== ($pos = strpos($revSequences, $pattern))) {
                $remainder = substr($password, $j + 1);
                $pattern .= static::intersect($revSequences, $remainder, $pos + 3);
                $params = [
                    'ascending' => false,
                    'sequenceName' => static::getSequenceName($pos),
                    'sequenceSpace' => static::getSequenceSpace($pos),
                ];
                $matches[] = new static($password, $i, $i + strlen($pattern) - 1, $pattern, $params);
                $i += strlen($pattern) - 1;
            }
        }

        return $matches;
    }
116293
public function verifyPassword(UserInterface $user, $password)
    {
        if (!$password) {
            return false;
        }

        $hashedPassword = $user->getHashedPassword();
        if (!$hashedPassword) {
            return false;
        }

        return password_verify($password, $hashedPassword);
    }
1372128
public function newConnection($host, $database, $user, $password)
    {
        return self::$driver->connect($host, $database, $user, $password);
    }
579161
public function sendCreationEmailMessage(UserInterface $user, $password)
    {
        /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
        $siteName  = $this->settingsManager->getParameter('general.site_name');
        $userName = sprintf('%s %s', $user->getFirstName(), $user->getLastName());
        $login = $user->getUsername();

        if (0 === strlen($password)) {
            return 0;
        }

        if (null === $loginUrl = $this->getLoginUrl($user)) {
            return 0;
        }

        $rendered = $this->templating->render(
            'EkynaUserBundle:Admin/User:creation_email.html.twig',
            [
                'username'  => $userName,
                'sitename'  => $siteName,
                'login_url' => $loginUrl,
                'login'     => $login,
                'password'  => $password,
            ]
        );

        $subject = $this->translator->trans(
            'ekyna_user.email.creation.subject',
            ['%sitename%' => $siteName]
        );

        return $this->sendEmail($rendered, $user->getEmail(), $userName, $subject);
    }
631408
static function tryLogin(\Db\Connection $db, $email, $password) {
    if ($email === null) {
      throw new UserAuthenticationException("Email required for password login.");
    }

    // find the user with the email
    $q = $db->prepare("SELECT users.* FROM users
        JOIN user_passwords ON users.id=user_passwords.user_id
        WHERE email=? AND user_passwords.password_hash=? LIMIT 1");
    $q->execute(array($email, UserPassword::hash($password)));
    if ($user = $q->fetch()) {
      $result = new User($user);
      $result->setIdentity("(password)");
      return $result;
    } else {
      throw new UserAuthenticationMissingAccountException("No such email/password found.");
    }
  }
636238
private function _prepareCondition(ConditionInterface $condition = null)
	{
		$this->condition = $this->expressionBuilderFactory->create($condition)->build();
	}
1036740
public function sendGeneratedPassword(User $user, $password)
    {
        return $this->sendMessage(
            $user->email,
            $this->getNewPasswordSubject(),
            'new_password',
            ['user' => $user, 'password' => $password, 'module' => $this->module]
        );
    }
1002947
public function authenticate($username, $password) {
        if (!$this->hasPDO()) {
            return NULL;
        }

        $sql = $this->sql();

        /* @var $pdo \PDO */
        $pdo = $this->options["pdo"];
        $statement = $pdo->prepare($sql);
        $statement->execute(array($username));

        $success = false;
        $user = $statement->fetch(\PDO::FETCH_ASSOC);

        if ($user) {
            $success = password_verify($password, $user[$this->options["hash"]]);
        }

        if (!$success) {
            $this->error = new \SlimPower\Authentication\Error();
            return null;
        } else {
            $data = array();

            foreach ($this->options["show"] as $fieldname) {
                if (array_key_exists($fieldname, $user)) {
                    $data[$fieldname] = $user[$fieldname];
                }
            }

            return $data;
        }
    }
700719
protected function _operator($operator, $conditions, &$states)
    {
        if (isset($this->_operators[$operator])) {
            $config = $this->_operators[$operator];
        } elseif (substr($operator, -2) === '()') {
            $op = substr($operator, 0, -2);
            if (isset($this->_operators[$op])) {
                return '(' . $this->_operator($op, $conditions, $states) . ')';
            }
            $config = ['builder' => 'function'];
        } else {
            throw new SqlException("Unexisting operator `'{$operator}'`.");
        }
        $parts = $this->_conditions($conditions, $states);

        $operator = (is_array($parts) && next($parts) === 'NULL' && isset($config['null'])) ? $config['null'] : $operator;
        $operator = $operator[0] === ':' ? strtoupper(substr($operator, 1)) : $operator;

        if (isset($config['builder'])) {
            $builder = $this->_builders[$config['builder']];
            return $builder($operator, $parts);
        }
        if (isset($config['format'])) {
            return sprintf($config['format'], join(", ", $parts));
        }
        return join(" {$operator} ", $parts);
    }
554013
private function formQueryPartForUserName($user, DatabaseInterface $database): string
    {
        $condition = 'oxuser.oxusername = ' . $database->quote($user);

        return $condition;
    }
573801
public function withUserInfo($user, $password = null)
    {
        $userInfo = implode(':', [$user, $password]);

        return $this->_clone('userInfo', rtrim($userInfo, ':'));
    }
742039
protected function config($host, $database, $user, $password)
    {
        //if(Config::get("database.host")=="" && Config::get("database.username")=="" && Config::get("database.password")=="" && Config::get("database.database")=="") throw new DatabaseArgumentsException();
        return [
            'host'     => $this->setLocal($host ? $host : Config::get('database.host')),
            'database' => $database ? $database : Config::get('database.database'),
            'user'     => $user ? $user : Config::get('database.username'),
            'password' => $password ? $password : Config::get('database.password'),
        ];
    }
759441
public static function match($password, array $userInputs = [])
    {
        // Translate l33t password and dictionary match the translated password.
        $map = static::getSubstitutions($password);
        $indexSubs = array_filter($map);
        if (empty($indexSubs)) {
            return [];
        }
        $translatedWord = static::translate($password, $map);

        $matches = [];
        $dicts = static::getRankedDictionaries();
        foreach ($dicts as $name => $dict) {
            $results = static::dictionaryMatch($translatedWord, $dict);
            foreach ($results as $result) {
                // Set substituted elements.
                $result['sub'] = [];
                $result['sub_display'] = [];
                foreach ($indexSubs as $i => $t) {
                    $result['sub'][$password[$i]] = $t;
                    $result['sub_display'][] = "{$password[$i]} -> ${t}";
                }
                $result['sub_display'] = implode(', ', $result['sub_display']);
                $result['dictionary_name'] = $name;
                // Replace translated token with orignal password token.
                $token = substr($password, $result['begin'], $result['end'] - $result['begin'] + 1);
                $matches[] = new static($password, $result['begin'], $result['end'], $token, $result);
            }
        }

        return $matches;
    }