Customizing SMF > Portals, Bridges, and Integrations

A guide to the SMF integration hooks

<< < (2/5) > >>

Orstio:
Used in file:  Load.php
Used in function:  loadUserSettings

Variables passed to hook function:  None
Variables expected from hook function: $ID_MEMBER (int)

Usage:  This hook is started before checking the SMF cookie for a valid user.  A valid SMF $ID_MEMBER is expected back from the hook function, or SMF will assume it should check the SMF cookie instead.

Example of use:  User is logged into a CMS, but not into SMF, so we want to auto-login to SMF without the SMF cookie.

Orstio:
Used in file:  LoginOut.php
Used in function:  Login2

Variables passed to hook function:  $_REQUEST['user'], $_REQUEST['hash_passwrd'], $modsettings['cookieTime']
Variables expected from hook function: true, false, or 'retry'.

Usage:  This hook is started before checking for a valid SMF user on login.  This gives the integrated application a chance to use the login credentials before SMF does.  Something to keep in mind is that SMF hashes the password in SHA1 on the client side, so an unhashed password is not available to this function.

A value of true or false returned from the function will continue as normal, and a value of 'retry' will redisplay the login form, with the message "Password security has recently been upgraded.  Please login again."

Example of use:  A user that exists in the integrated application but not in SMF is attempting to login, so needs to ber migrated to SMF before SMF has a chance to authenticate.  Something to keep in mind here is that SMF can authenticate with many other types of hashes, so the hashed passwords of other systems can typically be written directly to the SMF members table, with the hook returning 'retry', which will automatically invoke SMF to rewrite to its own hash on the second login attempt.

Orstio:
Used in file:  LoginOut.php
Used in function:  Login2

Variables passed to hook function:  $user_settings['memberName'], $_REQUEST['hash_passwrd'], $modsettings['cookieTime']
Variables expected from hook function: None

Usage:  This hook is started after authentication in SMF, but before setting the SMF cookie.  It's main use is setting the login cookie of an alternative system.  Because the user is already authenticated in SMF at this point, there is very little need for further authentication checks.

Example of use:  A user has logged into SMF, and should also be logged into the integrated system at the same time.

Orstio:
Used in file:  LoginOut.php
Used in function:  Logout

Variables passed to hook function:  $user_settings['memberName']
Variables expected from hook function: None

Usage:  This hook is started before the user entry is deleted from the SMF log online table, and the SMF cookie is dropped.

Example of use:  A user has logged out of SMF, and should also be logged out of the integrated system at the same time.

Orstio:
Used in file:  ManageMembers.php, Profile.php
Used in function:  AdminApprove, saveProfileChanges

Variables passed to hook function:  The username of the user to be changed
Variables expected from hook function: None

Usage:  This hook is started in two instances.  Whenever the administrator approves members, each of those members' usernames is passed to the hook function for activation in the integrated system as well.  The first instance is in the SMF admin panel, and the second is in the user profile.

Example of use:  A user has registered, and is awaiting admin approval of his account to use both SMF and the integrated application.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version