aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2009-06-02 14:12:23 +0000
committerHenry Sudhof <kellanved@phpbb.com>2009-06-02 14:12:23 +0000
commitb776d02682492077a4fafd8835d7c4a17e50762d (patch)
tree0c94c7e662baaaf047f1eace9658bd13fc36b8e3 /phpBB/includes/session.php
parentb9ece6bdfe65b2e63c42d4a83fd831b4377e1b90 (diff)
downloadforums-b776d02682492077a4fafd8835d7c4a17e50762d.tar
forums-b776d02682492077a4fafd8835d7c4a17e50762d.tar.gz
forums-b776d02682492077a4fafd8835d7c4a17e50762d.tar.bz2
forums-b776d02682492077a4fafd8835d7c4a17e50762d.tar.xz
forums-b776d02682492077a4fafd8835d7c4a17e50762d.zip
Okay, a first ci of the new captcha plugins. We'll add dynamic template includes later, as well as documentation on how to use this. I'm prepared to get yelled at for bugs (oh, I know that there are plenty); but please blame spammers for broken styles and MODs.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9524 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php40
1 files changed, 8 insertions, 32 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 043a637584..e039fce6e1 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -891,7 +891,7 @@ class session
*/
function session_gc()
{
- global $db, $config;
+ global $db, $config, $phpbb_root_path, $phpEx;
$batch_size = 10;
@@ -949,40 +949,16 @@ class session
WHERE last_login < ' . (time() - (86400 * (int) $config['max_autologin_time']));
$db->sql_query($sql);
}
- $this->confirm_gc();
- }
-
- 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))
+
+ // only called from CRON; should be a safe workaround until the infrastructure gets going
+ if (!class_exists('captcha_factory'))
{
- $sql = 'DELETE FROM ' . CONFIRM_TABLE . '
- WHERE ' . $db->sql_in_set('session_id', $sql_in);
- $db->sql_query($sql);
+ include($phpbb_root_path . "includes/captcha/captcha_factory." . $phpEx);
}
+ captcha_factory::garbage_collect($config['captcha_plugin']);
}
- $db->sql_freeresult($result);
+
+ return;
}