mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
*blinks* there were supposed to be more files, where are they? Ah, here
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9707 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
c6a84179e3
commit
5f89b6a6d0
2 changed files with 10 additions and 8 deletions
|
@ -38,12 +38,13 @@ class phpbb_default_captcha
|
||||||
global $config, $db, $user;
|
global $config, $db, $user;
|
||||||
|
|
||||||
// read input
|
// read input
|
||||||
|
$this->confirm_id = request_var('confirm_id', '');
|
||||||
$this->confirm_code = request_var('confirm_code', '');
|
$this->confirm_code = request_var('confirm_code', '');
|
||||||
$refresh = request_var('refresh_vc', false) && $config['confirm_refresh'];
|
$refresh = request_var('refresh_vc', false) && $config['confirm_refresh'];
|
||||||
|
|
||||||
$this->type = (int) $type;
|
$this->type = (int) $type;
|
||||||
|
|
||||||
if (!$this->load_code())
|
if (!strlen($this->confirm_id) || !$this->load_code())
|
||||||
{
|
{
|
||||||
// we have no confirm ID, better get ready to display something
|
// we have no confirm ID, better get ready to display something
|
||||||
$this->generate_code();
|
$this->generate_code();
|
||||||
|
@ -95,6 +96,7 @@ class phpbb_default_captcha
|
||||||
'CONFIRM_IMG' => '<img src="'. $link . '" />',
|
'CONFIRM_IMG' => '<img src="'. $link . '" />',
|
||||||
'CONFIRM_ID' => $this->confirm_id,
|
'CONFIRM_ID' => $this->confirm_id,
|
||||||
'S_CONFIRM_CODE' => true,
|
'S_CONFIRM_CODE' => true,
|
||||||
|
'S_TYPE' => $this->type,
|
||||||
'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh'] && $this->type == CONFIRM_REG) ? true : false,
|
'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh'] && $this->type == CONFIRM_REG) ? true : false,
|
||||||
'L_CONFIRM_EXPLAIN' => $explain,
|
'L_CONFIRM_EXPLAIN' => $explain,
|
||||||
));
|
));
|
||||||
|
@ -178,7 +180,7 @@ class phpbb_default_captcha
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate($data = false)
|
function validate()
|
||||||
{
|
{
|
||||||
global $config, $db, $user;
|
global $config, $db, $user;
|
||||||
|
|
||||||
|
@ -204,7 +206,6 @@ class phpbb_default_captcha
|
||||||
{
|
{
|
||||||
// okay, incorrect answer. Let's ask a new question.
|
// okay, incorrect answer. Let's ask a new question.
|
||||||
$this->new_attempt();
|
$this->new_attempt();
|
||||||
$this->solved = false;
|
|
||||||
return $error;
|
return $error;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -277,6 +278,7 @@ class phpbb_default_captcha
|
||||||
'seed' => (int) $this->seed)) . '
|
'seed' => (int) $this->seed)) . '
|
||||||
, attempts = attempts + 1
|
, attempts = attempts + 1
|
||||||
WHERE
|
WHERE
|
||||||
|
confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\' AND
|
||||||
session_id = \'' . $db->sql_escape($user->session_id) . '\'';
|
session_id = \'' . $db->sql_escape($user->session_id) . '\'';
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
@ -288,9 +290,10 @@ class phpbb_default_captcha
|
||||||
{
|
{
|
||||||
global $db, $user;
|
global $db, $user;
|
||||||
|
|
||||||
$sql = 'SELECT code, confirm_id, seed, attempts
|
$sql = 'SELECT code, seed, attempts
|
||||||
FROM ' . CONFIRM_TABLE . "
|
FROM ' . CONFIRM_TABLE . "
|
||||||
WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
|
WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
|
||||||
|
AND session_id = '" . $db->sql_escape($user->session_id) . "'
|
||||||
AND confirm_type = " . $this->type;
|
AND confirm_type = " . $this->type;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
|
@ -298,7 +301,6 @@ class phpbb_default_captcha
|
||||||
|
|
||||||
if ($row)
|
if ($row)
|
||||||
{
|
{
|
||||||
$this->confirm_id = $row['confirm_id'];
|
|
||||||
$this->code = $row['code'];
|
$this->code = $row['code'];
|
||||||
$this->seed = $row['seed'];
|
$this->seed = $row['seed'];
|
||||||
$this->attempts = $row['attempts'];
|
$this->attempts = $row['attempts'];
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- IF S_TYPE == 0 -->
|
<!-- IF S_TYPE == 1 -->
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="inner"><span class="corners-top"><span></span></span>
|
<div class="inner"><span class="corners-top"><span></span></span>
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
{L_RECAPTCHA_NOT_AVAILABLE}
|
{L_RECAPTCHA_NOT_AVAILABLE}
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF S_TYPE == 0 -->
|
<!-- IF S_TYPE == 1 -->
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<span class="corners-bottom"><span></span></span></div>
|
<span class="corners-bottom"><span></span></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue