Topic-icon Assign Jomsocial user points on registration

Active Subscriptions:

None
9 years 11 months ago #44487 by leitura
Hello,

When users register using Facebook or Gmail they are not getting assigned with Jomsocial user points. I use Jomsocial flow for registration and when user goes throught that it gets assigned the points normaly. Would you help me to give those points also to Facebook and Gmail users? They are the most important and those I want to push to register. Thank you!
The topic has been locked.
Support Specialist
9 years 11 months ago #44514 by alzander
We'll have to look into why this isn't working. I just looked at our JomSocial plugin and there is a line in there to assign points during the registration flow but it's possibly either a) older code for an earlier JomSocial release or b) not the proper method for assiging points at registration. The code mentions assigning points for 'profile.save', which seems off for registration.

Either way, can you let us know what version of JomSocial you're using? We'll gladly help investigate further.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #44567 by leitura
Hi Alex, thanks for you reply, I was so waiting for your answer and I thought it only now!

I would bet on choice a) since after update Jomsocial I noticed changes on com_community/controllers/register.php which is the file that assign points on registration.

I'm using Joomla 2.5.14 + Jomsocial 3.2.0.5 + JFBConnect 6.0.6

Thanks a lot if you can give me a workaround everyday I need to manualy credit points to all users coming from JFBConnect (and luckly they are becoming many!)

Thanks again

Adry
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #44667 by leitura
Hi Alex, maybe you have any news about this?

Thanks again!
The topic has been locked.
Support Specialist
9 years 11 months ago #44678 by alzander
Sorry for the delayed response. We were able to look into this issue and think we've found the cause. It seems like a change in the authentication flow is not properly recognizing the user when the points are to be awarded. It should be a simple thing to fix though.

Can you edit the /plugins/socialprofiles/jomsocial/jomsocial.php file. In there, around line 370, you'll see the following block of code:
if ($saveSuccess)
        {
            CFactory::load('libraries', 'userpoints');
            CUserPoints::assignPoint('profile.save');
        }
Can you simply update the assignPoint line to:
CUserPoints::assignPoint('profile.save', $this->joomlaId);
Please test and let us know how that goes. From a quick test on our end, that seems to properly award points. We'll test further and plan to include this change in the next release. We'd love to have your feedback as well though.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #44711 by leitura
Hi Alex,

Thanks a lot for your help.
I have being changing the indicated file and making tests, but in my case no points are being yet assigned.. :(
That happens with Facebook and Google users (the only two I'm using)
I have changed components/com_community/controllers/register.php to assign 20 points instead of 2 on the registration. I think this is not the problem, but just in case it's relevant. Are your loginc picking number of points to assign from this file, right?

Any other ideas?
The topic has been locked.
Support Specialist
9 years 11 months ago #44720 by alzander
Ahh.. Looking at that code, they're not even using their standard point reward system.. they're just directly assigning points. If that's the case, you should be able to update the 4 lines of code I initially posted above with this minorly modified code from the register.php file you mentioned:
if ($saveSuccess) 
{ 
        // @rule: increment user points for registrations.
        $my->_points += 2;

        // increase default value set by admin (only apply to new registration)
        $config = CFactory::getConfig();
        $default_points = $config->get('defaultpoint');

        if (isset($default_points) && $default_points > 0) {
            $my->_points += $config->get('defaultpoint');

        $my->save();
}
I haven't had the chance to test that directly, but it should hopefully get you going right now. Keep me posted.

Alex
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #44730 by leitura
Hi Alex,

Awesome! Tested and working like a charm, no issues (using Facebook and Google).

Thanks a lot!

Adry
The topic has been locked.
Support Specialist
9 years 11 months ago #44778 by alzander
Thanks for the feedback. We've implemented and are testing that change for the 6.1 release of JFBConnect, due later this month. Seems to be working so far.

If you run into anything else, please let us know.

Finally, if you haven't already, please consider leaving a rating and review for JFBConnect, or our support, on the Joomla Extension Directory. It certainly isn't required, but is very appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Alex
The topic has been locked.