2003-05-19 15:23:04 +00:00
|
|
|
<?php
|
2005-04-09 12:26:45 +00:00
|
|
|
/**
|
|
|
|
*
|
2006-04-29 16:30:56 +00:00
|
|
|
* @package VC
|
2005-04-09 12:26:45 +00:00
|
|
|
* @version $Id$
|
|
|
|
* @copyright (c) 2005 phpBB Group
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
|
|
|
*
|
|
|
|
*/
|
2003-05-19 15:23:04 +00:00
|
|
|
|
2005-04-09 12:26:45 +00:00
|
|
|
/**
|
|
|
|
* ucp_confirm
|
|
|
|
* Visual confirmation
|
|
|
|
*
|
|
|
|
* Note to potential users of this code ...
|
|
|
|
*
|
|
|
|
* Remember this is released under the _GPL_ and is subject
|
|
|
|
* to that licence. Do not incorporate this within software
|
|
|
|
* released or distributed in any way under a licence other
|
|
|
|
* than the GPL. We will be watching ... ;)
|
2006-06-13 21:06:29 +00:00
|
|
|
*
|
|
|
|
* @package VC
|
2005-04-09 12:26:45 +00:00
|
|
|
*/
|
2005-10-04 21:31:35 +00:00
|
|
|
class ucp_confirm
|
2003-05-19 15:23:04 +00:00
|
|
|
{
|
2006-06-11 18:13:52 +00:00
|
|
|
var $u_action;
|
|
|
|
|
2005-10-04 21:31:35 +00:00
|
|
|
function main($id, $mode)
|
2003-05-19 15:23:04 +00:00
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
global $db, $user, $phpbb_root_path, $config, $phpEx;
|
2003-05-19 15:23:04 +00:00
|
|
|
|
|
|
|
// Do we have an id? No, then just exit
|
2004-05-26 20:16:20 +00:00
|
|
|
$confirm_id = request_var('id', '');
|
2006-03-12 23:19:55 +00:00
|
|
|
$type = request_var('type', 0);
|
2004-05-26 20:16:20 +00:00
|
|
|
|
2006-03-12 23:19:55 +00:00
|
|
|
if (!$confirm_id || !$type)
|
2003-05-19 15:23:04 +00:00
|
|
|
{
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Try and grab code for this id and session
|
2006-12-03 17:36:59 +00:00
|
|
|
$sql = 'SELECT code, seed
|
2003-09-08 12:42:32 +00:00
|
|
|
FROM ' . CONFIRM_TABLE . "
|
2006-01-26 21:39:23 +00:00
|
|
|
WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
|
2006-03-12 23:19:55 +00:00
|
|
|
AND confirm_id = '" . $db->sql_escape($confirm_id) . "'
|
|
|
|
AND confirm_type = $type";
|
2003-05-19 15:23:04 +00:00
|
|
|
$result = $db->sql_query($sql);
|
2006-02-09 07:02:50 +00:00
|
|
|
$row = $db->sql_fetchrow($result);
|
|
|
|
$db->sql_freeresult($result);
|
2003-05-19 15:23:04 +00:00
|
|
|
|
|
|
|
// If we have a row then grab data else create a new id
|
2006-02-09 07:02:50 +00:00
|
|
|
if (!$row)
|
2003-05-19 15:23:04 +00:00
|
|
|
{
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2006-11-03 23:09:16 +00:00
|
|
|
if ($config['captcha_gd'])
|
2006-02-04 17:59:25 +00:00
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
|
2006-02-04 17:59:25 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
|
2006-02-04 17:59:25 +00:00
|
|
|
}
|
2003-05-19 15:23:04 +00:00
|
|
|
|
2006-04-29 16:30:56 +00:00
|
|
|
$captcha = new captcha();
|
2006-12-03 17:36:59 +00:00
|
|
|
$captcha->execute($row['code'], $row['seed']);
|
2006-04-29 16:30:56 +00:00
|
|
|
exit;
|
2003-05-19 15:23:04 +00:00
|
|
|
}
|
|
|
|
}
|
2006-06-11 18:13:52 +00:00
|
|
|
|
2003-05-19 15:23:04 +00:00
|
|
|
?>
|