Drupal and Q2A User Integration

232 views Asked by At

I want the same login page for both systems. I want the same "My Account" page for both systems. I want the same Search Bar for both systems. How can I do this?

Currently, my website has them both installed and running separately.. but I desperately need them to merge. However, I'm a newbie to all of this so I can't figure it out.

Here's my site so far: www.answers.legal

Thank you!

2

There are 2 answers

1
MilanG On

I would use hook_user_login() to catch moment when drupal user logs in and then execute some Q2E code which will sign in Q2E user too.

Same goes for user registration.

So basically Drupal's system would be used (login, register...) but I would use hook to execute analogue Q2E code.

However I would try to avoid this user system merge as much as possible because even from start this sounds as disaster. :)

0
DisgruntledGoat On

Question2Answer can be installed with "Single Sign On" where it can use the users from your Drupal site. See the docs here for instructions.

First rename the qa-external-example folder to qa-external and look at the qa-external-users.php file inside.

There are several functions you need to implement, which are all commented. You'll need to find out what Drupal functions you can call there to get the current logged-in user. It may also help to look at qa-include/util/external-users-wp.php which is an integration for Wordpress.

Edit: I just found this page which gives some code for Drupal integration. Hopefully that should help.