Vergleich inc/datahandlers/login.php - 1.8.5 - 1.8.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 41Zeile 41
	 */
public $login_data = array();


	 */
public $login_data = array();


 
	/**
* @var bool
*/

	public $captcha_verified = true;

	public $captcha_verified = true;

	





/**
* @var bool|captcha
*/

	private $captcha = false;


	private $captcha = false;


 
	/**
* @var int
*/

	public $username_method = null;


	public $username_method = null;


 
	/**
* @param int $check_captcha
*/

	function verify_attempts($check_captcha = 0)
{
global $db, $mybb;

	function verify_attempts($check_captcha = 0)
{
global $db, $mybb;

Zeile 67Zeile 79
		}
}


		}
}


 
	/**
* @return bool
*/

	function verify_captcha()
{
global $db, $mybb;

	function verify_captcha()
{
global $db, $mybb;

Zeile 92Zeile 107
			{
$this->captcha_verified = true;
return true;

			{
$this->captcha_verified = true;
return true;

			}
}

			}
}

		else if($mybb->input['quick_login'] == 1 && $mybb->input['quick_password'] && $mybb->input['quick_username'])
{
$this->set_error('regimagerequired');

		else if($mybb->input['quick_login'] == 1 && $mybb->input['quick_password'] && $mybb->input['quick_username'])
{
$this->set_error('regimagerequired');

Zeile 106Zeile 121
		}
}


		}
}


 
	/**
* @return bool
*/

	function verify_username()
{
$this->get_login_data();

	function verify_username()
{
$this->get_login_data();

Zeile 115Zeile 133
			$this->invalid_combination();
return false;
}

			$this->invalid_combination();
return false;
}

	}

 




 
		return true;
}

/**
* @param bool $strict
*
* @return bool
*/

	function verify_password($strict = true)
{
global $db, $mybb, $plugins;

	function verify_password($strict = true)
{
global $db, $mybb, $plugins;

Zeile 126Zeile 151
		if(empty($this->login_data['username']))
{
// Username must be validated to apply a password to

		if(empty($this->login_data['username']))
{
// Username must be validated to apply a password to

			$this->invalid_combination();
return false;
}


			$this->invalid_combination();
return false;
}


		$args = array(
'this' => &$this,
'strict' => &$strict,

		$args = array(
'this' => &$this,
'strict' => &$strict,

Zeile 138Zeile 163
		$plugins->run_hooks('datahandler_login_verify_password_start', $args);

$user = &$this->data;

		$plugins->run_hooks('datahandler_login_verify_password_start', $args);

$user = &$this->data;


$password = md5($user['password']);

 

if(!$this->login_data['uid'] || $this->login_data['uid'] && !$this->login_data['salt'] && $strict == false)
{
$this->invalid_combination();


if(!$this->login_data['uid'] || $this->login_data['uid'] && !$this->login_data['salt'] && $strict == false)
{
$this->invalid_combination();

		}


		}


		if($strict == true)
{
if(!$this->login_data['salt'])
{
// Generate a salt for this user and assume the password stored in db is a plain md5 password
$this->login_data['salt'] = generate_salt();

		if($strict == true)
{
if(!$this->login_data['salt'])
{
// Generate a salt for this user and assume the password stored in db is a plain md5 password
$this->login_data['salt'] = generate_salt();

				$this->login_data['password'] = salt_password($this->login_data['password'], $this->login_data['salt']);

				$this->login_data['password'] = create_password_hash($this->login_data['password'], $this->login_data['salt']);


$sql_array = array(
"salt" => $this->login_data['salt'],


$sql_array = array(
"salt" => $this->login_data['salt'],

Zeile 173Zeile 196
				$db->update_query("users", $sql_array, "uid = '{$this->login_data['uid']}'");
}
}

				$db->update_query("users", $sql_array, "uid = '{$this->login_data['uid']}'");
}
}


$salted_password = md5(md5($this->login_data['salt']).$password);

 

$plugins->run_hooks('datahandler_login_verify_password_end', $args);


$plugins->run_hooks('datahandler_login_verify_password_end', $args);


if($salted_password !== $this->login_data['password'])


if(!verify_user_password($this->login_data, $user['password']))

		{
$this->invalid_combination(true);
return false;
}

		{
$this->invalid_combination(true);
return false;
}

 

return true;

	}


	}


 
	/**
* @param bool $show_login_attempts
*/

	function invalid_combination($show_login_attempts = false)
{
global $db, $lang, $mybb;

	function invalid_combination($show_login_attempts = false)
{
global $db, $lang, $mybb;

Zeile 226Zeile 252
		$user = &$this->data;

$options = array(

		$user = &$this->data;

$options = array(

			'fields' => array('uid', 'username', 'password', 'salt', 'loginkey', 'coppauser', 'usergroup', 'loginattempts'),

			'fields' => '*',

			'username_method' => (int)$settings['username_method']
);


			'username_method' => (int)$settings['username_method']
);


Zeile 238Zeile 264
		$this->login_data = get_user_by_username($user['username'], $options);
}


		$this->login_data = get_user_by_username($user['username'], $options);
}


 
	/**
* @return bool
*/

	function validate_login()
{
global $plugins, $mybb;

	function validate_login()
{
global $plugins, $mybb;

Zeile 272Zeile 301
		return true;
}


		return true;
}


 
	/**
* @return bool true
*/

	function complete_login()
{
global $plugins, $db, $mybb, $session;

	function complete_login()
{
global $plugins, $db, $mybb, $session;