Customizing Mantis 1.2.15 to play with Phpbb 3.0.11

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
gjdunga
Posts: 3
Joined: 23 Jun 2013, 08:37
Location: Penrose, Co
Contact:

Customizing Mantis 1.2.15 to play with Phpbb 3.0.11

Post by gjdunga »

Greetings,

I am trying to integrate mantisbt-1.2.15 into phpbb 3.0.11. (Authentication at first, then possibly within the header/footer of the forum later ..)

There was a previous incarnation that others did with phpbb 2 and possibly with phpbb 3.0.0 but Mantis has apparently changed since then, the project is stagnant, does not work as packaged. I am not a ninja codewarrior, so I need some help.

My goal is to have phpbb provide all authentication for mantis. We have approx 22,000 members with about 60% of them active, and want to use the phpbb_users table rather than the mantis_user_table for authentication. Database importing is not on the table, as it would become a logical nightmare.
We want all of our non banned users to have the ability to report bugs to us.

After looking at the schema for both tables, I'm fairly confident mantis can use the data in the table, with some tweaking.

My issue is, I'm not sure where mantis keeps it's schema, so that I can tell to use the field names in phpbb rather than in mantis.

For instance.
in phpbb_users the field we want to use is 'user_id' the field in mantis is "id"
in phpbb it is defined as a mediumint(8) UNSIGNED No null no default AUTO_INCREMENT
in mantis it is a int 10..

username is a direct match but phpbb uses varchar(255) utf8_bin No null
In mantis it is varchar(32) NOT NULL DEFAULT '',

realname we want to direct to phpbb's username_clean , and uses varchar(255) utf8_bin No null

We want to add the enabled, protected, and access levels to the table in phpbb_users.
This will be in a different order, and mantis was being weird to read the data in my previous attempt.

The current phpbb install is in /home/swe/public_html/phpBB3/
The current mantis install in in /home/swe/public_html/phpBB3/bugs/

Single mysql database (swe)
The phpbb tables are prefixed with phpbb_
the mantis tables are prefixed with mantis_

I am assuming some of these changes must be made in user_api.php, but is that it? I didn't where I could alter the id vs user_id, as one example.

We also want to use the same cookie domain and name, to make things easier.

Can someone direct me to the appropriate sections that one needs to edit to change this schema?

Gabriel
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Customizing Mantis 1.2.15 to play with Phpbb 3.0.11

Post by atrol »

Please use Search before posting and read the Manual
gjdunga
Posts: 3
Joined: 23 Jun 2013, 08:37
Location: Penrose, Co
Contact:

Re: Customizing Mantis 1.2.15 to play with Phpbb 3.0.11

Post by gjdunga »

Atrol, I've looked at this, and as mentioned above, it's based on phpbb 2.x and the authentication method appears to be different, as well as the way they do templating. Most of it is moving files around. but My question remains.

Where can I hard code or otherwise alter the database schema in mantis? Do I need to sort thru every file to change references..
Changing the table is not enough, I have to change fields as well.

I apologize for needing to ask this question, as I did not find a developer's reference to the schema, and when I looked at api_file, it seemed to be using user_id not id, and corn-fused me..

Gabriel
dregad
Developer
Posts: 75
Joined: 26 Jul 2010, 14:24

Re: Customizing Mantis 1.2.15 to play with Phpbb 3.0.11

Post by dregad »

Gabriel

I don't think the approach of altering the schema (be it Mantis or phpBB) is a good one as it will break compatibility and make your upgrade path difficult (for both pieces of software), and potentially make it impossible to get support due to your heavily customized code and modified DB schema.

To minimize the effort, I believe the best way to do this is to use the existing mantis user table, and just delegate the authentication process to phpBB.

I recommend you have a look at how Mantis currently works with LDAP authentication (see ldap_api.php and auth_attempt_login() function in authentication_api.php) creating/updating the user info to Mantis user table upon successful login), and try to implement something similar with phpBB, i.e. a new login method; that would likely require creating a new core library (e.g. phpbb_api.php) to store the relevant functions.

If you do end up implementing such a solution, I suggest you post your progress in our mailing list as this is something that could potentially make it into Mantis core at some point. We can also create a wiki page for you to document your changes if you'd like.

Hope this helps.

Damien

PS: Disclaimer - this was just me thinking out loud... I have no time to go into the details or test anything I just wrote here
gjdunga
Posts: 3
Joined: 23 Jun 2013, 08:37
Location: Penrose, Co
Contact:

Re: Customizing Mantis 1.2.15 to play with Phpbb 3.0.11

Post by gjdunga »

dregad,

This is my dilemma.

The entire user base is contained in the phpbb authentication database. There is no IIS, There is no AD. There is no LDAP feeding phpbb.

To do what you suggest I would have to export all the users to a LDAP server, and run both phpbb and mantis in this fashion.
I'm not sure that will fly with the powers that be.

I'm not aware of a way to make phpbb a LDAP provider! Are you aware of such feature?

Edit (addon):

Let me add, that we intend to disable the create user / delete_user / User_profile / ChangePassword functions in mantisbt, as we desire the phpbb user control panel to administer these. I intend to do so, by using the custom fields feature in phpbb. The admin will be able to alter projects and other information, but will have the change user / delete user items stripped from those pages.

To explain more:

In phpbb 3.x there is a way to create custom user profile fields, and to have these hidden from the profile owner, but accessible to admins.
they are stored in phpbb_profile_fields_data

It's the intention to migrate 'realname' to pf_mantis_realname, 'enabled' to pf_mantis_enabled, 'protected' to pf_mantis_protected and access_level to pf_mantis_access_level.

This eliminates phpbb being affected from upgrades, as phpbb leaves custom fields alone, and the only thing that would change on mantis upgrades would be us updating the locations of the database connections before the upgrade.

I understand this may require us to "stand on our own aka a mini fork, but I do not see any other way.. If you do, please let me know!

With this information in mind, I have found where I can alter the database "names" but I need to be more granular, as shown above to point fields to phpbb_profile_fields_data tables, etc.. To confirm this is something I will have to replace in every occurrence in the code, or can I declare something special in the config_defaults_inc.php ?
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Customizing Mantis 1.2.15 to play with Phpbb 3.0.11

Post by atrol »

gjdunga wrote: To do what you suggest I would have to export all the users to a LDAP server
This is not what dregad suggested.
The recommendation is to have a look at the existing implementation of LDAP authentication (which is a good example for what you need) and to create a new one.
Please use Search before posting and read the Manual
Post Reply