Project

General

Profile

« Previous | Next » 

Revision 1371

Added by Dietmar over 13 years ago

captcha patch (Tks to FrankH)

View differences:

captcha.php
24 24
*/
25 25

  
26 26
// displays the image or text inside an <iframe>
27
function display_captcha_real($kind='image') {
28
	$t = time();
29
	$_SESSION['captcha_time'] = $t;
30
	if($kind=='image') {
31
		?><a title="reload" href="<?php echo WB_URL.'/include/captcha/captcha.php?display_captcha_X986E21=2'; ?>">
32
		  <img style="border: none;" src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t"; ?>" alt="Captcha" />
33
			</a><?php
34
	} else {
35
		echo 'error';
27
if(!function_exists('display_captcha_real')) {
28
	function display_captcha_real($kind='image') {
29
		$t = time();
30
		$_SESSION['captcha_time'] = $t;
31
		$sec_id = '';
32
		if(isset($_GET['s']) && is_numeric($_GET['s'])) $sec_id = $_GET['s'];
33
		if($kind=='image') {
34
			?><a title="reload" href="<?php echo WB_URL.'/include/captcha/captcha.php?display_captcha_X986E21=2'; ?>">
35
			  <img style="border: none;" src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t&amp;s=$sec_id"; ?>" alt="Captcha" />
36
				</a><?php
37
		} else {
38
			echo 'error';
39
		}
36 40
	}
37 41
}
38 42

  
......
70 74
		header("Expires: Mon, 1 Jan 1990 05:00:00 GMT");
71 75
		header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
72 76
		header("Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate");
73
		header("Cache-Control: post-check=0, pre-check=0", false); // MS made there own headers :-(
74 77
		header("Pragma: no-cache");
75 78
		header("Content-type: image/png");
76 79
		return;
......
102 105
}
103 106

  
104 107
if(!function_exists('call_captcha')) {
105
	function call_captcha($action='all', $style='') {
108
	function call_captcha($action='all', $style='', $sec_id='') {
106 109
		global $MOD_CAPTCHA;
107 110
		$t = time();
108 111
		$_SESSION['captcha_time'] = $t;
......
156 159
				case 'calc_ttf_image': // calculation with varying background and ttf-font
157 160
				  ?><table class="captcha_table"><tr>
158 161
					<td class="image_captcha">
159
						<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'; ?>">
160
						<img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t"; ?>" alt="Captcha" />
162
						<?php echo "<iframe class=\"captcha_iframe\" width=\"$captcha_width\" height=\"$captcha_height\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" name=\"captcha_iframe_$sec_id\" src=\"". WB_URL ."/include/captcha/captcha.php?display_captcha_X986E21=1&amp;s=$sec_id"; ?>">
163
						<img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t&amp;s=$sec_id"; ?>" alt="Captcha" />
161 164
						</iframe>
162 165
					</td>
163 166
					<td>&nbsp;=&nbsp;</td>
......
170 173
				case 'old_image': // old captcha
171 174
					?><table class="captcha_table"><tr>
172 175
					<td class="image_captcha">
173
						<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'; ?>">
174
						<img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t"; ?>" alt="Captcha" />
176
						<?php echo "<iframe class=\"captcha_iframe\" width=\"$captcha_width\" height=\"$captcha_height\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" name=\"captcha_iframe_$sec_id\" src=\"". WB_URL ."/include/captcha/captcha.php?display_captcha_X986E21=1&amp;s=$sec_id"; ?>">
177
						<img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t&amp;s=$sec_id"; ?>" alt="Captcha" />
175 178
						</iframe>
176 179
					</td>
177 180
					<td></td>
......
192 195
				case 'calc_ttf_image': // calculation with varying background and ttf-font
193 196
				case 'ttf_image': // captcha with varying background and ttf-font
194 197
				case 'old_image': // old captcha
195
					echo "<img $style src=\"".WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t\" />";
198
					echo "<img $style src=\"".WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t&amp;s=$sec_id\" />";
196 199
					break;
197 200
			}
198 201
		} elseif($action=='image_iframe') {
......
209 212
				case 'calc_ttf_image': // calculation with varying background and ttf-font
210 213
				case 'ttf_image': // captcha with varying background and ttf-font
211 214
				case 'old_image': // old captcha
212
					?><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
215
					?>
216
					<?php echo "<iframe class=\"captcha_iframe\" width=\"$captcha_width\" height=\"$captcha_height\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" name=\"captcha_iframe_$sec_id\" src=\"". WB_URL ."/include/captcha/captcha.php?display_captcha_X986E21=1&amp;s=$sec_id"; ?>">
217
					<?php
213 218
					echo "<img $style alt=\"Captcha\" src=\"".WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t\" />";
214 219
					?></iframe><?php
215 220
					break;

Also available in: Unified diff