aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/auth/auth_db.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-03-03 23:32:09 +0100
committerNils Adermann <naderman@naderman.de>2010-03-03 23:32:09 +0100
commit693a2dc99bf07aeac1865d4a48ddf2589317ac7a (patch)
tree8bd926d3671dc9de0a72d4025aaa625a18ba51e1 /phpBB/includes/auth/auth_db.php
parentb68de2323d6444b4b3685a98bbcb9500a38e45cb (diff)
parentac329275662f737f03f485107cb69412739c1afa (diff)
downloadforums-693a2dc99bf07aeac1865d4a48ddf2589317ac7a.tar
forums-693a2dc99bf07aeac1865d4a48ddf2589317ac7a.tar.gz
forums-693a2dc99bf07aeac1865d4a48ddf2589317ac7a.tar.bz2
forums-693a2dc99bf07aeac1865d4a48ddf2589317ac7a.tar.xz
forums-693a2dc99bf07aeac1865d4a48ddf2589317ac7a.zip
Merge branch 'develop-olympus' into develop
I simply used the develop-olympus version of all files that conflicted. Afterall there should not have been anything new in develop yet.
Diffstat (limited to 'phpBB/includes/auth/auth_db.php')
-rw-r--r--phpBB/includes/auth/auth_db.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php
index 71f8a7c082..73c4f92976 100644
--- a/phpBB/includes/auth/auth_db.php
+++ b/phpBB/includes/auth/auth_db.php
@@ -62,16 +62,22 @@ function login_db(&$username, &$password)
'user_row' => array('user_id' => ANONYMOUS),
);
}
+ $show_captcha = $config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts'];
// If there are too much login attempts, we need to check for an confirm image
// Every auth module is able to define what to do by itself...
- if ($config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts'])
+ if ($show_captcha)
{
// Visual Confirmation handling
+ if (!class_exists('phpbb_captcha_factory'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include ($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
+ }
$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);
- $vc_response = $captcha->validate();
+ $vc_response = $captcha->validate($row);
if ($vc_response)
{
return array(
@@ -80,6 +86,10 @@ function login_db(&$username, &$password)
'user_row' => $row,
);
}
+ else
+ {
+ $captcha->reset();
+ }
}
@@ -189,8 +199,8 @@ function login_db(&$username, &$password)
// Give status about wrong password...
return array(
- 'status' => LOGIN_ERROR_PASSWORD,
- 'error_msg' => 'LOGIN_ERROR_PASSWORD',
+ 'status' => ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD,
+ 'error_msg' => ($show_captcha) ? 'LOGIN_ERROR_ATTEMPTS' : 'LOGIN_ERROR_PASSWORD',
'user_row' => $row,
);
}