aboutsummaryrefslogtreecommitdiff
path: root/pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff
blob: a8589c715f099a7fca8b065ac7efbef445c7f248 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- a/bugnote_add_inc.php	2018-02-10 21:29:27.000000000 +0100
+++ b/bugnote_add_inc.php	2018-03-03 15:14:27.332428557 +0100
@@ -119,6 +119,49 @@
 					<textarea name="bugnote_text" id="bugnote_text" class="<?php echo $t_bugnote_class ?>" rows="7"></textarea>
 				</td>
 			</tr>
+<?php
+	# captcha image requires GD library and related option to ON
+	if( current_user_is_anonymous() && get_gd_version() > 0 ) {
+		$t_securimage_path = 'vendor/dapphp/securimage';
+		$t_securimage_show = $t_securimage_path . '/securimage_show.php';
+		$t_securimage_play = $t_securimage_path . '/securimage_play.swf?'
+			. http_build_query( array(
+				'audio_file' => $t_securimage_path . '/securimage_play.php',
+				'bgColor1=' => '#fff',
+				'bgColor2=' => '#fff',
+				'iconColor=' => '#777',
+				'borderWidth=' => 1,
+				'borderColor=' => '#000',
+			) );
+?>
+	<tr>
+		<th class="category">CAPTCHA</th>
+		<td>
+
+				<label for="captcha-field" class="block clearfix">
+					<strong><?php echo lang_get( 'signup_captcha_request_label' ); ?></strong>
+				</label>
+				<span id="captcha-input" class="input">
+					<?php print_captcha_input( 'captcha' ); ?>
+
+					<span id="captcha-image" class="captcha-image" style="padding-right:3px;">
+						<img src="<?php echo $t_securimage_show; ?>" alt="visual captcha" />
+						<ul id="captcha-refresh"><li><a href="#"><?php
+							echo lang_get( 'signup_captcha_refresh' );
+						?></a></li></ul>
+					</span>
+
+					<object type="application/x-shockwave-flash" width="19" height="19"
+						data="<?php echo $t_securimage_play; ?>">
+						<param name="movie" value="<?php echo $t_securimage_play; ?>" />
+					</object>
+				</span>
+                </td>
+        </tr>
+<?php
+			}
+?>
+
 
 <?php
 	if( config_get( 'time_tracking_enabled' ) ) {