phpBB

Code Changes

File: phpbb/auth/provider/db.php

  Unmodified   Added   Modified   Removed
Line 87Line 87

$username_clean = utf8_clean_string($username);



$username_clean = utf8_clean_string($username);


		$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_login_attempts

		$sql = 'SELECT *

			FROM ' . USERS_TABLE . "
WHERE username_clean = '" . $this->db->sql_escape($username_clean) . "'";
$result = $this->db->sql_query($sql);

			FROM ' . USERS_TABLE . "
WHERE username_clean = '" . $this->db->sql_escape($username_clean) . "'";
$result = $this->db->sql_query($sql);

Line 123Line 123
				'username_clean'		=> $username_clean,
);
$sql = 'INSERT INTO ' . LOGIN_ATTEMPT_TABLE . $this->db->sql_build_array('INSERT', $attempt_data);

				'username_clean'		=> $username_clean,
);
$sql = 'INSERT INTO ' . LOGIN_ATTEMPT_TABLE . $this->db->sql_build_array('INSERT', $attempt_data);

			$result = $this->db->sql_query($sql);

			$this->db->sql_query($sql);

		}
else
{

		}
else
{

Line 155Line 155
		// Every auth module is able to define what to do by itself...
if ($show_captcha)
{

		// Every auth module is able to define what to do by itself...
if ($show_captcha)
{

 
			/* @var $captcha_factory \phpbb\captcha\factory */

			$captcha_factory = $this->phpbb_container->get('captcha.factory');
$captcha = $captcha_factory->get_instance($this->config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);

			$captcha_factory = $this->phpbb_container->get('captcha.factory');
$captcha = $captcha_factory->get_instance($this->config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);

Line 175Line 176
		}

// Check password ...

		}

// Check password ...

		if ($this->passwords_manager->check($password, $row['user_password']))

		if ($this->passwords_manager->check($password, $row['user_password'], $row))

		{
// Check for old password hash...
if ($this->passwords_manager->convert_flag || strlen($row['user_password']) == 32)

		{
// Check for old password hash...
if ($this->passwords_manager->convert_flag || strlen($row['user_password']) == 32)

Line 232Line 233
		// Give status about wrong password...
return array(
'status' => ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD,

		// Give status about wrong password...
return array(
'status' => ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD,

			'error_msg'		=> ($show_captcha) ? 'LOGIN_ERROR_ATTEMPTS' : 'LOGIN_ERROR_PASSWORD',

			'error_msg'		=> 'LOGIN_ERROR_PASSWORD',

			'user_row'		=> $row,
);
}

			'user_row'		=> $row,
);
}