Revision 867
Added by thorn about 17 years ago
| captcha.php | ||
|---|---|---|
| 31 | 31 |
?><a title="reload" href="<?php echo WB_URL.'/include/captcha/captcha.php?display_captcha_X986E21=2'; ?>"> |
| 32 | 32 |
<img style="border: none;" src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t"; ?>" alt="Captcha" /> |
| 33 | 33 |
</a><?php |
| 34 |
} elseif($kind=='text') {
|
|
| 35 |
?><a style="text-decoration:none;" title="reload" href="<?php echo WB_URL.'/include/captcha/captcha.php?display_captcha_X986E21=2'; ?>"><?php |
|
| 36 |
include(WB_PATH.'/include/captcha/captchas/'.CAPTCHA_TYPE.'.php'); |
|
| 37 |
?></a><?php |
|
| 38 | 34 |
} else {
|
| 39 | 35 |
echo 'error'; |
| 40 | 36 |
} |
| ... | ... | |
| 44 | 40 |
if(isset($_GET['display_captcha_X986E21'])) {
|
| 45 | 41 |
require('../../config.php');
|
| 46 | 42 |
switch(CAPTCHA_TYPE) {
|
| 47 |
case 'text': |
|
| 48 |
case 'calc_text': |
|
| 49 |
display_captcha_real('text');
|
|
| 50 |
break; |
|
| 51 | 43 |
case 'calc_image': |
| 52 | 44 |
case 'calc_ttf_image': |
| 53 | 45 |
case 'ttf_image': |
| ... | ... | |
| 115 | 107 |
$t = time(); |
| 116 | 108 |
$_SESSION['captcha_time'] = $t; |
| 117 | 109 |
|
| 118 |
// get width and height of captcha image or text for use in <iframe>
|
|
| 110 |
// get width and height of captcha image for use in <iframe> |
|
| 119 | 111 |
switch(CAPTCHA_TYPE) {
|
| 120 |
case 'text': |
|
| 121 |
$captcha_width = 250; |
|
| 122 |
$captcha_height = 100; |
|
| 123 |
break; |
|
| 124 |
case 'calc_text': |
|
| 125 |
$captcha_width = 120; |
|
| 126 |
$captcha_height = 20; |
|
| 127 |
break; |
|
| 128 | 112 |
case 'calc_image': |
| 129 | 113 |
$captcha_width = 142; |
| 130 | 114 |
$captcha_height = 30; |
| ... | ... | |
| 148 | 132 |
|
| 149 | 133 |
if($action=='all') {
|
| 150 | 134 |
switch(CAPTCHA_TYPE) {
|
| 151 |
// one special case |
|
| 152 |
case 'text': // text-captcha - we don't use an <iframe> in this case |
|
| 135 |
case 'text': // text-captcha |
|
| 153 | 136 |
?><table class="captcha_table"><tr> |
| 154 | 137 |
<td class="text_captcha"> |
| 155 | 138 |
<?php include(WB_PATH.'/include/captcha/captchas/'.CAPTCHA_TYPE.'.php'); ?> |
| ... | ... | |
| 159 | 142 |
<td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_QUEST']; ?></td> |
| 160 | 143 |
</tr></table><?php |
| 161 | 144 |
break; |
| 162 |
// two special cases |
|
| 163 | 145 |
case 'calc_text': // calculation as text |
| 164 | 146 |
?><table class="captcha_table"><tr> |
| 165 | 147 |
<td class="text_captcha"> |
| 166 |
<iframe class="captcha_iframe" width="<?php echo $captcha_width; ?>" height="<?php echo $captcha_height; ?>" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" name="captcha_iframe" src="<?php echo WB_URL.'/include/captcha/captcha.php?display_captcha_X986E21=1'; ?>"> |
|
| 167 | 148 |
<?php include(WB_PATH.'/include/captcha/captchas/'.CAPTCHA_TYPE.'.php'); ?> |
| 168 |
</iframe> |
|
| 169 | 149 |
</td> |
| 170 | 150 |
<td> = </td> |
| 171 | 151 |
<td><input type="text" name="captcha" maxlength="10" style="width:20px;" /></td> |
| ... | ... | |
| 223 | 203 |
echo ($style?'</span>':''); |
| 224 | 204 |
break; |
| 225 | 205 |
case 'calc_text': // calculation as text |
| 226 |
?><iframe class="captcha_iframe" width="<?php echo $captcha_width; ?>" height="<?php echo $captcha_height; ?>" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" name="captcha_iframe" src="<?php echo WB_URL.'/include/captcha/captcha.php?display_captcha_X986E21=1'; ?>"><?php |
|
| 227 | 206 |
include(WB_PATH.'/include/captcha/captchas/'.CAPTCHA_TYPE.'.php'); |
| 228 |
?></iframe><?php |
|
| 229 | 207 |
break; |
| 230 | 208 |
case 'calc_image': // calculation with image (old captcha) |
| 231 | 209 |
case 'calc_ttf_image': // calculation with varying background and ttf-font |
Also available in: Unified diff
Captcha: removed IFRAME for Calculation-as-text captcha