View Issue Details

IDProjectCategoryView StatusLast Update
0009463mantisbtintegrationpublic2010-09-19 03:11
Reportershaddyz Assigned Todhx  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Product Version1.1.2 
Summary0009463: notifications sent when a note is added through VCS integration display www.example.com in the bug link
Description

i have integrated my version control server with mantis so that after someone commits, a note gets added to the specified issue. also, when notes are added to issues, i receive email notifications. when a note is added by the VCS, the link included in the notification email displays www.example.com for the host.

Additional Information

how integration is setup:
SVN post-commit script performs a wget to the server where mantis presides
custom php script parses the request and passes the information to the mantis vcs integration script: core/checkin.php

i believe this issue is due to the fact that config_defaults_inc.php determines $t_host by checking the $_SERVER variable which would not be initialized when mantis is accessed through the command line.

TagsNo tags attached.

Relationships

related to 0011732 closeddhx Remove built-in source code integration support 

Activities

jmoger

jmoger

2008-08-20 15:42

reporter   ~0019185

I have a similar issue.

I get the proper base url - http://www.something.com - But I then get the full local file path appended so the links look like:
http://www.something.comC:\www\root\mantis\core/view.php?id=2000

You can probably get rid of the www.example.com by adjusting your config_inc.php. There are 2 places in the config file where that is defined.

jmoger

jmoger

2008-08-20 16:13

reporter   ~0019186

If you get to the same point I described above then I might have the remaining solution for you. Also in config_inc.php, follow the logic for assigning the $t_path variable.

$t_path = dirname( strip_tags( $_SERVER['PHP_SELF'] ) );

This line is the culprit for my injected absolute file system path. I'm not sure what the proper code should be so I replaced it with the relative path for my install.

$t_path = '/mantis';

Voila!

eiben

eiben

2009-02-06 03:46

reporter   ~0020803

I encountered the same problem - but I do not recall wether this has always been so.

@jmoger: how did you get to the point of getting the correct base url? I'm calling scripts/checkin.php from the commandline from my sv-hook (Mantis 1.2.0a3).

nosek

nosek

2009-07-06 10:10

reporter   ~0022419

Guys,

I worked this problem around by changing the test in config_inc.php:
<code>
--- config_inc.php.bak 2009-07-06 12:28:40.000000000 +0200
+++ config_inc.php 2009-07-06 14:06:12.000000000 +0200
@@ -66,7 +66,7 @@

# path to your installation as seen from the web browser
# requires trailing /
  • if ( isset ( $_SERVER['PHP_SELF'] ) ) {
  • if ( isset ( $_SERVER['REQUEST_URI'] ) ) {
    $t_protocol = 'http';
    if ( isset( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) ) {
    $t_protocol = 'https';
    </code>

My mantis checkin.php is called by the SVN post-commit hook at the shell level, where $_SERVER['PHP_SELF'] would evaluate to something strange, i.e. filesystem path relative to the current working directory. $_SERVER['REQUEST_URI'], however, is undefined, and the final path is taken from the literal entry in config_inc.php.

No idea if this way is correct.

jonnieboy

jonnieboy

2009-08-14 11:06

reporter   ~0022731

I had this problem, see:

http://www.mantisbt.org/forums/viewtopic.php?f=3&t=7491&start=0

Then found this issue :)

My fix was to add $g_path 'http://<ourserver>/mantis' to config_inc.php.

dhx

dhx

2010-03-31 03:26

reporter   ~0024942

Won't fix as this old source code integration support is being dropped in favour of using a more modern plugin approach with the SourceIntegration plugin.

Refer to 0011732 for more details and feedback.