Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.On a high-traffic site, we don't want to use Rules, but we still want to have something like #2392093: Add Rules Event Hook for Facebook Connect
A hook_simple_fb_connect_login() would nice for that
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2578359-4-dx_hook_login.patch | 2.95 KB | lesonunique |
Comments
Comment #2
lesonunique commentedComment #3
lesonunique commentedSorry patch was malformed
Comment #4
lesonunique commentedI also needed the FB session to be able to do this:
So I updated the patch
Comment #6
masipila commentedHi,
thanks for the suggestion and the patch!
I modified the patch slightly before committing so lesonunique be sure to modify the hook implementation accordingly on your site.
FacebookSession and Facebook Profile ($fb_session and $fb_profile) are not arguments for the hook. The reason for this is that I don't want to add them as parameters to function simple_fb_connect_login_user. In the D8 version of this module, all FB related stuff is isolated to one class and all Drupal user management related stuff is isolated to another class. The D7 version is still old-school procedural Drupal code but I want to keep this same isolation in the D7 code base as well.
Other modules implementing the hook can easily get the FacebookSession by simply calling
simple_fb_connect_get_session(). Once you have the FacebookSession,you can make whatever FB API calls you want.Cheers,
Markus
p.s. You might want to modify your own hook implementation so that you make sure that the username is unique.
Comment #7
masipila commentedThis is now part of 7.x-2.2
Comment #9
masipila commentedI just noticed that we were missing a hook for new user creation. The earlier commit about a month ago only provided a hook for user login.
Comment #11
masipila commentedNow there is also a hook for new user creation (see simple_fb_connect.api.php)
This will be part of 7.x-2.3