sfFacebookConnectPlugin
sfFacebookConnectPlugin copied to clipboard
Update for current sfDoctrineGuard compatibility.
The current stable releas of sfDoctrineGuard adds an email column email_address so the email no longer needs to be stored in the profile. There should be a setting to more directly control this without having to write your own adapter class.
Futhermore, If you arent already using a user profile its silly to make one for just three columns (2 if you exclude email now that sfguard supports it directly) when you can just override the sfGuardUser schema at the project level to add the columns in question. It would be nice if there were options to let the plugin know if you are using a profile at all or if it shoudl just look at the user class.
Do you even get that data in your sfGuardUser? I am not. Please see my issue if you have any suggestions for solving this.
I've just wrote an adapter supporting the current release of sfDoctrineGuard https://gist.github.com/860055
Put the file in your lib directory, clear the cache and correct your app.yml like this:
facebook:
api_key: xxx
api_secret: xxx
api_id: xxx
redirect_after_connect: false
redirect_after_connect_url: ''
connect_signin_url: 'sfFacebookConnectAuth/signin'
app_url: '/my-app' # the facebook application canvas url
guard_adapter: sfFacebookNewDoctrineGuardAdapter
js_framework: jQuery
sf_guard_plugin:
profile_class: sfGuardUser
profile_field_name: id
profile_facebook_uid_name: facebook_uid
profile_email_name: email_address
profile_email_hash_name: email_hash
facebook_connect:
load_routing: true
user_permissions: []
You also need to extend the sfGuardUser model in your config/doctrine/schema.yml:
sfGuardUser:
columns:
facebook_uid:
type: integer(5)
email_hash:
type: varchar(255)