1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

- We are now at _seven_ different policies, not counting the non-GD version. We must remove something...

- Made the CAPTCHA system idiot proof, disabling all the policies still lets an image get created.
- We handle the case of a user having GD but no TTF. Thankfully, we have CAPTCHAs that don't need TTF!
- Fixed that stupid language string...
- Renamed Occlude to Overlap
- Shape is now only enabled if TTF support is detected


git-svn-id: file:///svn/phpbb/trunk@5985 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M
2006-05-30 04:27:14 +00:00
parent 5465ceb507
commit 74799e168d
7 changed files with 578 additions and 194 deletions

View File

@@ -24,7 +24,7 @@ class ucp_confirm
{
function main($id, $mode)
{
global $db, $user, $phpbb_root_path;
global $db, $user, $phpbb_root_path, $config;
// Do we have an id? No, then just exit
$confirm_id = request_var('id', '');
@@ -51,9 +51,31 @@ class ucp_confirm
exit;
}
if (extension_loaded('gd'))
// Some people might want the olde style CAPTCHA even if they have GD enabled, this also saves us from people who have GD but no TTF
$policy_modules = array('policy_entropy', 'policy_3dbitmap');
if (function_exists('imagettfbbox') && function_exists('imagettftext'))
{
$policy_modules[] = 'policy_overlap';
$policy_modules[] = 'policy_shape';
$policy_modules[] = 'policy_cells';
$policy_modules[] = 'policy_stencil';
$policy_modules[] = 'policy_composite';
}
foreach ($policy_modules as $key => $name)
{
if ($config[$name] === '0')
{
unset($policy_modules[$key]);
}
}
$policy = '';
if (extension_loaded('gd') && sizeof($policy_modules))
{
include($phpbb_root_path . 'includes/captcha/captcha_gd.php');
$policy = $policy_modules[array_rand($policy_modules)];
}
else
{
@@ -61,7 +83,7 @@ class ucp_confirm
}
$captcha = new captcha();
$captcha->execute($row['code']);
$captcha->execute($row['code'], $policy);
exit;
}
}