Revision 1693
Added by Luisehahne about 13 years ago
- fixed deprecated erigi in captcha
| branches/2.8.x/CHANGELOG | ||
|---|---|---|
| 11 | 11 |
! = Update/Change |
| 12 | 12 |
=============================================================================== |
| 13 | 13 |
|
| 14 |
|
|
| 15 |
18 Aug-2012 Build 1693 Dietmar Woellbrink (Luisehahne) |
|
| 16 |
# fixed deprecated erigi in captcha |
|
| 14 | 17 |
08 Aug-2012 Build 1692 Werner v.d.Decken(DarkViper) |
| 15 | 18 |
# corrected pageID in forwarding links |
| 16 | 19 |
! changed request of permission to ami_group_member() and is_group_match() |
| branches/2.8.x/wb/include/captcha/captchas/ttf_image.php | ||
|---|---|---|
| 36 | 36 |
$t_bgs = file_list(WB_PATH.'/include/captcha/backgrounds'); |
| 37 | 37 |
$fonts = array(); |
| 38 | 38 |
$bgs = array(); |
| 39 |
foreach($t_fonts as $file) if(eregi('\.ttf$',$file)) $fonts[]=$file;
|
|
| 40 |
foreach($t_bgs as $file) if(eregi('\.png$',$file)) $bgs[]=$file;
|
|
| 39 |
foreach($t_fonts as $file) { if(preg_match('/\.ttf/',$file)) { $fonts[]=$file; } }
|
|
| 40 |
foreach($t_bgs as $file) { if(preg_match('/\.png/',$file)) { $bgs[]=$file; } }
|
|
| 41 | 41 |
|
| 42 | 42 |
// make random string |
| 43 | 43 |
if(!function_exists('randomString')) {
|
| ... | ... | |
| 96 | 96 |
if(++$count > 4) // too many tries! Use the image |
| 97 | 97 |
break; |
| 98 | 98 |
} while($image_failed); |
| 99 |
|
|
| 99 |
|
|
| 100 | 100 |
} else {
|
| 101 |
|
|
| 101 |
|
|
| 102 | 102 |
// draw whole string at once |
| 103 | 103 |
$image_failed = true; |
| 104 | 104 |
$count=0; |
| ... | ... | |
| 113 | 113 |
$y = mt_rand($height-10,$height-2); |
| 114 | 114 |
$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text); |
| 115 | 115 |
// check if text fits into the image |
| 116 |
if(($res[0]>0 && $res[0]<$width) && ($res[1]>0 && $res[1]<$height) &&
|
|
| 117 |
($res[2]>0 && $res[2]<$width) && ($res[3]>0 && $res[3]<$height) &&
|
|
| 118 |
($res[4]>0 && $res[4]<$width) && ($res[5]>0 && $res[5]<$height) &&
|
|
| 116 |
if(($res[0]>0 && $res[0]<$width) && ($res[1]>0 && $res[1]<$height) && |
|
| 117 |
($res[2]>0 && $res[2]<$width) && ($res[3]>0 && $res[3]<$height) && |
|
| 118 |
($res[4]>0 && $res[4]<$width) && ($res[5]>0 && $res[5]<$height) && |
|
| 119 | 119 |
($res[6]>0 && $res[6]<$width) && ($res[7]>0 && $res[7]<$height) |
| 120 | 120 |
) {
|
| 121 | 121 |
$image_failed = false; |
| ... | ... | |
| 123 | 123 |
if(++$count > 4) // too many tries! Use the image |
| 124 | 124 |
break; |
| 125 | 125 |
} while($image_failed); |
| 126 |
|
|
| 126 |
|
|
| 127 | 127 |
} |
| 128 | 128 |
|
| 129 | 129 |
imagealphablending($reload, TRUE); |
| ... | ... | |
| 137 | 137 |
captcha_header(); |
| 138 | 138 |
ob_start(); |
| 139 | 139 |
imagepng($image); |
| 140 |
header("Content-Length: ".ob_get_length());
|
|
| 140 |
header("Content-Length: ".ob_get_length());
|
|
| 141 | 141 |
ob_end_flush(); |
| 142 | 142 |
imagedestroy($image); |
| 143 |
|
|
| 144 |
?> |
|
| branches/2.8.x/wb/include/captcha/captchas/calc_ttf_image.php | ||
|---|---|---|
| 27 | 27 |
require_once(WB_PATH.'/include/captcha/captcha.php'); |
| 28 | 28 |
|
| 29 | 29 |
if(!isset($_SESSION['captcha_time'])) |
| 30 |
exit; |
|
| 30 |
exit('missing captcha_time');
|
|
| 31 | 31 |
//unset($_SESSION['captcha_time']); // otherwise there can't be 2 captchas on one page! |
| 32 | 32 |
|
| 33 | 33 |
// get lists of fonts and backgrounds |
| ... | ... | |
| 36 | 36 |
$t_bgs = file_list(WB_PATH.'/include/captcha/backgrounds'); |
| 37 | 37 |
$fonts = array(); |
| 38 | 38 |
$bgs = array(); |
| 39 |
foreach($t_fonts as $file) if(eregi('\.ttf$',$file)) $fonts[]=$file;
|
|
| 40 |
foreach($t_bgs as $file) if(eregi('\.png$',$file)) $bgs[]=$file;
|
|
| 39 |
foreach($t_fonts as $file) { if(preg_match('/\.ttf/',$file)) { $fonts[]=$file; } }
|
|
| 40 |
foreach($t_bgs as $file) { if(preg_match('/\.png/',$file)) { $bgs[]=$file; } }
|
|
| 41 | 41 |
|
| 42 | 42 |
// Captcha |
| 43 | 43 |
$sec_id = ''; |
| ... | ... | |
| 50 | 50 |
$x = mt_rand(1,9); |
| 51 | 51 |
$y = mt_rand(1,9); |
| 52 | 52 |
$_SESSION['captcha'.$sec_id] = $x + $y; |
| 53 |
$cap = "$x+$y";
|
|
| 54 |
break;
|
|
| 53 |
$cap = "$x+$y"; |
|
| 54 |
break; |
|
| 55 | 55 |
case 2: |
| 56 | 56 |
$x = mt_rand(10,20); |
| 57 | 57 |
$y = mt_rand(1,9); |
| 58 |
$_SESSION['captcha'.$sec_id] = $x - $y;
|
|
| 59 |
$cap = "$x-$y";
|
|
| 58 |
$_SESSION['captcha'.$sec_id] = $x - $y; |
|
| 59 |
$cap = "$x-$y"; |
|
| 60 | 60 |
break; |
| 61 | 61 |
case 3: |
| 62 | 62 |
$x = mt_rand(2,10); |
| 63 | 63 |
$y = mt_rand(2,5); |
| 64 |
$_SESSION['captcha'.$sec_id] = $x * $y;
|
|
| 65 |
$cap = "$x*$y";
|
|
| 64 |
$_SESSION['captcha'.$sec_id] = $x * $y; |
|
| 65 |
$cap = "$x*$y"; |
|
| 66 | 66 |
break; |
| 67 | 67 |
} |
| 68 | 68 |
$text = $cap; |
| ... | ... | |
| 104 | 104 |
if(++$count > 4) // too many tries! Use the image |
| 105 | 105 |
break; |
| 106 | 106 |
} while($image_failed); |
| 107 |
|
|
| 107 |
|
|
| 108 | 108 |
} else {
|
| 109 |
|
|
| 109 |
|
|
| 110 | 110 |
// draw whole string at once |
| 111 | 111 |
$image_failed = true; |
| 112 | 112 |
$count=0; |
| ... | ... | |
| 121 | 121 |
$y = mt_rand($height-10,$height-2); |
| 122 | 122 |
$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text); |
| 123 | 123 |
// check if text fits into the image |
| 124 |
if(($res[0]>0 && $res[0]<$width) && ($res[1]>0 && $res[1]<$height) &&
|
|
| 125 |
($res[2]>0 && $res[2]<$width) && ($res[3]>0 && $res[3]<$height) &&
|
|
| 126 |
($res[4]>0 && $res[4]<$width) && ($res[5]>0 && $res[5]<$height) &&
|
|
| 124 |
if(($res[0]>0 && $res[0]<$width) && ($res[1]>0 && $res[1]<$height) && |
|
| 125 |
($res[2]>0 && $res[2]<$width) && ($res[3]>0 && $res[3]<$height) && |
|
| 126 |
($res[4]>0 && $res[4]<$width) && ($res[5]>0 && $res[5]<$height) && |
|
| 127 | 127 |
($res[6]>0 && $res[6]<$width) && ($res[7]>0 && $res[7]<$height) |
| 128 | 128 |
) {
|
| 129 | 129 |
$image_failed = false; |
| ... | ... | |
| 131 | 131 |
if(++$count > 4) // too many tries! Use the image |
| 132 | 132 |
break; |
| 133 | 133 |
} while($image_failed); |
| 134 |
|
|
| 134 |
|
|
| 135 | 135 |
} |
| 136 | 136 |
|
| 137 | 137 |
imagealphablending($reload, TRUE); |
| ... | ... | |
| 145 | 145 |
captcha_header(); |
| 146 | 146 |
ob_start(); |
| 147 | 147 |
imagepng($image); |
| 148 |
header("Content-Length: ".ob_get_length());
|
|
| 148 |
header("Content-Length: ".ob_get_length());
|
|
| 149 | 149 |
ob_end_flush(); |
| 150 | 150 |
imagedestroy($image); |
| 151 |
|
|
| 152 |
?> |
|
| branches/2.8.x/wb/include/captcha/captchas/calc_image.php | ||
|---|---|---|
| 41 | 41 |
$x = mt_rand(1,9); |
| 42 | 42 |
$y = mt_rand(1,9); |
| 43 | 43 |
$_SESSION['captcha'.$sec_id] = $x + $y; |
| 44 |
$cap = "$x+$y";
|
|
| 45 |
break;
|
|
| 44 |
$cap = "$x+$y"; |
|
| 45 |
break; |
|
| 46 | 46 |
case 2: |
| 47 | 47 |
$x = mt_rand(10,20); |
| 48 | 48 |
$y = mt_rand(1,9); |
| 49 |
$_SESSION['captcha'.$sec_id] = $x - $y;
|
|
| 50 |
$cap = "$x-$y";
|
|
| 49 |
$_SESSION['captcha'.$sec_id] = $x - $y; |
|
| 50 |
$cap = "$x-$y"; |
|
| 51 | 51 |
break; |
| 52 | 52 |
case 3: |
| 53 | 53 |
$x = mt_rand(2,10); |
| 54 | 54 |
$y = mt_rand(2,5); |
| 55 |
$_SESSION['captcha'.$sec_id] = $x * $y;
|
|
| 56 |
$cap = "$x*$y";
|
|
| 55 |
$_SESSION['captcha'.$sec_id] = $x * $y; |
|
| 56 |
$cap = "$x*$y"; |
|
| 57 | 57 |
break; |
| 58 | 58 |
} |
| 59 | 59 |
|
| ... | ... | |
| 71 | 71 |
$y1 = mt_rand(0,30); |
| 72 | 72 |
$x2 = mt_rand(0,120); |
| 73 | 73 |
$y2 = mt_rand(0,30); |
| 74 |
imageline($image, $x1, $y1, $x2, $y2 , $gray);
|
|
| 74 |
imageline($image, $x1, $y1, $x2, $y2 , $gray); |
|
| 75 | 75 |
} |
| 76 | 76 |
|
| 77 | 77 |
$x = 10; |
| ... | ... | |
| 79 | 79 |
for($i = 0; $i < $l; $i++) {
|
| 80 | 80 |
$fnt = mt_rand(3,5); |
| 81 | 81 |
$x = $x + mt_rand(12 , 20); |
| 82 |
$y = mt_rand(7 , 12);
|
|
| 83 |
imagestring($image, $fnt, $x, $y, substr($cap, $i, 1), $darkgray);
|
|
| 82 |
$y = mt_rand(7 , 12); |
|
| 83 |
imagestring($image, $fnt, $x, $y, substr($cap, $i, 1), $darkgray); |
|
| 84 | 84 |
} |
| 85 | 85 |
|
| 86 | 86 |
imagealphablending($reload, TRUE); |
| ... | ... | |
| 94 | 94 |
captcha_header(); |
| 95 | 95 |
imagepng($image); |
| 96 | 96 |
imagedestroy($image); |
| 97 |
|
|
| 98 |
?> |
|
| branches/2.8.x/wb/include/captcha/captchas/text.php | ||
|---|---|---|
| 93 | 93 |
$_SESSION['captcha'.$sec_id] = $qa[$lang][$k]; |
| 94 | 94 |
|
| 95 | 95 |
echo $k; |
| 96 |
|
|
| 97 |
?> |
|
| branches/2.8.x/wb/include/captcha/captchas/calc_text.php | ||
|---|---|---|
| 42 | 42 |
$x = mt_rand(1,9); |
| 43 | 43 |
$y = mt_rand(1,9); |
| 44 | 44 |
$_SESSION['captcha'.$sec_id] = $x + $y; |
| 45 |
$cap = "$x {$MOD_CAPTCHA['ADDITION']} $y";
|
|
| 46 |
break;
|
|
| 45 |
$cap = "$x {$MOD_CAPTCHA['ADDITION']} $y";
|
|
| 46 |
break; |
|
| 47 | 47 |
case 2: |
| 48 | 48 |
$x = mt_rand(10,20); |
| 49 | 49 |
$y = mt_rand(1,9); |
| 50 |
$_SESSION['captcha'.$sec_id] = $x - $y;
|
|
| 51 |
$cap = "$x {$MOD_CAPTCHA['SUBTRAKTION']} $y";
|
|
| 50 |
$_SESSION['captcha'.$sec_id] = $x - $y; |
|
| 51 |
$cap = "$x {$MOD_CAPTCHA['SUBTRAKTION']} $y";
|
|
| 52 | 52 |
break; |
| 53 | 53 |
case 3: |
| 54 | 54 |
$x = mt_rand(2,10); |
| 55 | 55 |
$y = mt_rand(2,5); |
| 56 |
$_SESSION['captcha'.$sec_id] = $x * $y;
|
|
| 57 |
$cap = "$x {$MOD_CAPTCHA['MULTIPLIKATION']} $y";
|
|
| 56 |
$_SESSION['captcha'.$sec_id] = $x * $y; |
|
| 57 |
$cap = "$x {$MOD_CAPTCHA['MULTIPLIKATION']} $y";
|
|
| 58 | 58 |
break; |
| 59 | 59 |
} |
| 60 | 60 |
echo $cap; |
| 61 |
?> |
|
| branches/2.8.x/wb/admin/interface/version.php | ||
|---|---|---|
| 51 | 51 |
|
| 52 | 52 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
| 53 | 53 |
if(!defined('VERSION')) define('VERSION', '2.8.3');
|
| 54 |
if(!defined('REVISION')) define('REVISION', '1692');
|
|
| 54 |
if(!defined('REVISION')) define('REVISION', '1693');
|
|
| 55 | 55 |
if(!defined('SP')) define('SP', '');
|
| branches/2.8.x/wb/modules/captcha_control/info.php | ||
|---|---|---|
| 4 | 4 |
* @category modules |
| 5 | 5 |
* @package captcha_control |
| 6 | 6 |
* @author WebsiteBaker Project |
| 7 |
* @copyright 2009-2011, Website Baker Org. e.V.
|
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
|
| 8 | 8 |
* @link http://www.websitebaker2.org/ |
| 9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 10 | 10 |
* @platform WebsiteBaker 2.8.x |
| ... | ... | |
| 20 | 20 |
if(defined('WB_PATH') == false)
|
| 21 | 21 |
{
|
| 22 | 22 |
// Stop this file being access directly |
| 23 |
die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
|
|
| 23 |
die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
|
|
| 24 | 24 |
} |
| 25 | 25 |
/* -------------------------------------------------------- */ |
| 26 | 26 |
$module_directory = 'captcha_control'; |
| 27 |
$module_name = 'Captcha and Advanced-Spam-Protection (ASP) Control';
|
|
| 27 |
$module_name = 'Spam-Protection Control';
|
|
| 28 | 28 |
$module_function = 'tool'; |
| 29 | 29 |
$module_version = '1.2.0'; |
| 30 | 30 |
$module_platform = '2.7 | 2.8.x'; |
Also available in: Unified diff