From 43dac87fef530d52961cb7df5fdb01aa651d802c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 6 May 2019 14:06:31 +0200 Subject: Migrate mantisbt to pkgs --- pkgs/webapps/default.nix | 8 ++++ pkgs/webapps/mantisbt_2/bug_report.php.diff | 20 ++++++++ pkgs/webapps/mantisbt_2/bug_report_page.php.diff | 53 ++++++++++++++++++++++ pkgs/webapps/mantisbt_2/bugnote_add.php.diff | 20 ++++++++ pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff | 52 +++++++++++++++++++++ pkgs/webapps/mantisbt_2/default.nix | 39 ++++++++++++++++ pkgs/webapps/mantisbt_2/plugins/slack/default.nix | 18 ++++++++ .../plugins/source-integration/Source.API.php.diff | 12 +++++ .../plugins/source-integration/default.nix | 21 +++++++++ 9 files changed, 243 insertions(+) create mode 100644 pkgs/webapps/mantisbt_2/bug_report.php.diff create mode 100644 pkgs/webapps/mantisbt_2/bug_report_page.php.diff create mode 100644 pkgs/webapps/mantisbt_2/bugnote_add.php.diff create mode 100644 pkgs/webapps/mantisbt_2/bugnote_add_inc.php.diff create mode 100644 pkgs/webapps/mantisbt_2/default.nix create mode 100644 pkgs/webapps/mantisbt_2/plugins/slack/default.nix create mode 100644 pkgs/webapps/mantisbt_2/plugins/source-integration/Source.API.php.diff create mode 100644 pkgs/webapps/mantisbt_2/plugins/source-integration/default.nix (limited to 'pkgs') 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 { phpldapadmin = callPackage ./phpldapadmin {}; rompr = callPackage ./rompr { inherit mylibs; }; + + mantisbt_2 = callPackage ./mantisbt_2 {}; + mantisbt_2-with-plugins = mantisbt_2.withPlugins (builtins.attrValues mantisbt_2-plugins); + mantisbt_2-plugins = let + names = [ "slack" "source-integration" ]; + in + lib.attrsets.genAttrs names + (name: callPackage (./mantisbt_2/plugins + "/${name}") {}); } 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 @@ +--- a/bug_report.php 2019-05-06 12:06:44.265508011 +0200 ++++ b/bug_report.php 2019-05-06 12:09:40.106952738 +0200 +@@ -67,6 +67,17 @@ + 'copy_files' => $f_copy_attachments_from_parent + ); + ++# begin captcha check for anon user ++if ( current_user_is_anonymous() && get_gd_version() > 0 ) { ++ $f_captcha = gpc_get_string( 'captcha', '' ); ++ $f_captcha = utf8_strtolower( trim( $f_captcha ) ); ++ ++ $t_securimage = new Securimage(); ++ if( $t_securimage->check( $f_captcha ) == false ) { ++ trigger_error( ERROR_SIGNUP_NOT_MATCHING_CAPTCHA, ERROR ); ++ } ++} ++ + if( $f_master_bug_id > 0 ) { + bug_ensure_exists( $f_master_bug_id ); + 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 @@ +--- a/bug_report_page.php 2018-02-10 21:29:27.000000000 +0100 ++++ b/bug_report_page.php 2018-03-03 15:04:19.622499678 +0100 +@@ -708,7 +708,50 @@ + + + + ++ 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', ++ ) ); ++?> ++ ++ CAPTCHA ++ ++ ++ ++ ++ ++ ++ ++ visual captcha ++
++
++ ++ ++ ++ ++
++ ++ ++ ++ + + + 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 @@ +--- a/bugnote_add.php 2018-02-10 21:29:27.000000000 +0100 ++++ b/bugnote_add.php 2018-03-03 15:13:12.439919511 +0100 +@@ -44,6 +44,17 @@ + + $t_query = array( 'issue_id' => $f_bug_id ); + ++# begin captcha check for anon user ++if ( current_user_is_anonymous() && get_gd_version() > 0 ) { ++ $f_captcha = gpc_get_string( 'captcha', '' ); ++ $f_captcha = utf8_strtolower( trim( $f_captcha ) ); ++ ++ $t_securimage = new Securimage(); ++ if( $t_securimage->check( $f_captcha ) == false ) { ++ trigger_error( ERROR_SIGNUP_NOT_MATCHING_CAPTCHA, ERROR ); ++ } ++} ++ + if( count( $f_files ) > 0 && is_blank( $f_text ) && helper_duration_to_minutes( $f_duration ) == 0 ) { + $t_payload = array( + '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 @@ +--- 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 @@ + + + ++ 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', ++ ) ); ++?> ++ ++ CAPTCHA ++ ++ ++ ++ ++ ++ ++ ++ visual captcha ++
++
++ ++ ++ ++ ++
++ ++ ++ ++ + + $t_changeset ) { ++ event_signal( 'EVENT_BUG_ACTION', array('RESOLVE', $t_bug_id) ); ++ } + } + + /** 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 @@ +{ stdenv, fetchFromGitHub }: +stdenv.mkDerivation rec { + version = "v2.2.0"; + name = "mantisbt-plugin-source-integration-${version}"; + src = fetchFromGitHub { + owner = "mantisbt-plugins"; + repo = "source-integration"; + rev = "44fc9e2e770aff4f40f56833f26a86ce0e2deb76"; + sha256 = "0gcm6kqqijnv303sk59zn27adwx5vkr545mwzyaq2nrpxnkwdy5b"; + }; + patches = [ + ./Source.API.php.diff + ]; + installPhase = '' + mkdir $out + cp -a Source* $out/ + ''; + passthru = { + selector = "Source*"; + }; +} -- cgit v1.2.3