Revision 624
Added by thorn over 17 years ago
| captcha.php | ||
|---|---|---|
| 61 | 61 |
'calc_image'=>$MOD_CAPTCHA_CONTROL['CALC_IMAGE'], |
| 62 | 62 |
'calc_ttf_image'=>$MOD_CAPTCHA_CONTROL['CALC_TTF_IMAGE'], |
| 63 | 63 |
'ttf_image'=>$MOD_CAPTCHA_CONTROL['TTF_IMAGE'], |
| 64 |
'old_image'=>$MOD_CAPTCHA_CONTROL['OLD_IMAGE'] |
|
| 64 |
'old_image'=>$MOD_CAPTCHA_CONTROL['OLD_IMAGE'], |
|
| 65 |
'text'=>$MOD_CAPTCHA_CONTROL['TEXT'] |
|
| 65 | 66 |
); |
| 66 | 67 |
} elseif(extension_loaded('gd') && function_exists('imagepng')) {
|
| 67 | 68 |
$useable_captchas = array( |
| 68 | 69 |
'calc_text'=>$MOD_CAPTCHA_CONTROL['CALC_TEXT'], |
| 69 | 70 |
'calc_image'=>$MOD_CAPTCHA_CONTROL['CALC_IMAGE'], |
| 70 |
'old_image'=>$MOD_CAPTCHA_CONTROL['OLD_IMAGE'] |
|
| 71 |
'old_image'=>$MOD_CAPTCHA_CONTROL['OLD_IMAGE'], |
|
| 72 |
'text'=>$MOD_CAPTCHA_CONTROL['TEXT'] |
|
| 71 | 73 |
); |
| 72 | 74 |
} else {
|
| 73 | 75 |
$useable_captchas = array( |
| 74 |
'calc_text'=>$MOD_CAPTCHA_CONTROL['CALC_TEXT'] |
|
| 76 |
'calc_text'=>$MOD_CAPTCHA_CONTROL['CALC_TEXT'], |
|
| 77 |
'text'=>$MOD_CAPTCHA_CONTROL['TEXT'] |
|
| 75 | 78 |
); |
| 76 | 79 |
} |
| 77 | 80 |
|
| ... | ... | |
| 82 | 85 |
$_SESSION['captcha_time'] = $t; |
| 83 | 86 |
|
| 84 | 87 |
switch(CAPTCHA_TYPE) {
|
| 88 |
// one special case |
|
| 89 |
case 'text': // text-captcha |
|
| 90 |
?><table class="captcha_table"><tr> |
|
| 91 |
<td class="text_captcha"><?php include(WB_PATH.'/include/captcha/captchas/text.php'); ?></td> |
|
| 92 |
<td><input type="text" name="captcha" maxlength="10" style="width:70px" /></td> |
|
| 93 |
<td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_QUEST']; ?></td> |
|
| 94 |
</tr></table><?php |
|
| 95 |
break; |
|
| 85 | 96 |
// two special cases |
| 86 | 97 |
case 'calc_text': // calculation as text |
| 87 | 98 |
?><table class="captcha_table"><tr> |
| 88 |
<td><?php include(WB_PATH.'/include/captcha/captchas/calc_text.php'); ?> = </td> |
|
| 99 |
<td class="text_captcha"><?php include(WB_PATH.'/include/captcha/captchas/calc_text.php'); ?> = </td>
|
|
| 89 | 100 |
<td><input type="text" name="captcha" maxlength="5" style="width:20px" /></td> |
| 90 | 101 |
<td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_RES']; ?></td> |
| 91 | 102 |
</tr></table><?php |
| 92 | 103 |
break; |
| 93 | 104 |
case 'calc_image': // calculation with image (old captcha) |
| 94 | 105 |
?><table class="captcha_table"><tr> |
| 95 |
<td><img src="<?php echo WB_URL."/include/captcha/captchas/calc_image.php?t=$t"; ?>" alt="Captcha" /></td><td> = </td> |
|
| 106 |
<td class="image_captcha"><img src="<?php echo WB_URL."/include/captcha/captchas/calc_image.php?t=$t"; ?>" alt="Captcha" /></td><td> = </td>
|
|
| 96 | 107 |
<td><input type="text" name="captcha" maxlength="5" style="width:20px" /></td> |
| 97 | 108 |
<td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_RES']; ?></td> |
| 98 | 109 |
</tr></table><?php |
| ... | ... | |
| 102 | 113 |
case 'calc_ttf_image': // calculation with varying background and ttf-font |
| 103 | 114 |
case 'old_image': // old captcha |
| 104 | 115 |
?><table class="captcha_table"><tr> |
| 105 |
<td><img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t"; ?>" alt="Captcha" /></td> |
|
| 116 |
<td class="image_captcha"><img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t"; ?>" alt="Captcha" /></td>
|
|
| 106 | 117 |
<td><input type="text" name="captcha" maxlength="5" style="width:50px" /></td> |
| 107 | 118 |
<td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_TEXT']; ?></td> |
| 108 | 119 |
</tr></table><?php |
Also available in: Unified diff
Added Text-CAPTCHA on request. The captcha-text will be stored in temp/.captcha_text.txt