Zeile 41 | Zeile 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 60 | Zeile 72 |
---|
$mybb->cookies['loginattempts'] = 0; } if($mybb->settings['failedcaptchalogincount'] > 0 && ($user['loginattempts'] > $mybb->settings['failedcaptchalogincount'] || (int)$mybb->cookies['loginattempts'] > $mybb->settings['failedcaptchalogincount']))
|
$mybb->cookies['loginattempts'] = 0; } if($mybb->settings['failedcaptchalogincount'] > 0 && ($user['loginattempts'] > $mybb->settings['failedcaptchalogincount'] || (int)$mybb->cookies['loginattempts'] > $mybb->settings['failedcaptchalogincount']))
|
{
| {
|
$this->captcha_verified = false; $this->verify_captcha(); } } }
|
$this->captcha_verified = false; $this->verify_captcha(); } } }
|
| /** * @return bool */
|
function verify_captcha() { global $db, $mybb;
| function verify_captcha() { global $db, $mybb;
|
Zeile 95 | Zeile 110 |
---|
} } else if($mybb->input['quick_login'] == 1 && $mybb->input['quick_password'] && $mybb->input['quick_username'])
|
} } else if($mybb->input['quick_login'] == 1 && $mybb->input['quick_password'] && $mybb->input['quick_username'])
|
{
| {
|
$this->set_error('regimagerequired');
|
$this->set_error('regimagerequired');
|
return false; }
| return false; }
|
else
|
else
|
{
| {
|
$this->set_error('regimageinvalid'); return false; } }
|
$this->set_error('regimageinvalid'); return false; } }
|
| /** * @return bool */
|
function verify_username() { $this->get_login_data();
if(!$this->login_data['uid'])
|
function verify_username() { $this->get_login_data();
if(!$this->login_data['uid'])
|
{ $this->invalid_combination();
| { $this->invalid_combination();
|
return false; }
|
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 147 | Zeile 172 |
---|
}
if($strict == true)
|
}
if($strict == true)
|
{
| {
|
if(!$this->login_data['salt'])
|
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']);
|
// 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']);
|
|
|
$sql_array = array( "salt" => $this->login_data['salt'], "password" => $this->login_data['password']
| $sql_array = array( "salt" => $this->login_data['salt'], "password" => $this->login_data['password']
|
Zeile 161 | Zeile 186 |
---|
$db->update_query("users", $sql_array, "uid = '{$this->login_data['uid']}'"); }
|
$db->update_query("users", $sql_array, "uid = '{$this->login_data['uid']}'"); }
|
|
|
if(!$this->login_data['loginkey']) {
|
if(!$this->login_data['loginkey']) {
|
$this->login_data['loginkey'] = generate_loginkey();
| $this->login_data['loginkey'] = generate_loginkey();
|
$sql_array = array( "loginkey" => $this->login_data['loginkey'] );
$db->update_query("users", $sql_array, "uid = '{$this->login_data['uid']}'"); }
|
$sql_array = array( "loginkey" => $this->login_data['loginkey'] );
$db->update_query("users", $sql_array, "uid = '{$this->login_data['uid']}'"); }
|
}
$salted_password = md5(md5($this->login_data['salt']).$password);
| }
$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);
|
Zeile 183 | Zeile 208 |
---|
$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 238 | Zeile 268 |
---|
$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 272 | Zeile 305 |
---|
return true; }
|
return true; }
|
| /** * @return bool true */
|
function complete_login() { global $plugins, $db, $mybb, $session;
| function complete_login() { global $plugins, $db, $mybb, $session;
|