Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
22.4k views
in Q2A Core by
Hi,

first of all, I would like to say this is a great piece of work, thank you for this application!

As mentioned in the title, I am setting up a single sign on to integrate with (previously existing) Mantis BT installation.

I prefer to keep databases separate to avoid messing things up.

I am using V1.5.4.

Up to know, I've made test with SSo proxy plugin but I've given up after hours of tests, I was going sort of nowhere with it. I thought it might have been simplier than qa-external-users.php, but it didn't work for me.

So, I am now in the process of setting up things with qa-external-users.php then.

So far, I've managed to have the login / logout / subscribe + names on qa-login-bar as well as points per users in the same bar which is not that bad.

I think I have all the functions fine in qa-external-users.php up to qa_get_user_email.

Now I am kind of stuck with "qa_get_userids_from_public($publicusernames)" and "qa_get_public_from_userids($userids)", which I am not sure about their exact descriptions.

As a matter of fact, in "users" page, only points are showing (no user name). I believe this display is linked to the two above functions that provide proper data for this?

Also in posted questions the author is left blank as well "posted by" is followed by nothing. Hopefully this is related.

Could any one point me in the right direction by giving extra info about these functions and other necessary functions to have users displayed where missing ?

Thank you in advance.

Yves.
Q2A version: 1.5.4

1 Answer

+3 votes
by
selected by
 
Best answer
These functions map between the ID representing each user and the username which should be displayed for that user.

Most probably these are just two columns in a single user table, but it's also possible that Mantis uses the username as the user identifier and doesn't have a separate user ID. You need to check the database schema.

There are a few examples for implementing these functions in qa-external-users.php and you can almost definitely use one of them - you just need to rename the tables and columns appropriately.
by
edited by
Hi,

Thanks for the answer, it clarified the situation.

OK, I've got it to work though I couldn't use functions "as is" (Q2A and Mantis are connected on actual different databases, so I had to do the right logic to retrieve the proper data).

Also on QA users page, deleted test users from Mantis would still show up in the users list (as blank entries).
For that matter, Q2A has no way to know that third party user no longer exists though there are still corresponding ids in Q2A database.
So I added a function in qa-external-users.php to check that id from Q2A (still) exists in Mantis.
I call this function from qa-page-users.php. If it returns false from some Q2A id, nothing will be shown for that particular id on the users page.

Just mentionning it, as this may be of some use for others when integrating with a third party application SSO.

Most probably the best thing to do would be to clean Q2A database from any corresponding id when deleting a user in Mantis.
by
edited by
Could you please document a step-by-step process guide or brief idea sketch?
by
Hi,

OK, I'll do that but it's been some time now, so I need to dig in my "notes" (i.e. mind and code).
Also, I may not be up to date with the version, hence possible differences with current code.

Anyway, allow me a bit of time and I'll bring back the info to you
by
Thank you Sir! Will wait :-)
...