@param string            $password
@param DatabaseInterface $databaseb

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

@return string
962342
protected function formQueryPartForMD5Password($password, DatabaseInterface $databaseb): string
    {
        $sPassSelect = ' oxuser.oxpassword = BINARY MD5( CONCAT( ' . $databaseb->quote($password) . ', UNHEX( oxuser.oxpasssalt ) ) ) ';

        return $sPassSelect;
    }
301969
protected function setPassword($password) {
        if (!isset($password)) $password = '';
        else if (!is_string($password)) throw new IllegalTypeException('Illegal type of parameter $password: '.gettype($password));

        $this->password = $password;
        return $this;
    }
606106
public function connect($type, $host, $dbname = '', $username = null, $password = null, array $options = array())
    {
        if ($this->PDO) {
            // If this object already has a PDO object, don't attempt a new connection
            return $this;
        }

        $dsn = '';

        if ($type == 'sqlite') {
            $dsn = "{$type}:{$host}";
        } else {
            $dsn = "{$type}:host={$host};dbname={$dbname}";
        }
        $PDO = new PDO($dsn, $username, $password, $options);

        if (!$PDO) {
            return false;
        }

        $this->PDO = $PDO;

        $this->setEscapeChar();
        return $this;
    }
1339623
private function hashModeBcrypt($password)
    {
        $this->cwsDebug->titleH2('Create password hash using BCRYPT');
        $this->cwsDebug->labelValue('Password', $password);

        $ite = rand(self::BCRYPT_MIN_ITE, self::BCRYPT_MAX_ITE);
        $this->cwsDebug->labelValue('Iterations', $ite);

        $salt = $this->getBlowfishSalt($ite);
        $this->cwsDebug->labelValue('Salt', $salt);

        $hash = crypt($password, $salt);
        $this->cwsDebug->labelValue('Hash', $hash);
        $this->cwsDebug->labelValue('Length', strlen($hash));

        if (CRYPT_BLOWFISH == 1 && strlen($hash) == self::BCRYPT_LENGTH) {
            return $hash;
        }

        $this->error = 'Cannot generate the BCRYPT password hash...';
        $this->cwsDebug->error($this->error);
    }
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'),
        ];
    }
866210
public String getPassword() {
        final String password = basicJdbcConfiguration.getConfiguredPassword();
        if (calculatedPassword == null || StringUtils.hasText(password)) {
            calculatedPassword = password;
            if (!StringUtils.hasText(calculatedPassword) && JdbcDatabaseManager.isEmbedded(basicJdbcConfiguration.getDriverClassName())) {
                calculatedPassword = "";
            }
        }

        return calculatedPassword;
    }
1022604
protected function getDatabaseInformation(InputInterface $input, OutputInterface $output)
    {
        $db = array();

        /**
         * @var \Symfony\Component\Console\Helper\DialogHelper
         */
        $dialog = $this->getHelperSet()->get('dialog');

        if (!$dbHost = $input->getOption('db-host')) {
            $dbHost = $dialog->ask($output, Lang::get('enter_db_host'), 'localhost');
        }

        if (!$dbName = $input->getOption('db-name')) {
            $dbName = $dialog->ask($output, Lang::get('enter_db_name'), 'phpci');
        }

        if (!$dbUser = $input->getOption('db-user')) {
            $dbUser = $dialog->ask($output, Lang::get('enter_db_user'), 'phpci');
        }

        if (!$dbPass = $input->getOption('db-pass')) {
            $dbPass = $dialog->askHiddenResponse($output, Lang::get('enter_db_pass'));
        }

        $db['servers']['read'] = $dbHost;
        $db['servers']['write'] = $dbHost;
        $db['name'] = $dbName;
        $db['username'] = $dbUser;
        $db['password'] = $dbPass;

        return $db;
    }
839861
private function getPassword(InputInterface $input, OutputInterface $output)
    {
        if ($pass = $input->getOption('pass')) {
            return $pass;
        }
        if ($pass = $this->getTransifexConfigValue('/pass')) {
            $this->writelnVerbose($output, 'Using transifex password specified in config.');

            return $pass;
        }
        if ($pass = getenv('transifexpass')) {
            $this->writelnVerbose($output, 'Using transifex password specified in environment.');

            return $pass;
        }
        if ($input->isInteractive()) {
            /** @var \Symfony\Component\Console\Helper\QuestionHelper $dialog */
            $dialog = $this->getHelperSet()->get('question');
            if ($pass = $dialog->ask($input, $output, (new Question('Transifex password:'))->setHidden(true))) {
                return $pass;
            }
        }

        throw new \RuntimeException('Error: you must either specify a password on the commandline or run interactive.');
    }
248299
final String getPassword() {
      if(passwordSource == null) {
         return dbConnection.password;
      } else {
         String usePassword = passwordSource.getPassword(dbConnection.name);
         if(!Strings.isNullOrEmpty(usePassword)) {
            return usePassword;
         } else {
            usePassword = passwordSource.getPassword(dbConnection.connectionString, dbConnection.user);
            return !Strings.isNullOrEmpty(usePassword) ? usePassword : dbConnection.password;
         }
      }
   }
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;
    }
