Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use with sfGuard #2

Closed
Pezmc opened this Issue Aug 22, 2011 · 17 comments

Comments

Projects
None yet
2 participants

Pezmc commented Aug 22, 2011

Is it possible to use this plugin pulling the data from the current sfGuardUserProfile if the user is logged in?

Owner

nibsirahsieu commented Aug 22, 2011

Yes of course.. Have a look at plugin's schema. There is user_id field, you can relate it to the sfGuardPlugin. But you have to fill this field manually

Owner

nibsirahsieu commented Aug 22, 2011

Have a look at this line https://github.com/nibsirahsieu/sfNestedCommentPlugin/blob/master/modules/sfNestedCommentAdmin/lib/BasesfNestedCommentAdminActions.class.php#L48.
And your myUser.class.php must provide the following functions : getAuthorId(), getAuthorName(), getAuthorEmail() and getAuthorWebsite()

Pezmc commented Aug 22, 2011

Sorry I mean the users using sfGuard rather than having to type their name/url & email

@Pezmc Pezmc closed this Aug 22, 2011

@Pezmc Pezmc reopened this Aug 22, 2011

@Pezmc Pezmc closed this Aug 22, 2011

@Pezmc Pezmc reopened this Aug 22, 2011

Owner

nibsirahsieu commented Aug 22, 2011

This plugin does not depend on sfGuardPlugin, so that users who do not use sfGuardPlugin can still use this plugin

Pezmc commented Aug 22, 2011

I see, would it be possible for me to convert it so that the user information comes from sfGuardPlugin?
Would you mind giving me a couple of pointers as to what I would need to change, I'll try my best and update you?

P.s. Thank you very much for your time and support so far.

Owner

nibsirahsieu commented Aug 22, 2011

Yes of course, if you have a sfGuardUserProfile class, you can fill the fields with: getUser()->getProfile()->getName() etc. But your profile class must provide the 4 functions above. Because the fields are used for email notification.

Pezmc commented Aug 22, 2011

So it is a case of modifying the form to not present those fields and then using my getUser command to populate them instead?

Owner

nibsirahsieu commented Aug 22, 2011

Yes.. those fields are automatically filled when the current user logged in reply a comment

Pezmc commented Aug 22, 2011

Where in the source are those fields automatically filled in? In my case even though I am logged in on the frontend, if I leave a comment the user_id column is null?

Pezmc commented Aug 22, 2011

I think perhaps we are talking cross purpose.

I am trying to set this plugin up on a login only website, as in users are logged in already before they make a comment.
So when they go to make a comment they aren't asked their name because the system already knows it?

This isn't related to admin as far as I am aware.

Sorry for the confusion,

Owner

nibsirahsieu commented Aug 22, 2011

oh i see your point.. sorry for misunderstanding :). You can fill those fields in the sfNestedCommentForm's updateDefaultsFromObject() function

i mean sfNestedCommentFrontForm

Owner

nibsirahsieu commented Aug 22, 2011

i will add these features, i'm stil working on these.. i will update the repo ASAP.. thanks.

Pezmc commented Aug 22, 2011

Sounds a very good idea! Thank you very much! Keep me posted.

Owner

nibsirahsieu commented Aug 22, 2011

hi.. i've updated the repo. Here are the changes a7d9400 .

Owner

nibsirahsieu commented Aug 22, 2011

But your myUser.class.php must provide the 4 functions above. Let me know if this the one you expected.

Pezmc commented Aug 22, 2011

This works well! Unfortunately I am now having problems with the JS? See new issue, sorry to be such a hassle!

@Pezmc Pezmc closed this Aug 22, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment