latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

bridge WP users with a custom application

Home Forums Community Forum bridge WP users with a custom application

This topic contains 3 replies, has 2 voices. Last updated by  David Welch 4 years, 9 months ago.

Topic Author Topic
Posted: Sunday Mar 18th, 2012 at 11:15 am #8488
x126 x126
Username: x126

Hello All…

I am a newbie here at S2Member and I have situation that may not be all that unique.

Currently I am working on a project which requires that I bridge/share the users of a custom application written in ASP with a WP install. Obvioulsy the custom ASP app is hosted on a windows server and I have WP running on the same server.

I have not even started thinking about how I can bridge/share the users for each app – but after reading about S2member it appears to be the most promising place to start.

Currrently, WP uses DB1 which is MySQL and the custom app uses DB2 which is MS SQL – my main objective is… When a user signs up on DB2 they are added to DB1 and vica versa.

Is this even possible?

  • This topic was modified 4 years, 9 months ago by  x126 x126.

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Sunday Mar 18th, 2012 at 2:27 pm #8494
David Welch
Username: dwbiz05

It’s not the best solution, but can your custom application simply querying the member info from the wp database instead of copying everything every time a user is created?.

It seems to me that it would be easier to do that than to try to integrate a copy method.

Unless you need wordpress to do more than collect members or you have people registering through the app as well…

S2 doesn’t have any out of the box solutions for this, but depending on the full amount of integration you’re looking for, it may be helpful. how deep does this integration need to go?

Dave

Posted: Sunday Mar 18th, 2012 at 4:24 pm #8497
x126 x126
Username: x126

Hey Dave,

Thanks for the reply

The depth of the integration is basically with the users and access levels so that I can create a subscription plan for users to pay so they have access to use the ASP app.

People do register through the ASP app, I could possibly remove that access and make the register access point through WP only. If I can get WP to connect to the MS SQL DB and add the user to DB2 after they pay.

MS SQL or ASP are not my favorite environments – but I was tasked with somehow making this work – I am open to any suggestions.

Posted: Sunday Mar 18th, 2012 at 11:49 pm #8514
David Welch
Username: dwbiz05

Well, if you HAVE to add them to the app’s db, then you can create a function and hook into the registration process right after all registration fields have been processed with wp.

Do the user ID’s matter if you are inputting them into the MS db?

If not, then using the simple hook should be fine. I assume you know how to access the MS SQL db from php.

Simply create a function to pull the info you need from the wordpress db in the correct sql statement to enter it into your MS SQL db.

Then add that to a file in your wordpress install under wp-content/mu-plugins/s2hacks.php. You may need to create the mu-plugins dir and the s2hacks.php file.

copy your code to the s2hacks.php file.

Then your file should look something like this after you add the necessary hook:

add_action('ws_plugin__s2member_after_configure_user_registration','my_db_copy_function');

function my_db_copy_function($user_id){
	//Your function code goes here.
	//$user_id is the id of the newly created user that is passed to your function by the hook.
}

Using that hook should run your function’s process right after the user’s registration information has been saved.

Hope that points you in the right direction.

Dave

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.