PDA

View Full Version : Mantis Integration


execute
11-04-07, 11:46 PM
Mantis Integration (http://sourceforge.net/tracker/index.php?func=detail&aid=1698458&group_id=70930&atid=529515)

My employer (http://www.mgtraining.com) asked me to make a Mantis Integration module. I've picked this one (http://www.dotproject.net/vbulletin/showthread.php?t=5334) as starting point but unfortunately stated that it:
- lacks much on security
- ignores mantis user levels
- is only suitable for 3 to 5 men teams.

So, I've used it only as a basis for development and here is the result.

Support will flow through SF and this forum.

execute
14-04-07, 02:22 AM
I've just completed development on a second release of this module - it is much sexier now. :)

I will upload it to SourceForge this weekend, because documentation is not ready yet and it is really needed, because unfortunately I had to hack one core file - do_project_aed.php (I am in desperate need of custom presave functions and possibilities)

Anyway, here are 3 screenshots.

1 (http://www.picvalley.net/v.php?p=u/12/2764_990.JPG),2 (http://www.picvalley.net/v.php?p=u/12/2767_012.JPG) and 3 (http://www.picvalley.net/v.php?p=u/12/2772_215.JPG)

P.S. Upon request I could mail the new version to people, who are sure of their skills and who would test with me :)

execute
18-04-07, 08:09 PM
I have just updated the documentation and the release of the module. It is also added in the CVS.

The module has been updated and split into two different branches: one,
that requires a simple modification of one core file, and another one, that
does not require such a thing.

Please refer to the documentation included in this release before using
the module.
File Added: mantis.integration_20070418.zip


Plase, visit SourceForge (http://sourceforge.net/tracker/index.php?func=detail&aid=1698458&group_id=70930&atid=529515) to download.

zman
21-04-07, 12:16 AM
Thank you for all your work.

I have downloaded and installed per the instruction however when I click on the Mantis Tab in dP I get the following error messages:

Warning: main(../../../xmlrpc/PHPXMLRPC/client.php) [function.main]: failed to open stream: No such file or directory in /homepages/30/d202172128/htdocs/dotproject/modules/mantis/mantis.config.php on line 3

Fatal error: main() [function.require]: Failed opening required '../../../xmlrpc/PHPXMLRPC/client.php' (include_path='.:/usr/local/lib/php') in /homepages/30/d202172128/htdocs/dotproject/modules/mantis/mantis.config.php on line 3

I have the same project name in dP and Mantis.
I have the same logon name and password in each.

I am new to php but am very eager to test this.

Thanks in advance!

Scott

execute
22-04-07, 04:54 AM
Zman, thank you for your interest in this module.

This error means that you have to fix the paths in "mantis.config.php" and probably in "dpconfig.php".
- "../" means go one directory level up
- "../../" means go two directory levels up

The number of levels that you have to go up depends on the working directory of the running script. In dotProject everything runs through one central index.php which is in the root dP folder. This means that you have to go only one level up if you have the folder structure as given below:

htdocs/
dotproject/modules/mantis/*.*
mantis/xmlrpc/dotproject/*.*
xmlrpc/PHPXMLRPC/*.*

So, please try this:
mantis.config.php
require_once("../xmlrpc/PHPXMLRPC/client.php");

dpconfig.php
require_once("../../../xmlrpc/PHPXMLRPC/server.php");

Greetings

zman
23-04-07, 10:40 PM
Thank you for the response.

That worked for me!

zman
23-04-07, 11:06 PM
Now that we have this working we have realized a limitation of the way we use these products.

In our organization we use a single instance of dP and several different mantis databases. Since we are a contract company we work for several different companies. Each company has a separate mantis database with several projects.

This is the limitation. We need the ability to assign an individual mantis database at the company level.

Any thoughts?

execute
26-04-07, 03:45 AM
Hi zman,

I've forwarded today your suggestion to my chef and he has to decide if my firm is willing to sponsor the further development and to implement your suggestions. If he says "yes" - I already have some ideas in my head and will able able to implement the fast.
If he says "no" - I still will be willing to implement this feature, because it allows more freedom and more flexibility, which is IMHO a good thing. And I will be doing this in my free time. And here is the problem - I don't have that much of a spare time lately. So if my boss says "no" the implementation will take some time into account.

execute
27-04-07, 07:55 PM
Zman, I've got a response form my boss: he is not willing to sponsor any further development of the module, because for the time being it serves its purpose right.
This means, that I will do it on my own, but it will take more time than a sponsored development, because I am dealing with other projects at work right now and I don't have that much of a spare time. But if you and your company are willing to sponsor the development we could come to a reasonable desirable and agreement.

Greetings.

zman
10-05-07, 01:30 AM
Thank you for the response.

I have discussed this with my management and at this time they are not willing to sponsor this either. Since we are just evaluating this for future use they are not committed yet.

Again, I appreciate the response and hard work that went into this great improvement to the product.

-Scott

dingfelder
08-06-07, 02:21 PM
I have implemented your code on my server and ran into a couple of things:

1. it seems that perhaps your system does not take into account the concept of mantis sub-projects?

2. when adding tasks, I got the following error, but could not figure out where to find what the error was:


Mantis returned an access denied code.

Please contact the administrator

3. Finally, while I realize that users should have the same name between dotProject and Mantis, the error you get when they are not is basically useless (invalid XML message etc). At minimum a better thiong would be to say "invalid user"

Cheers!

Ding

code4fun
14-06-07, 04:48 PM
I'm using Mantis with Subversion integration, but I need some time tracking features. Is it possible to use dotProject time tracking features on a Mantis issues with this dotProject/Mantis integration or is the Mantis issues just linked or imported ?

execute
14-06-07, 07:47 PM
Hi, I've been away for a few weeks. I've been rambling meanwhile on a OLAP module, but that's another story. :)

@dingfelder
Yes, same username and passwords is a requirement for the module.
1) Yes, Sub-Project in Mantis are not taken into account. But this is obsolete, since dP doesn't include Sub-Projects.

As said in the README - dP is the leading application, therefore "sub-projecting" is discarded.

2) This error means, that your user doesn't have enough level access in Mantis or you are trying to access issues, that are not visible for you. You can turn the debug on, to further investigate the return payload from mantis.

3) Not only usernames must be identical but also password. I am having some thoughts lately about SSO in dP and mantis, but nothing concrete yet.

@code4fun
No, you can't use it, at least not with this module. Mantis issues are just imported. Maybe in further version this could be implemented some how.

pdsgomes
08-07-07, 09:40 PM
Hello,

almost a sucess instalation os mantis.integration

when i click onthe mantis i get this error :

Mantis Integrated
Help
Error: [5] Connect error: Permission denied (13) at client.php:124

could anyone helpme out with this?

Thanks in advance

execute
09-07-07, 05:30 PM
@pdsgomes
enable debugging and see what the exact reason it.

open index.php and find:
// DEBUG option, enable if problems occure
$mantis->setXMLRPCDebug(0);

and set it to 1 or 2.

pdsgomes
09-07-07, 07:00 PM
Thanks you for your response Execute,

Debug = 1

Jul 9 09:41:30 compaq kernel: audit(1183970490.658:113): avc: denied { name_connect } for pid=7781 comm="httpd" dest=80 scontext=root:system_r:httpd_t:s0 tcontext=system_u:object_r:http_port_t:s0 tclass=tcp_socket

Debug = 2

---SENDING---
POST /mantis/xmlrpc/dpserver.php HTTP/1.0
User-Agent: XML-RPC for PHP 2.0
Host: 192.168.1.100
Accept-Encoding: gzip, deflate
Accept-Charset: UTF-8,ISO-8859-1,US-ASCII
Content-Type: text/xml
Content-Length: 363

<?xml version="1.0"?>
<methodCall>
<methodName>MantisRPC</methodName>
<params>
<param>
<value><string>pgomes</string></value>
</param>
<param>
<value><string>e10adc3949ba59abbe56e057f20f883e</string></value>
</param>
<param>
<value><string>getMantisBugByProjectId</string></value>
</param>
<param>
<value><string></string></value>
</param>
</params>
</methodCall>
---END---

Error: [5] Connect error: Permission denied (13) at client.php:124

execute
11-07-07, 06:10 AM
1) Are in both application username and password identical? This is q requirement.

2) Does the user pgomes have access to this project?

3) Are you trying the overview or a specific project?

pdsgomes
11-07-07, 10:10 PM
1 - Yes, in the both databases the user and pass are the same

2 - With this user i make everything, i dont have another user created.

3 - from the overview, but from a project i get the same error.

Thanks in advance

execute
15-08-07, 07:57 PM
Hello, sorry for long time gone and not responding.

Meanwhile I've changed the employer and I'm heavily working on drupal right now and I barely have any time left for my girlfriend, so haven't been able to look at your problem. And I don't think I would be any time soon. Sorry. Have a look at the other Mantis Integrations Modules.

On a side note: my former employer, the one that adopted dotProject, has discontinued its interest in integrating Mantis into dotProject, because of all the trouble it costs and all the mess that it can make. I can partly understand their point. So maybe, a rethink and a reevaluate would be worth it.

Morgg
02-11-07, 07:29 PM
Hi all,

I don't know if someone has tried before, but I used this integration module with the new version of Mantis (1.1.0rc2). It didn't work at first, giving the "Invalid user/password error [800]".

After some tracing throught Mantis code I found out the problem was in auth_does_password_match() function, returning false even if the incoming password from dotproject (the MD5 hash of the real password) was the same as the one stored in Mantis database.

Reading code comments I learned the developer had stopped support for PLAIN password authentication method, and that's the one that dotproject-mantis module is using. Actually it is the only one it can use, since the module can only know the MD5 hash and not the real password. The fact that you can login with just the MD5 hash can be considered a weakness, but it is necessary for the integration module to work.

So, the solution is just to re-activate the support for PLAIN authentication, commenting line 231 of core/authentication_api.php in Mantis folder. It's the one in auth_does_password_match() function that shows "continue;" inside an "if" statement.

And voilà! It works again. Well, that's if you don't use non-english characters (I'm Spanish so I do) and have upgraded from a previos Mantis version.

If you already have bugs in your database, you might receive a "bad character" error when trying to retrieve the Mantis tasks for a project. This is because the new Mantis version uses UTF-8 and it doesn't understand the previous contents in another encoding (ISO-8859 or similar). You have to convert your database to use this encoding too (including its contents).

Hope it helps someone, it made me lose quite some time.

smertz
03-11-07, 07:45 AM
Hi,
I installed the Mantis Integration module, and I have the error below.
Any idea?
---SENDING---
POST /xmlrpc/dotproject/dpserver.php HTTP/1.0
User-Agent: XML-RPC for PHP 2.0
Host: bugreport.resurgences.com
Accept-Encoding: gzip, deflate
Accept-Charset: UTF-8,ISO-8859-1,US-ASCII
Content-Type: text/xml
Content-Length: 363

<?xml version="1.0"?>
<methodCall>
<methodName>MantisRPC</methodName>
<params>
<param>
<value><string>smertz</string></value>
</param>
<param>
<value><string>[deleted]</string></value>
</param>
<param>
<value><string>getMantisBugByProjectId</string></value>
</param>
<param>
<value><string></string></value>
</param>
</params>
</methodCall>
---END---
---GOT---
HTTP/1.1 200 OK
Date: Fri, 02 Nov 2007 18:21:47 GMT
Server: Apache/1.3.33 (Darwin) PHP/5.2.2 DAV/1.0.3 mod_ssl/2.8.24 OpenSSL/0.9.7l
Cache-Control: no-store, no-cache, must-revalidate
Expires: Fri, 02 Nov 2007 18:21:48 GMT
X-Powered-By: PHP/5.2.2
Pragma: no-cache
Cache-Control: post-check=0, pre-check=0
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 192
Connection: close
Content-Type: text/xml

�mP»Â0 ÜûVgDèÀ�L:0!Á ki DJ�GÅç�V- �Égßù¬3Ö/k #´ãmY-We- ´N�(<Ê�[�L̵kLêû}j£ÌB{%/�Krí�"C?ÉQs�Õj�¢(&1nø_�sô�ïs§0LååxòÞù
ì9SZ�rm²Ä�4�f�j*3É2T(ÆÝ÷Å�§ø!§Èbö�7Á�ç�3
---END---
HEADER: date: Fri, 02 Nov 2007 18:21:47 GMT
HEADER: server: Apache/1.3.33 (Darwin) PHP/5.2.2 DAV/1.0.3 mod_ssl/2.8.24 OpenSSL/0.9.7l
HEADER: cache-control: post-check=0, pre-check=0
HEADER: expires: Fri, 02 Nov 2007 18:21:48 GMT
HEADER: x-powered-by: PHP/5.2.2
HEADER: pragma: no-cache
HEADER: vary: Accept-Encoding
HEADER: content-encoding: gzip
HEADER: content-length: 192
HEADER: connection: close
HEADER: content-type: text/xml
---INFLATED RESPONSE---[307 chars]---
<?xml version="1.0"?>
<methodResponse>
<fault>
<value>
<struct><member><name>faultCode</name>
<value><int>105</int></value>
</member>
<member>
<name>faultString</name>
<value><string>XML error: Invalid document end at line 1, column 1</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
---END---
---PARSED---
xmlrpcval::__set_state(array(
'me' =>
array (
'struct' =>
array (
'faultCode' =>
xmlrpcval::__set_state(array(
'me' =>
array (
'int' => 105,
),
'mytype' => 1,
'_php_class' => NULL,
)),
'faultString' =>
xmlrpcval::__set_state(array(
'me' =>
array (
'string' => 'XML error: Invalid document end at line 1, column 1',
),
'mytype' => 1,
'_php_class' => NULL,
)),
),
),
'mytype' => 3,
'_php_class' => NULL,
))
---END---
Error: [105] XML error: Invalid document end at line 1, column 1 at client.php:124

smesser
26-05-08, 07:46 AM
I am trying to the Mantis dotProject integration working and I am getting the follow error which is saying username and/or password error.

Using:

dotProject: 2.1.1
Mantis: 1.1.1

I have a project named FDP on Mantis and DotProject. They both have a user named:

User: smesser
password: smesser (have used others)

I can't imagine why I am getting this error. I believe everything is setup correctly.

---SENDING---
POST /mantis/xmlrpc/dotproject/dpserver.php HTTP/1.0
User-Agent: XML-RPC for PHP 2.0
Host: 192.168.0.5
Accept-Encoding: gzip, deflate
Accept-Charset: UTF-8,ISO-8859-1,US-ASCII
Content-Type: text/xml
Content-Length: 364

<?xml version="1.0"?>
<methodCall>
<methodName>MantisRPC</methodName>
<params>
<param>
<value><string>smesser</string></value>
</param>
<param>
<value><string>4fe37812c6f4aa16e8834156ea14b837</string></value>
</param>
<param>
<value><string>getMantisBugByProjectId</string></value>
</param>
<param>
<value><string></string></value>
</param>
</params>
</methodCall>
---END---
---GOT---
HTTP/1.1 200 OK
Date: Sun, 25 May 2008 21:36:27 GMT
Server: Apache/2.2.8 (Win32) PHP/5.2.6
X-Powered-By: PHP/5.2.6
Pragma: no-cache
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Expires: Sun, 25 May 2008 21:36:27 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 170
Connection: close
Content-Type: text/xml

�mO1Â0Üû�¨Àec0éÀÄJ_��H�SÅIÅóI«PÅä»óùlcûò½)�|¬÷»¦nu ��Ò3ØÉX¨w�ûTêhú<qI1ß�.F¥¨��'=�NÁÂÌW;:NúÐ4@XC`�®ð¾9]��Û$�U}æÂ�UY(*ÃBT�AXÿ�ÀrtõÓ\ÿ�ÍÇoó-.ä
---END---
HEADER: date: Sun, 25 May 2008 21:36:27 GMT
HEADER: server: Apache/2.2.8 (Win32) PHP/5.2.6
HEADER: x-powered-by: PHP/5.2.6
HEADER: pragma: no-cache
HEADER: cache-control: post-check=0, pre-check=0
HEADER: expires: Sun, 25 May 2008 21:36:27 GMT
HEADER: vary: Accept-Encoding
HEADER: content-encoding: gzip
HEADER: content-length: 170
HEADER: connection: close
HEADER: content-type: text/xml
---INFLATED RESPONSE---[280 chars]---
<?xml version="1.0"?>
<methodResponse>
<fault>
<value>
<struct><member><name>faultCode</name>
<value><int>800</int></value>
</member>
<member>
<name>faultString</name>
<value><string>Invalid user and/or pass</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
---END------PARSED---
xmlrpcval::__set_state(array(
'me' =>
array (
'struct' =>
array (
'faultCode' =>
xmlrpcval::__set_state(array(
'me' =>
array (
'int' => 800,
),
'mytype' => 1,
'_php_class' => NULL,
)),
'faultString' =>
xmlrpcval::__set_state(array(
'me' =>
array (
'string' => 'Invalid user and/or pass',
),
'mytype' => 1,
'_php_class' => NULL,
)),
),
),
'mytype' => 3,
'_php_class' => NULL,
))
---END---Error: [800] Invalid user and/or pass at client.php:124

t32549
03-07-08, 07:15 PM
Hallo smesser,
i have the problem like you, have you resolved it? Can you give me a little help how you've solved the problem.
Thanks
T32549

smesser
05-07-08, 01:23 AM
No, I haven't solved the problem.

Having tried nearly all the free big players in the project management and
bug tracking area I have given up on the open source seen as you
always run into some issue like this. The pieces always work fine by themselves but integration if it works is usually a hack.

You have to use old versions of all the pieces because someone made
a version got it to work and then abandons it. While I understand why I don't believe one should say you have Mantis integration if it doesn't work.

Good luck but we decided to roll our own, If we had spend the time coding
instead of fighting with all the issues of "Open Source" and trying the many projects that are either too limited in scope or too specific we would be much
closer to having a workable solution.

Steve steps down off his soapbox.

gggeek
30-10-08, 07:01 AM
@pdsgomes: there is a known bug in the 5.2.2 version of php, that discards the contents of data it receives via POST unless it is urlencoded as web forms do - the RAW_POST_DATA variable.
This variable is used by the phpxmlrpc lib on the server (mantis) side, so the server thinks you sent an empty request.
To fix the problem you have to upgrade either php or the phpxmlrpc lib, that in later releases also coded around the php bug.

jdkelsey
06-08-09, 03:12 AM
I was getting the same user/password error as the rest of you until I tried

Morgg's fix from page 2... it worked!! although in my version of mantis the line that needs to be commented in core/authentication_api.php in Mantis folder
is line 227 "continue;"


form Morgg's post:

"After some tracing throught Mantis code I found out the problem was in auth_does_password_match() function, returning false even if the incoming password from dotproject (the MD5 hash of the real password) was the same as the one stored in Mantis database.

Reading code comments I learned the developer had stopped support for PLAIN password authentication method, and that's the one that dotproject-mantis module is using. Actually it is the only one it can use, since the module can only know the MD5 hash and not the real password. The fact that you can login with just the MD5 hash can be considered a weakness, but it is necessary for the integration module to work.

So, the solution is just to re-activate the support for PLAIN authentication, commenting line 231 of core/authentication_api.php in Mantis folder. It's the one in auth_does_password_match() function that shows "continue;" inside an "if" statement.

And voilà! It works again."

rubenpais
22-09-10, 05:58 PM
Hello,

I'm trying to integrate Mantis with DotProyect but when I import a task always appears the XML error: Undeclared entity warning at line 28, column 8Error: [2] Invalid return payload: enable debugging to examine incoming payload (XML error: Undeclared entity warning at line 28, column 8) at client.php:124.

I tested modules dotproject.mantis.integration_2010.8.13.zip and mantis.integration_20070418.zip and the version of Mantis to 1.2.2 and also upgrade the libraries and xmlrpc.inc xmlrpcs.inc

Any ideas?

Thanks!

Visionera
27-09-10, 10:04 AM
Hello all.

Seems like the thread might be dead but I thought I would try.

I'm putting execute's integration in and have mantis 1.2.3 and DP 2.1.3

The Automatic setting in the config doesn't work (doesn't show anything on the Mantis tab in DP, and when on the Mantis tab of a project and I click on the issue description (the link) it takes me to Manits and if the user doesn't exist it actually does create the user and the issue and works great.

If the user already exists in Mantis however, I get "APPLICATION ERROR #800
That username is already being used. Please go back and select another one."

I did have to make a change to index_dp.php around line 15..

// $t_user_table = config_get( 'mantis_user_table' );
$t_user_table="mantis_user_table";

this fixed an issue I was having accessing the mantis_user_table.


If anyone has any insight for me I would appreciate it.

CasN
27-09-10, 06:24 PM
Which integration are you using, there are 2 around.
There is one based upon xml and one direct (made by me).

Hello all.

Seems like the thread might be dead but I thought I would try.

I'm putting execute's integration in and have mantis 1.2.3 and DP 2.1.3

The Automatic setting in the config doesn't work (doesn't show anything on the Mantis tab in DP, and when on the Mantis tab of a project and I click on the issue description (the link) it takes me to Manits and if the user doesn't exist it actually does create the user and the issue and works great.

If the user already exists in Mantis however, I get "APPLICATION ERROR #800
That username is already being used. Please go back and select another one."

I did have to make a change to index_dp.php around line 15..

// $t_user_table = config_get( 'mantis_user_table' );
$t_user_table="mantis_user_table";

this fixed an issue I was having accessing the mantis_user_table.


If anyone has any insight for me I would appreciate it.