0

I know I might be asking a really dumb and likely complex matter, but it's the only remotely easy option I have at the moment.

Due to what is set up on two systems by my predecessor, wordpress and drupal both appear as CMS's that I have to manage, the one problem area apparently always having been the ability to keep users accounts in order so that if a user created an account on one site, the admin would have to go through and manually connect that account to the other site.

So my question is, after looking through everything and apparently finding very little to resolve this issue, I am coming to ask whether or not there is an option for me to connect the two (for the time being, I don't expect it to take more than a few months) in just how pull, from a table, a username and password? And just as a heads up, I am converting the wordpress to drupal so this problem will be solved in the near future, I just need this as a temporary solution...

I'd greatly appreciate any help.

4
  • You'd have to use a hook like hook_user_insert and or hook_user_update to keep the data flowing to Wordpress.
    – Kevin
    Commented Mar 27, 2017 at 16:48
  • + that is to say, in conjunction with a Wordpress API so you can communicate to the other system.
    – Kevin
    Commented Mar 27, 2017 at 16:55
  • Can you 1) Import your users from WP to Drupal using the migrate module 2) discontinue allowing users to register on WP, and 3) Use the Services module to create a REST endpoint where WP can auth users against Drupal? If that works for you I can provide a more detailed answer Commented Mar 27, 2017 at 20:30
  • @longboardnode - yes, I can do all three. I just would like some option and it sounds like I could readily implement your solution. If you could provide more information, that would be great.
    – Matthew
    Commented Mar 27, 2017 at 22:09

1 Answer 1

2

This is a rough sketch based on some other projects I've been involved in but the WP part is a bit uncertain. FWIW here it is:

1) install services, rest server and an auth module (like oauth or api_key) the on drupal and create an endpoint with resources for the user functions you need. Find a great tutorial by here. Essentially you should be able to push a php call with the json to your endpoint (Chrome's postman is a great tool to test this with) and get a 200 response if user was logged in or 401 unauthorized if not.

2) pause WP from processing user tasks on its side

3) export legacy WP users to csv and import users into Drupal using the user import module

4) Now you should be able to set ping your drupal from WP, get a reply back, set a session var if logged in and serve content on WP as if they logged in.

Granted, this is not an ideal setup but hopefully will carry you through the few months until you convert WP to Drupal.

1
  • Helpful answer. Could you pls clarify what happens when a new WP user is created, or a new Drupal user is created. Is a user going to be created in the 'other' CMS when created in the first one? Commented Aug 1, 2019 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.