aboutsummaryrefslogtreecommitdiff
path: root/flakes/mypackages/pkgs/webapps/mantisbt_2
diff options
context:
space:
mode:
Diffstat (limited to 'flakes/mypackages/pkgs/webapps/mantisbt_2')
-rw-r--r--flakes/mypackages/pkgs/webapps/mantisbt_2/bug_report.php.diff20
-rw-r--r--flakes/mypackages/pkgs/webapps/mantisbt_2/bug_report_page.php.diff53
-rw-r--r--flakes/mypackages/pkgs/webapps/mantisbt_2/bugnote_add.php.diff20
-rw-r--r--flakes/mypackages/pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff52
-rw-r--r--flakes/mypackages/pkgs/webapps/mantisbt_2/default.nix44
-rw-r--r--flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/slack/default.nix18
-rw-r--r--flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/source-integration/Source.API.php.diff12
-rw-r--r--flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix22
8 files changed, 241 insertions, 0 deletions
diff --git a/flakes/mypackages/pkgs/webapps/mantisbt_2/bug_report.php.diff b/flakes/mypackages/pkgs/webapps/mantisbt_2/bug_report.php.diff
new file mode 100644
index 0000000..2924252
--- /dev/null
+++ b/flakes/mypackages/pkgs/webapps/mantisbt_2/bug_report.php.diff
@@ -0,0 +1,20 @@
1--- a/bug_report.php 2019-05-06 12:06:44.265508011 +0200
2+++ b/bug_report.php 2019-05-06 12:09:40.106952738 +0200
3@@ -67,6 +67,17 @@
4 'copy_files' => $f_copy_attachments_from_parent
5 );
6
7+# begin captcha check for anon user
8+if ( current_user_is_anonymous() && get_gd_version() > 0 ) {
9+ $f_captcha = gpc_get_string( 'captcha', '' );
10+ $f_captcha = utf8_strtolower( trim( $f_captcha ) );
11+
12+ $t_securimage = new Securimage();
13+ if( $t_securimage->check( $f_captcha ) == false ) {
14+ trigger_error( ERROR_SIGNUP_NOT_MATCHING_CAPTCHA, ERROR );
15+ }
16+}
17+
18 if( $f_master_bug_id > 0 ) {
19 bug_ensure_exists( $f_master_bug_id );
20
diff --git a/flakes/mypackages/pkgs/webapps/mantisbt_2/bug_report_page.php.diff b/flakes/mypackages/pkgs/webapps/mantisbt_2/bug_report_page.php.diff
new file mode 100644
index 0000000..80dea91
--- /dev/null
+++ b/flakes/mypackages/pkgs/webapps/mantisbt_2/bug_report_page.php.diff
@@ -0,0 +1,53 @@
1--- a/bug_report_page.php 2018-02-10 21:29:27.000000000 +0100
2+++ b/bug_report_page.php 2018-03-03 15:04:19.622499678 +0100
3@@ -708,7 +708,50 @@
4 <span class="lbl padding-6"><?php echo lang_get( 'check_report_more_bugs' ) ?></span>
5 </label>
6 </td>
7 </tr>
8+<?php
9+ # captcha image requires GD library and related option to ON
10+ if( current_user_is_anonymous() && get_gd_version() > 0 ) {
11+ $t_securimage_path = 'vendor/dapphp/securimage';
12+ $t_securimage_show = $t_securimage_path . '/securimage_show.php';
13+ $t_securimage_play = $t_securimage_path . '/securimage_play.swf?'
14+ . http_build_query( array(
15+ 'audio_file' => $t_securimage_path . '/securimage_play.php',
16+ 'bgColor1=' => '#fff',
17+ 'bgColor2=' => '#fff',
18+ 'iconColor=' => '#777',
19+ 'borderWidth=' => 1,
20+ 'borderColor=' => '#000',
21+ ) );
22+?>
23+ <tr>
24+ <th class="category">CAPTCHA</th>
25+ <td>
26+
27+ <label for="captcha-field" class="block clearfix">
28+ <strong><?php echo lang_get( 'signup_captcha_request_label' ); ?></strong>
29+ </label>
30+ <span id="captcha-input" class="input">
31+ <?php print_captcha_input( 'captcha' ); ?>
32+
33+ <span id="captcha-image" class="captcha-image" style="padding-right:3px;">
34+ <img src="<?php echo $t_securimage_show; ?>" alt="visual captcha" />
35+ <ul id="captcha-refresh"><li><a href="#"><?php
36+ echo lang_get( 'signup_captcha_refresh' );
37+ ?></a></li></ul>
38+ </span>
39+
40+ <object type="application/x-shockwave-flash" width="19" height="19"
41+ data="<?php echo $t_securimage_play; ?>">
42+ <param name="movie" value="<?php echo $t_securimage_play; ?>" />
43+ </object>
44+ </span>
45+ </td>
46+ </tr>
47+<?php
48+ }
49+?>
50+
51 </table>
52 </div>
53 </div>
diff --git a/flakes/mypackages/pkgs/webapps/mantisbt_2/bugnote_add.php.diff b/flakes/mypackages/pkgs/webapps/mantisbt_2/bugnote_add.php.diff
new file mode 100644
index 0000000..4509f0a
--- /dev/null
+++ b/flakes/mypackages/pkgs/webapps/mantisbt_2/bugnote_add.php.diff
@@ -0,0 +1,20 @@
1--- a/bugnote_add.php 2018-02-10 21:29:27.000000000 +0100
2+++ b/bugnote_add.php 2018-03-03 15:13:12.439919511 +0100
3@@ -44,6 +44,17 @@
4
5 $t_query = array( 'issue_id' => $f_bug_id );
6
7+# begin captcha check for anon user
8+if ( current_user_is_anonymous() && get_gd_version() > 0 ) {
9+ $f_captcha = gpc_get_string( 'captcha', '' );
10+ $f_captcha = utf8_strtolower( trim( $f_captcha ) );
11+
12+ $t_securimage = new Securimage();
13+ if( $t_securimage->check( $f_captcha ) == false ) {
14+ trigger_error( ERROR_SIGNUP_NOT_MATCHING_CAPTCHA, ERROR );
15+ }
16+}
17+
18 if( count( $f_files ) > 0 && is_blank( $f_text ) && helper_duration_to_minutes( $f_duration ) == 0 ) {
19 $t_payload = array(
20 'files' => helper_array_transpose( $f_files )
diff --git a/flakes/mypackages/pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff b/flakes/mypackages/pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff
new file mode 100644
index 0000000..a8589c7
--- /dev/null
+++ b/flakes/mypackages/pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff
@@ -0,0 +1,52 @@
1--- a/bugnote_add_inc.php 2018-02-10 21:29:27.000000000 +0100
2+++ b/bugnote_add_inc.php 2018-03-03 15:14:27.332428557 +0100
3@@ -119,6 +119,49 @@
4 <textarea name="bugnote_text" id="bugnote_text" class="<?php echo $t_bugnote_class ?>" rows="7"></textarea>
5 </td>
6 </tr>
7+<?php
8+ # captcha image requires GD library and related option to ON
9+ if( current_user_is_anonymous() && get_gd_version() > 0 ) {
10+ $t_securimage_path = 'vendor/dapphp/securimage';
11+ $t_securimage_show = $t_securimage_path . '/securimage_show.php';
12+ $t_securimage_play = $t_securimage_path . '/securimage_play.swf?'
13+ . http_build_query( array(
14+ 'audio_file' => $t_securimage_path . '/securimage_play.php',
15+ 'bgColor1=' => '#fff',
16+ 'bgColor2=' => '#fff',
17+ 'iconColor=' => '#777',
18+ 'borderWidth=' => 1,
19+ 'borderColor=' => '#000',
20+ ) );
21+?>
22+ <tr>
23+ <th class="category">CAPTCHA</th>
24+ <td>
25+
26+ <label for="captcha-field" class="block clearfix">
27+ <strong><?php echo lang_get( 'signup_captcha_request_label' ); ?></strong>
28+ </label>
29+ <span id="captcha-input" class="input">
30+ <?php print_captcha_input( 'captcha' ); ?>
31+
32+ <span id="captcha-image" class="captcha-image" style="padding-right:3px;">
33+ <img src="<?php echo $t_securimage_show; ?>" alt="visual captcha" />
34+ <ul id="captcha-refresh"><li><a href="#"><?php
35+ echo lang_get( 'signup_captcha_refresh' );
36+ ?></a></li></ul>
37+ </span>
38+
39+ <object type="application/x-shockwave-flash" width="19" height="19"
40+ data="<?php echo $t_securimage_play; ?>">
41+ <param name="movie" value="<?php echo $t_securimage_play; ?>" />
42+ </object>
43+ </span>
44+ </td>
45+ </tr>
46+<?php
47+ }
48+?>
49+
50
51 <?php
52 if( config_get( 'time_tracking_enabled' ) ) {
diff --git a/flakes/mypackages/pkgs/webapps/mantisbt_2/default.nix b/flakes/mypackages/pkgs/webapps/mantisbt_2/default.nix
new file mode 100644
index 0000000..466595d
--- /dev/null
+++ b/flakes/mypackages/pkgs/webapps/mantisbt_2/default.nix
@@ -0,0 +1,44 @@
1{ mantis_config ? "/etc/mantisbt/config_inc.php", stdenv, fetchurl, lib, callPackage}:
2let
3 pluginNames = [ "slack" "source-integration" ];
4 allPlugins = lib.attrsets.genAttrs pluginNames
5 (name: callPackage (./plugins + "/${name}") {});
6 toPassthru = pkg: plugins: {
7 inherit plugins allPlugins;
8 pluginNames = map (n: n.pluginName) plugins;
9 withPlugins = withPlugins pkg;
10 };
11 withPlugins = pkg: toPlugins:
12 let
13 plugins = toPlugins allPlugins;
14 toInstallPlugin = n:
15 if builtins.hasAttr "selector" n then
16 "ln -sf ${n}/${n.selector} $out/plugins/"
17 else
18 "ln -sf ${n} $out/plugins/${n.pluginName}";
19 newMantisbt = pkg.overrideAttrs(old: {
20 installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins);
21 passthru = toPassthru newMantisbt (pkg.plugins ++ plugins);
22 });
23 in newMantisbt;
24 package = stdenv.mkDerivation rec {
25 name = "mantisbt-${version}";
26 version = "2.21.0";
27 src = fetchurl {
28 url = "https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${version}/${name}.tar.gz";
29 sha256 = "13lx569dp1gibq5daqp7dj6gsqic85rrix1s7xkp60gwpzk8wiw5";
30 };
31 patches = [
32 ./bug_report.php.diff
33 ./bug_report_page.php.diff
34 ./bugnote_add.php.diff
35 ./bugnote_add_inc.php.diff
36 ];
37 installPhase = ''
38 cp -a . $out
39 ln -s ${mantis_config} $out/config/config_inc.php
40 '';
41
42 passthru = toPassthru package [];
43 };
44in package
diff --git a/flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/slack/default.nix b/flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/slack/default.nix
new file mode 100644
index 0000000..61ed15f
--- /dev/null
+++ b/flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/slack/default.nix
@@ -0,0 +1,18 @@
1{ stdenv, fetchFromGitHub }:
2stdenv.mkDerivation rec {
3 passthru = {
4 pluginName = "Slack";
5 };
6 version = "9286d2e-master";
7 name = "mantisbt-plugin-slack-${version}";
8 src = fetchFromGitHub {
9 owner = "mantisbt-plugins";
10 repo = "Slack";
11 rev = "9286d2eeeb8a986ed949e378711fef5f0bf182dc";
12 sha256 = "0nn0v4jc967giilkzrppi5svd04m2hnals75xxp0iabcdjnih0mn";
13 };
14 installPhase = ''
15 sed -i -e "s/return '@' . \\\$username;/return \\\$username;/" Slack.php
16 cp -a . $out
17 '';
18}
diff --git a/flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/source-integration/Source.API.php.diff b/flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/source-integration/Source.API.php.diff
new file mode 100644
index 0000000..c355144
--- /dev/null
+++ b/flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/source-integration/Source.API.php.diff
@@ -0,0 +1,12 @@
1--- b/Source/Source.API.php 2017-09-18 00:50:32.000000000 +0200
2+++ a/Source/Source.API.php 2018-03-04 19:00:25.578889039 +0100
3@@ -452,6 +452,9 @@
4 # Allow other plugins to post-process commit data
5 event_signal( 'EVENT_SOURCE_COMMITS', array( $p_changesets ) );
6 event_signal( 'EVENT_SOURCE_FIXED', array( $t_fixed_bugs ) );
7+ foreach( $t_fixed_bugs as $t_bug_id => $t_changeset ) {
8+ event_signal( 'EVENT_BUG_ACTION', array('RESOLVE', $t_bug_id) );
9+ }
10 }
11
12 /**
diff --git a/flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix b/flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix
new file mode 100644
index 0000000..1ab00c5
--- /dev/null
+++ b/flakes/mypackages/pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix
@@ -0,0 +1,22 @@
1{ stdenv, fetchFromGitHub }:
2stdenv.mkDerivation rec {
3 version = "v2.2.0";
4 name = "mantisbt-plugin-source-integration-${version}";
5 src = fetchFromGitHub {
6 owner = "mantisbt-plugins";
7 repo = "source-integration";
8 rev = "44fc9e2e770aff4f40f56833f26a86ce0e2deb76";
9 sha256 = "0gcm6kqqijnv303sk59zn27adwx5vkr545mwzyaq2nrpxnkwdy5b";
10 };
11 patches = [
12 ./Source.API.php.diff
13 ];
14 installPhase = ''
15 mkdir $out
16 cp -a Source* $out/
17 '';
18 passthru = {
19 pluginName = "source-integration";
20 selector = "Source*";
21 };
22}