diff options
author | David M <davidmj@users.sourceforge.net> | 2006-05-30 04:27:14 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-05-30 04:27:14 +0000 |
commit | 74799e168de336d6aaddb43606772282c3319e09 (patch) | |
tree | e9eba88da220549fc22c025715b87692f67baa44 /phpBB/includes/ucp | |
parent | 5465ceb5071d2b58609ae68004e453334d569649 (diff) | |
download | forums-74799e168de336d6aaddb43606772282c3319e09.tar forums-74799e168de336d6aaddb43606772282c3319e09.tar.gz forums-74799e168de336d6aaddb43606772282c3319e09.tar.bz2 forums-74799e168de336d6aaddb43606772282c3319e09.tar.xz forums-74799e168de336d6aaddb43606772282c3319e09.zip |
- 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
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r-- | phpBB/includes/ucp/ucp_confirm.php | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php index 80a591f495..6c371b7a63 100644 --- a/phpBB/includes/ucp/ucp_confirm.php +++ b/phpBB/includes/ucp/ucp_confirm.php @@ -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; } } |