× Joomla Facebook Connect support forum

Topic-icon Default extended permissions

Active Subscriptions:

None
13 years 4 months ago #6094 by playak
It would be great if we could set the required minimum default extended permission in the backend. i built a component that uses the connection made by jfbconnect, but since my component does a lot more than logging in (e.g. photos and events synchronisation), and I prefer to ask for those permissions only once, I changed a line of code in libraries/facebook.php:
        $mainPerms = "";
        // joempie added next. see http://developers.facebook.com/docs/authentication/permissions
	$mainPerms .= "user_events,user_hometown,user_website,user_website,user_status,user_photos,user_videos,user_about_me,user_activities,create_event,rsvp_event,user_groups,";
would be better if I could set that list from the backend somehow.

cheers,
jeroen
The topic has been locked.
Support Specialist
13 years 4 months ago #6095 by alzander
We've thought about that before. It likely won't be in the 3.1 release, but it will probably make it into one of the 3.1.x releases. The reason I say that is in 3.1, we're changing our Javascript around entirely, and plan to make it much easier to put some code for a pop-up box to update the user's Facebook status message, or things like that. It won't be there right away with 3.1, but the foundation will be there for easier enhancements like that going forward.

Thanks for the feedback, we're definitely taking note of it.
The topic has been locked.
Support Specialist
13 years 1 week ago #8774 by mel
Replied by mel on topic Default extended permissions
We've just released a new version of JFBConnect which allows for customizable permissions, in addition to the basic permission options already supported. To set this up, go to Components > JFBConnect > Configuration > Permissions. Here you can enter a comma-separated list of new permission values. We'll add those values to whatever permissions JFBConnect needs already. It should be just that simple, so please let us know if you have any issues with it.

Thanks!
The topic has been locked.
Active Subscriptions:

None
12 years 11 months ago #10074 by playak
Replied by playak on topic Default extended permissions
Good stuff. There is still an error. If a user removes all app permissions on the FB site, the JFBC login module ask to 'Reconnect this site to the new Facebook account?'.

This is strange already, as the Facebook account is not new at all.

But what's worse, if the user then clicks to reconnect, only basic permissions are asked for, so the required extended permissions will not be restored.

Using J1.5.23. JFBC 3.2.1, JFBCLogin 3.2.1.
The topic has been locked.
Support Specialist
12 years 11 months ago #10080 by alzander
Playak,
There's 2 reasons for the behavior your mention, both are intended, but I can see why you think the 2nd one is incorrect behavior:
1) Showing the "Reconnect this site to new Facebook account" is shown simply because, although the user mapping for that Joomla user to a Facebook account exists, since they've deleted the app, we can't get any information about their Facebook profile. Therefore, we ask them to reconnect. Without that, the mapping is meaningless, so this step is necessary.
2) During a reconnect, yes, we only ask for the basic information. However, if they ever login with Facebook in the future, any extra required/optional permissions will be asked for. At this time, their profile will be updated with new information. I can see how this may be improved, but it's never been brought to our attention before. I've taken a note to add the required/optional permissions prompt to the reconnect button as well.

Hope this helps explain the process, and if you have any suggestions for improvement, definitely let us know!
The topic has been locked.
Active Subscriptions:

None
12 years 11 months ago #10082 by playak
Replied by playak on topic Default extended permissions
Thanks Alex.

1. Not many Facebook accounts are new, so I changed this in my language file to just ask 'Reconnect to Facebook account?' instead of '... new Facebook account'. Just makes more sense I think.

2. Will be a lot less confusing if the same permissions are asked for each time. I'll hack this into my login module right away, would be great if it were standard behavior in the next official version.

Cheers,
Jeroen
The topic has been locked.
Support Specialist
12 years 11 months ago #10092 by alzander
1) Updated text - Makes sense, that's also why it's in the language file, to make it easier to modify.
2) It will be in an upcoming big release (not a minor point release), but we agree this could be better. If you need help hacking it in, just let us know!

Alex
The topic has been locked.
Active Subscriptions:

None
12 years 11 months ago #10108 by playak
Replied by playak on topic Default extended permissions
In modules/mod_jfbclogin/tmpl/default.php, I added one line, and changed 2 other lines, as below:
            // joempie added $perms, also echo twice after v="2" below
			$perms = 'perms="'.$fbClient->configModel->getRequiredPermissions().'"';
            if (!$mappedUserId)
            {
        ?>
		<div class="fb_connect_user"><?php echo JText::_('Connect User'); ?></div>
		<fb:login-button v="2" <?php echo $perms;?> onlogin="javascript:jfbc.login.login_button_click();"><?php echo JText::_('MAP BUTTON'); ?></fb:login-button>
	<?php } else if($params->get('allowReconnections') && $mappedUserId != $fbId){ ?>
		<div class="fb_connect_user"><?php echo JText::_('Reconnect User'); ?></div>
		<fb:login-button v="2" <?php echo $perms;?> onlogin="javascript:jfbc.login.login_button_click();"><?php echo JText::_('REMAP BUTTON'); ?></fb:login-button>

Seems to do the trick...
The topic has been locked.
Support Specialist
12 years 11 months ago #10124 by alzander
Yup, that should be all that's required. Pretty simple, and sorry to make you dig through code to do it on your own!
The topic has been locked.