News:

Wondering if this will always be free?  See why free is better.

Main Menu

Need guidance with synchronizing user tables

Started by calash, November 08, 2005, 02:17:28 PM

Previous topic - Next topic

calash

I am working on a way to connect the new eFiction script to SMF.  I am using a method that I used when I was working with IPB 1.3.  First I setup a system to synchronize the user tables, matching the name, password, email, and any other info that should be shared between the two.  Then I alter eFiction to use the forum's sessions to login based on the user name

So far I got the login part working well, but I am having difficult finding where to sync the user accounts.  I think I found the insert command but I am not sure what variables are available at that point to insert into the eFiction user table.

I also need to be able to update eFiction when the client edits there profile.

I know IPB has a list of functions that you could use to run commands at these events.  Does SMF have something similar that I could tap into?  If not what would be the best method to keep 2 user tables in sync?  I am planning on having all user control in SMF so the changes will only have to go in one direction.

Thanks.


calash

Would it be easier to design a new registration and profile system and redirect SMF to that?

Also, are there examples of how others have done this?  I have checked the Mambo integration but I can not see how the tables are kept in sync.

Thanks

Trekkie101

Basically this is my advice and I tried with efiction but started hating that script more and more that I tried playing with it, not my coding style.

~:~
Copy users and passwords from efiction
Copy users from SMF database
When someone registers for SMF, update eficition
When someone registers for efiction, update smf
Login, handle this with a minor code change to efiction and SMF

All the above if im right with the execption of the first two, can be done with "posting" data but thats theory ive never tried it.

SMf has a much better password system, so efiction wont be able to get the passwords from the SMF db.

calash

Actually I am looking to do something a bit simpler than that.  Basically I remove the eFiction login, user info edit, and registration page and link into the forum's system.  My main issue is how to link into the registration and profile change and what I have available there to work with.

I am fairly sure I got the correct files...profile.php and register.php.  However I am having some difficulty with the profile section.  The way I am linking the systems is by user name to Pen name, however I am not sure how to extract the user name of the profile to edit without running another query first.  I think the registration will be a bit easier except I need to have the raw password since the 2 scripts do not use the same encryption.

Once I got the profile edit and registration in place it is a simple matter of editing the header.php file of eFiction to use SSI.php and capture the current user name, then pull up the necessary eFiction session info.

calash

I hacked around a bit and found some spots I could hook into.  I added queries into profile.php and register.php at the end of the functions called when you submit the form.  I am pulling from the $_POST array for much of the info, but it seems to work fine.

Still need to work on building the profile query so that information that is not updated is not erased...a few if statements should take care of that.


Advertisement: