芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/libraries/vendor/joomla/authentication/src/Strategies/DatabaseStrategy.php
input = $input; $this->db = $database; $options['database_table'] = $options['database_table'] ?? '#__users'; $options['username_column'] = $options['username_column'] ?? 'username'; $options['password_column'] = $options['password_column'] ?? 'password'; $this->dbOptions = $options; } /** * Attempt to authenticate the username and password pair. * * @return string|boolean A string containing a username if authentication is successful, false otherwise. * * @since 1.1.0 */ public function authenticate() { $username = $this->input->get('username', false, 'username'); $password = $this->input->get('password', false, 'raw'); if (!$username || !$password) { $this->status = Authentication::NO_CREDENTIALS; return false; } return $this->doAuthenticate($username, $password); } /** * Retrieve the hashed password for the specified user. * * @param string $username Username to lookup. * * @return string|boolean Hashed password on success or boolean false on failure. * * @since 1.1.0 */ protected function getHashedPassword($username) { try { $password = $this->db->setQuery( $this->db->getQuery(true) ->select($this->db->quoteName($this->dbOptions['password_column'])) ->from($this->db->quoteName($this->dbOptions['database_table'])) ->where($this->db->quoteName($this->dbOptions['username_column']) . ' = ?') ->bind(1, $username) )->loadResult(); } catch (\RuntimeException $exception) { return false; } if (!$password) { return false; } return $password; } }