1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00
-Refactor the confirm table cleanup
-Add confirm table cleanup to session garbage collection. Might require own pseudo-cron.


git-svn-id: file:///svn/phpbb/trunk@8089 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof
2007-09-13 15:15:27 +00:00
parent 685282c2cb
commit 052025bb1f
6 changed files with 66 additions and 41 deletions

View File

@@ -427,31 +427,8 @@ class ucp_register
$str = '';
if (!$change_lang)
{
$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';
$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) . '
AND confirm_type = ' . CONFIRM_REG;
$db->sql_query($sql);
}
}
$db->sql_freeresult($result);
$user->confirm_gc(CONFIRM_REG);
$sql = 'SELECT COUNT(session_id) AS attempts
FROM ' . CONFIRM_TABLE . "
WHERE session_id = '" . $db->sql_escape($user->session_id) . "'