aboutsummaryrefslogtreecommitdiff
path: root/pkgs/webapps/mantisbt_2
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 01:35:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 02:11:48 +0200
commit1a64deeb894dc95e2645a75771732c6cc53a79ad (patch)
tree1b9df4838f894577a09b9b260151756272efeb53 /pkgs/webapps/mantisbt_2
parentfa25ffd4583cc362075cd5e1b4130f33306103f0 (diff)
downloadNix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository
Diffstat (limited to 'pkgs/webapps/mantisbt_2')
-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.nix43
-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
8 files changed, 0 insertions, 239 deletions
diff --git a/pkgs/webapps/mantisbt_2/bug_report.php.diff b/pkgs/webapps/mantisbt_2/bug_report.php.diff
deleted file mode 100644
index 2924252..0000000
--- a/pkgs/webapps/mantisbt_2/bug_report.php.diff
+++ /dev/null
@@ -1,20 +0,0 @@
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
deleted file mode 100644
index 80dea91..0000000
--- a/pkgs/webapps/mantisbt_2/bug_report_page.php.diff
+++ /dev/null
@@ -1,53 +0,0 @@
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
deleted file mode 100644
index 4509f0a..0000000
--- a/pkgs/webapps/mantisbt_2/bugnote_add.php.diff
+++ /dev/null
@@ -1,20 +0,0 @@
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
deleted file mode 100644
index a8589c7..0000000
--- a/pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff
+++ /dev/null
@@ -1,52 +0,0 @@
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
deleted file mode 100644
index 5aa04d1..0000000
--- a/pkgs/webapps/mantisbt_2/default.nix
+++ /dev/null
@@ -1,43 +0,0 @@
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 withPlugins = withPlugins pkg;
9 };
10 withPlugins = pkg: toPlugins:
11 let
12 plugins = toPlugins allPlugins;
13 toInstallPlugin = n:
14 if builtins.hasAttr "selector" n then
15 "ln -sf ${n}/${n.selector} $out/plugins/"
16 else
17 "ln -sf ${n} $out/plugins/${n.pluginName}";
18 newMantisbt = pkg.overrideAttrs(old: {
19 installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins);
20 passthru = toPassthru newMantisbt (pkg.plugins ++ plugins);
21 });
22 in newMantisbt;
23 package = stdenv.mkDerivation rec {
24 name = "mantisbt-${version}";
25 version = "2.21.0";
26 src = fetchurl {
27 url = "https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${version}/${name}.tar.gz";
28 sha256 = "13lx569dp1gibq5daqp7dj6gsqic85rrix1s7xkp60gwpzk8wiw5";
29 };
30 patches = [
31 ./bug_report.php.diff
32 ./bug_report_page.php.diff
33 ./bugnote_add.php.diff
34 ./bugnote_add_inc.php.diff
35 ];
36 installPhase = ''
37 cp -a . $out
38 ln -s ${mantis_config} $out/config/config_inc.php
39 '';
40
41 passthru = toPassthru package [];
42 };
43in package
diff --git a/pkgs/webapps/mantisbt_2/plugins/slack/default.nix b/pkgs/webapps/mantisbt_2/plugins/slack/default.nix
deleted file mode 100644
index 61ed15f..0000000
--- a/pkgs/webapps/mantisbt_2/plugins/slack/default.nix
+++ /dev/null
@@ -1,18 +0,0 @@
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
deleted file mode 100644
index c355144..0000000
--- a/pkgs/webapps/mantisbt_2/plugins/source-integration/Source.API.php.diff
+++ /dev/null
@@ -1,12 +0,0 @@
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
deleted file mode 100644
index dc6c7de..0000000
--- a/pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
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}