mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-02 14:57:37 +02:00
tuning
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10454 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -88,6 +88,12 @@ class phpbb_captcha_qa
|
|||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Possible snag: the user didn't send a confirm_id. See, if we have something on file.
|
||||||
|
if (!strlen($this->confirm_id))
|
||||||
|
{
|
||||||
|
$this->load_confirm_id();
|
||||||
|
}
|
||||||
|
|
||||||
// okay, if there is a confirm_id, we try to load that confirm's state
|
// okay, if there is a confirm_id, we try to load that confirm's state
|
||||||
if (!strlen($this->confirm_id) || !$this->load_answer())
|
if (!strlen($this->confirm_id) || !$this->load_answer())
|
||||||
{
|
{
|
||||||
@@ -473,6 +479,38 @@ class phpbb_captcha_qa
|
|||||||
$this->load_answer();
|
$this->load_answer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See if there is already an entry for the current session.
|
||||||
|
*/
|
||||||
|
function load_confirm_id()
|
||||||
|
{
|
||||||
|
global $db, $user;
|
||||||
|
|
||||||
|
if (!sizeof($this->question_ids))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'SELECT confirm_id
|
||||||
|
FROM ' . CAPTCHA_QA_CONFIRM_TABLE . "
|
||||||
|
WHERE
|
||||||
|
session_id = '" . $db->sql_escape($user->session_id) . "'
|
||||||
|
AND lang_iso = '" . $db->sql_escape($this->question_lang) . "'
|
||||||
|
AND confirm_type = " . $this->type;
|
||||||
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($row)
|
||||||
|
{
|
||||||
|
$this->confirm_id = $row['confirm_id'];
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Look up everything we need and populate the instance variables.
|
* Look up everything we need and populate the instance variables.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user