aboutsummaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/webapps/default.nix8
-rw-r--r--pkgs/webapps/mantisbt_2/bug_report.php.diff20
-rw-r--r--pkgs/webapps/mantisbt_2/bug_report_page.php.diff53
-rw-r--r--pkgs/webapps/mantisbt_2/bugnote_add.php.diff20
-rw-r--r--pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff52
-rw-r--r--pkgs/webapps/mantisbt_2/default.nix39
-rw-r--r--pkgs/webapps/mantisbt_2/plugins/slack/default.nix18
-rw-r--r--pkgs/webapps/mantisbt_2/plugins/source-integration/Source.API.php.diff12
-rw-r--r--pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix21
9 files changed, 243 insertions, 0 deletions
diff --git a/pkgs/webapps/default.nix b/pkgs/webapps/default.nix
index 50c3543..eb01a18 100644
--- a/pkgs/webapps/default.nix
+++ b/pkgs/webapps/default.nix
@@ -25,4 +25,12 @@ rec {
25 phpldapadmin = callPackage ./phpldapadmin {}; 25 phpldapadmin = callPackage ./phpldapadmin {};
26 26
27 rompr = callPackage ./rompr { inherit mylibs; }; 27 rompr = callPackage ./rompr { inherit mylibs; };
28
29 mantisbt_2 = callPackage ./mantisbt_2 {};
30 mantisbt_2-with-plugins = mantisbt_2.withPlugins (builtins.attrValues mantisbt_2-plugins);
31 mantisbt_2-plugins = let
32 names = [ "slack" "source-integration" ];
33 in
34 lib.attrsets.genAttrs names
35 (name: callPackage (./mantisbt_2/plugins + "/${name}") {});
28} 36}
diff --git a/pkgs/webapps/mantisbt_2/bug_report.php.diff b/pkgs/webapps/mantisbt_2/bug_report.php.diff
new file mode 100644
index 0000000..2924252
--- /dev/null
+++ b/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/pkgs/webapps/mantisbt_2/bug_report_page.php.diff b/pkgs/webapps/mantisbt_2/bug_report_page.php.diff
new file mode 100644
index 0000000..80dea91
--- /dev/null
+++ b/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/pkgs/webapps/mantisbt_2/bugnote_add.php.diff b/pkgs/webapps/mantisbt_2/bugnote_add.php.diff
new file mode 100644
index 0000000..4509f0a
--- /dev/null
+++ b/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/pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff b/pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff
new file mode 100644
index 0000000..a8589c7
--- /dev/null
+++ b/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/pkgs/webapps/mantisbt_2/default.nix b/pkgs/webapps/mantisbt_2/default.nix
new file mode 100644
index 0000000..3283a01
--- /dev/null
+++ b/pkgs/webapps/mantisbt_2/default.nix
@@ -0,0 +1,39 @@
1{ mantis_config ? "/etc/mantisbt/config_inc.php", stdenv, fetchurl }:
2let
3 withPlugins = plugins: package.overrideAttrs(old: {
4 name = "${old.name}-with-plugins";
5 installPhase = old.installPhase + (
6 builtins.concatStringsSep "\n" (
7 map (value: if builtins.hasAttr "selector" value then
8 "ln -sf ${value}/${value.selector} $out/plugins/"
9 else
10 "ln -sf ${value} $out/plugins/${value.pluginName}"
11 ) plugins
12 ));
13 passthru.plugins = plugins;
14 passthru.withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins);
15 });
16 package = stdenv.mkDerivation rec {
17 name = "mantisbt-${version}";
18 version = "2.21.0";
19 src = fetchurl {
20 url = "https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${version}/${name}.tar.gz";
21 sha256 = "13lx569dp1gibq5daqp7dj6gsqic85rrix1s7xkp60gwpzk8wiw5";
22 };
23 patches = [
24 ./bug_report.php.diff
25 ./bug_report_page.php.diff
26 ./bugnote_add.php.diff
27 ./bugnote_add_inc.php.diff
28 ];
29 installPhase = ''
30 cp -a . $out
31 ln -s ${mantis_config} $out/config/config_inc.php
32 '';
33
34 passthru = {
35 plugins = [];
36 inherit withPlugins;
37 };
38 };
39in package
diff --git a/pkgs/webapps/mantisbt_2/plugins/slack/default.nix b/pkgs/webapps/mantisbt_2/plugins/slack/default.nix
new file mode 100644
index 0000000..61ed15f
--- /dev/null
+++ b/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/pkgs/webapps/mantisbt_2/plugins/source-integration/Source.API.php.diff b/pkgs/webapps/mantisbt_2/plugins/source-integration/Source.API.php.diff
new file mode 100644
index 0000000..c355144
--- /dev/null
+++ b/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/pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix b/pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix
new file mode 100644
index 0000000..dc6c7de
--- /dev/null
+++ b/pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix
@@ -0,0 +1,21 @@
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 selector = "Source*";
20 };
21}