494760
static function addPassword(\Db\Connection $db, User $user, $password) {
    if (!$user) {
      throw new \InvalidArgumentException("No user provided.");
    }

    // does such a password already exist?
    $q = $db->prepare("SELECT * FROM user_passwords WHERE user_id=? LIMIT 1");
    $q->execute(array($user->getId()));
    if ($q->fetch()) {
      throw new UserAlreadyExistsException("That account already has a password.");
    }

    // does the user have an email? required
    $email = $user->getEmail();
    if (!$email) {
      throw new UserSignupException("That account requires an email address to add a password.");
    } else if (!is_valid_email($email)) {
      throw new UserSignupException("That is not a valid email.");
    }

    // create a new password
    $q = $db->prepare("INSERT INTO user_passwords SET user_id=?, password_hash=?");
    $q->execute(array($user->getId(), UserPassword::hash($password)));

    return true;
  }
843174
public function getConnection($database = null)
    {
        $buildConnection = $this->getBuildConnection($database);

        //Still useful ?
        //$dsn = str_replace("@DB@", $database, $buildConnection['dsn']);
        $dsn = $buildConnection['dsn'];

        // Set user + password to null if they are empty strings or missing
        $username = isset($buildConnection['user']) && $buildConnection['user'] ? $buildConnection['user'] : null;
        $password = isset($buildConnection['password']) && $buildConnection['password'] ? $buildConnection['password'] : null;

        // Get options from and config and default to null
        $options = isset($buildConnection['options']) && is_array($buildConnection['options']) ? $buildConnection['options'] : null;

        $con = ConnectionFactory::create(['dsn' => $dsn, 'user' => $username, 'password' => $password, 'options' => $options], AdapterFactory::create($buildConnection['adapter']));

        return $con;
    }
270608
public static function get(IDb $db, string $sql)
    {
        $hashCode = $db->hashCode();
        $result = static::$statements[$hashCode][$sql] ?? null;
        if(null === $result)
        {
            return $result;
        }
        if($result['using'])
        {
            return false;
        }
        static::$statements[$hashCode][$sql]['using'] = true;
        $statement = static::$statements[$hashCode][$sql];
        if(RequestContext::exsits())
        {
            $statementCaches = RequestContext::get('statementCaches', []);
            $statementCaches[] = $statement['statement'];
            RequestContext::set('statementCaches', $statementCaches);
        }
        return $statement;
    }
1151019
public static function connect($host, $user, $password, $name)
    {
        $mysqliRef = mysqli_init();

        $connected = @$mysqliRef->real_connect($host,
            $user,
            $password,
            $name);

        if (!$connected || $mysqliRef->connect_error) {
            throw new MysqlUtilsException('Database connection error ('.$mysqliRef->connect_errno.') '.$mysqliRef->connect_error);
        }

        return $mysqliRef;
    }
1036293
public function connect($db = null, $username = null, $password = null, array $array = [])
    {

        $this->db = $db ?: $this->db;
        $this->username = $username ?: $this->username;
        $this->password = $password ?: $this->password;

        $this->auth($this->db, $this->username, $this->password, $array);

        return $this;
    }
260989
public function authenticate($password, $testPassword = true)
    {
        $auths = $this->loadAuthorizers($password, $testPassword);

        $lastAuthorizer = null;
        foreach ($auths as $lastAuthorizer => $result) {
            if (is_callable($result)) {
                $result = call_user_func($result);
            }

            if ($result instanceof AdapterInterface) {
                $result = $result->authenticate();
            }

            if ($result instanceof Result) {
                if (! $result->isValid()) {
                    break;
                }
            } else {
                if (true === $result) {
                    $result = new Result(Result::SUCCESS, $this->getLoginName());

                } else {
                    // Always a fail when not true
                    if ($result === false) {
                        $code   = Result::FAILURE_CREDENTIAL_INVALID;
                        $result = array();
                    } else {
                        $code   = Result::FAILURE_UNCATEGORIZED;
                        if (is_string($result)) {
                            $result = array($result);
                        }
                    }
                    $result = new Result($code, $this->getLoginName(), $result);
                    break;
                }
            }
        }

        if ($result->isValid() && $this->definition instanceof \Gems_User_DbUserDefinitionAbstract) {
            $this->definition->checkRehash($this, $password);
        }


        $this->afterAuthorization($result, $lastAuthorizer);

        // \MUtil_Echo::track($result);
        $this->_authResult = $result;

        return $result;
    }
827923
public function actionPassword($user, $password)
    {
        $user = $this->getUser($user);
        $user->applyForNewPassword();
        $result = $user->resetPassword($password, $user->getPasswordResetToken());
        if ($result) {
            echo "Password changed.\n";
        } else {
            echo "Password not changed.\n";
        }
        return static::EXIT_CODE_NORMAL;
    }