Questions/Comments on "A guide to the SMF integration hooks"

Started by Orstio, May 26, 2007, 05:19:48 PM

Previous topic - Next topic

Orstio

You might want to redirect some links to SMF if TNG has its own registration and login system.

badams


I think I'm on overload at the moment.... :)

But could you provide me an example of what types of links I would want to redirect?

Think I'm going to have to sleep on this tonight..... :)

Thanks again for your help.....

Orstio


badams


I created the file for the integration hooks....but unsure where to include the file in the SMF index.php.

I know very little PHP....enough to be dangerous....looks like I'm going to have to pull out the books for this project....

Orstio

You'll probably want it right after this:

// Load the settings...
require_once(dirname(__FILE__) . '/Settings.php');



badams


Thanks, Orstio....at least you got me started.  Do you have an example that I can be use as a guideline?

badams


This may be a dumb question.....but how does TNG recognize the integration hooks if they are defined in a file in my SMF directory and included in the SMF index.php?  In order to use the integration functions....doesn't the file have to be included or required in TNG??  So, that both SMF and TNG are aware of the hooks.....

It's been a good 15 years since I've done any programming....so, I'm a little rusty....:)

Since the user is already validated in SMF, I would be just checking the database and passing the variables in the integrate login function so that TNG can process the login.




Orstio

Now I think you're starting to see something more.  ;)

Read this topic, it might give you some ideas:

http://www.simplemachines.org/community/index.php?topic=217821.0

badams


OK....Let's see if I understand what you're trying to tell me....:)

Within the integrate login function....I need to create an output buffer....require the TNG file/script that processes the login??....then replace/pass the smf variables to the TNG variables.....

Am I anywhere close....:)

Orstio

Sorry, I didn't mean to confuse you so badly.   :-[

No, you are absolutely wrong.

I was under the assumption you wanted to be able to login to TNG, and that would also log you into SMF, which doesn't seem to be what you're after.

QuoteSince the user is already validated in SMF, I would be just checking the database and passing the variables in the integrate login function so that TNG can process the login.

That statement is not quite correct.  It should read:  Since the user is already validated in SMF, you would be be processing the TNG login in the integrate_login function.

badams


OK....so now I'm confused....which seems to be my normal state nowadays....   ;)

So, I'm back to the question....how does TNG know about the integration hooks.....so far it seems to be one sided....


Orstio

For what you are trying to accomplish, it does not need to know.

badams


OK....it seems like I need to reverse my way of thinking.....instead of SMF and TNG fighting over the steering wheel....SMF is the driver and TNG is the passenger.....therefore, TNG would not need to know....

With that being said....think I'll try some things tomorrow....

badams


OK...I was so confused that I took a break and went back to square one... ;)

Working on integrate_login....both systems have their own registration and login procedures, as well as their own admin panels, etc.  I want to use SMF/TP as the main site with TNG running as an application with the users signing on to SMF and being automatically logged into TNG.

With the integrate_login function, the membername, password, and cookietime is used.  Since SMF uses SHA1 and TNG uses MD5....How do I compare the two passwords?




Orstio

You don't need to compare them.

By the time the integrate_login function is triggered, the user is already authenticated in SMF.  This is the authentic user, because they have already passed the SMF authentication.

So, you don't need to do another check in TNG to see if it is the authentic user, because the user has already been authenticated.  You can just set the cookie for TNG.

badams

OK....where am I going wrong in my line of thinking.....

I don't need to authenticate the user like you said....but I do need to set the session variables that sets the TNG permissions for the user and also set the logged in session variable showing that the user is signed into TNG.  TNG performs a behind the scenes checklogin on every page that looks for these session variables.  If the session variables are not set, then TNG is going to send you to a login screen and process the login.....

Since it appears that with integrate_login...I'm bypassing TNG's processlogin which logs the user in to TNG and sets the cookie....I manually need to set the cookie in integrate_login??



badams


Hmm.....that's going to be quite a bit of coding....better hit the books and get going..... :)

rifeman2007

Hi,

Please help me.

In my template login.php, I have already defined the startup hooks then included SMF_Path/index.php but it doesn't work out...

e.g.

Template: Login.php
define('SMF_INTEGRATION_SETTINGS', serialize(array(
   'integrate_change_email' => 'integrate_change_email',
   'integrate_reset_pass' => 'integrate_reset_pass',
   'integrate_exit' => 'ig_smf_exit',
   'integrate_logout' => 'integrate_logout',
   'integrate_outgoing_email' => 'integrate_outgoing_email',
   'integrate_login' => 'integrate_login',
   'integrate_validate_login' => 'integrate_validate_login',
   'integrate_redirect' => 'integrate_redirect',
   'integrate_delete_member' => 'integrate_delete_member',
   'integrate_register' => 'integrate_register',
   'integrate_pre_load' => 'integrate_pre_load'
)));

require_once(integration.php);
require_once(SMF_PATH/index.php);

Am I on the right track?

Thanks


Orstio

QuoteIn my template login.php, I have already defined the startup hooks then included SMF_Path/index.php but it doesn't work out...

Where is this Login.php?  Is it part of a CMS?

What is integration.php?  What's in it?

Are you just trying to integrate logins?  What it looks like you have done is included the entire forum, not just the login.

Advertisement: