|
|
ef5584 |
|
|
|
ef5584 |
/**
|
|
|
ef5584 |
*
|
|
|
ef5584 |
* @package VC
|
|
|
ef5584 |
* @version $Id: ucp_confirm.php 8655 2008-06-13 19:39:01Z acydburn $
|
|
|
ef5584 |
* @copyright (c) 2005 phpBB Group
|
|
|
ef5584 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
|
|
ef5584 |
*
|
|
|
ef5584 |
*/
|
|
|
ef5584 |
|
|
|
ef5584 |
/**
|
|
|
ef5584 |
* @ignore
|
|
|
ef5584 |
*/
|
|
|
ef5584 |
if (!defined('IN_PHPBB'))
|
|
|
ef5584 |
{
|
|
|
ef5584 |
exit;
|
|
|
ef5584 |
}
|
|
|
ef5584 |
|
|
|
ef5584 |
/**
|
|
|
ef5584 |
* ucp_confirm
|
|
|
ef5584 |
* Visual confirmation
|
|
|
ef5584 |
*
|
|
|
ef5584 |
* Note to potential users of this code ...
|
|
|
ef5584 |
*
|
|
|
ef5584 |
* Remember this is released under the _GPL_ and is subject
|
|
|
ef5584 |
* to that licence. Do not incorporate this within software
|
|
|
ef5584 |
* released or distributed in any way under a licence other
|
|
|
ef5584 |
* than the GPL. We will be watching ... ;)
|
|
|
ef5584 |
*
|
|
|
ef5584 |
* @package VC
|
|
|
ef5584 |
*/
|
|
|
ef5584 |
class ucp_confirm
|
|
|
ef5584 |
{
|
|
|
ef5584 |
var $u_action;
|
|
|
ef5584 |
|
|
|
ef5584 |
function main($id, $mode)
|
|
|
ef5584 |
{
|
|
|
ef5584 |
global $db, $user, $phpbb_root_path, $config, $phpEx;
|
|
|
ef5584 |
|
|
|
ef5584 |
// Do we have an id? No, then just exit
|
|
|
ef5584 |
$confirm_id = request_var('id', '');
|
|
|
ef5584 |
$type = request_var('type', 0);
|
|
|
ef5584 |
|
|
|
ef5584 |
if (!$confirm_id || !$type)
|
|
|
ef5584 |
{
|
|
|
ef5584 |
exit;
|
|
|
ef5584 |
}
|
|
|
ef5584 |
|
|
|
ef5584 |
// Try and grab code for this id and session
|
|
|
ef5584 |
$sql = 'SELECT code, seed
|
|
|
ef5584 |
FROM ' . CONFIRM_TABLE . "
|
|
|
ef5584 |
WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
|
|
|
ef5584 |
AND confirm_id = '" . $db->sql_escape($confirm_id) . "'
|
|
|
ef5584 |
AND confirm_type = $type";
|
|
|
ef5584 |
$result = $db->sql_query($sql);
|
|
|
ef5584 |
$row = $db->sql_fetchrow($result);
|
|
|
ef5584 |
$db->sql_freeresult($result);
|
|
|
ef5584 |
|
|
|
ef5584 |
// If we have a row then grab data else create a new id
|
|
|
ef5584 |
if (!$row)
|
|
|
ef5584 |
{
|
|
|
ef5584 |
exit;
|
|
|
ef5584 |
}
|
|
|
ef5584 |
|
|
|
ef5584 |
if ($config['captcha_gd'])
|
|
|
ef5584 |
{
|
|
|
ef5584 |
include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
|
|
|
ef5584 |
}
|
|
|
ef5584 |
else
|
|
|
ef5584 |
{
|
|
|
ef5584 |
include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
|
|
|
ef5584 |
}
|
|
|
ef5584 |
|
|
|
ef5584 |
$captcha = new captcha();
|
|
|
ef5584 |
$captcha->execute($row['code'], $row['seed']);
|
|
|
ef5584 |
|
|
|
ef5584 |
garbage_collection();
|
|
|
ef5584 |
exit_handler();
|
|
|
ef5584 |
}
|
|
|
ef5584 |
}
|
|
|
ef5584 |
|
|
|
ef5584 |
?>
|