mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Okay, that is pretty raw, but better to have it in place than trying to play catch-up. Introducing an early stage of CAPTCHA modules.
git-svn-id: file:///svn/phpbb/trunk@8889 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -923,42 +923,18 @@ class session
|
||||
WHERE last_login < ' . (time() - (86400 * (int) $config['max_autologin_time']));
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
$this->confirm_gc();
|
||||
|
||||
// only called from CRON; should be a safe workaround until the infrastructure gets going
|
||||
if (!class_exists('captcha_factory'))
|
||||
{
|
||||
include(PHPBB_ROOT_PATH . "includes/captcha/captcha_factory." . PHP_EXT);
|
||||
}
|
||||
captcha_factory::garbage_collect($config['captcha_plugin']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
function confirm_gc($type = 0)
|
||||
{
|
||||
global $db, $config;
|
||||
|
||||
$sql = 'SELECT DISTINCT c.session_id
|
||||
FROM ' . CONFIRM_TABLE . ' c
|
||||
LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id)
|
||||
WHERE s.session_id IS NULL' .
|
||||
((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$sql_in = array();
|
||||
do
|
||||
{
|
||||
$sql_in[] = (string) $row['session_id'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
if (sizeof($sql_in))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . CONFIRM_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('session_id', $sql_in);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets a cookie
|
||||
|
Reference in New Issue
Block a user