× Joomla Facebook Connect support forum

Topic-icon Access Level: author

Active Subscriptions:

None
13 years 6 months ago #5343 by pierdonato
Hi, you can register as an author users who register with Facebook?
What should i change?
Thanks.
The topic has been locked.
Support Specialist
13 years 6 months ago #5354 by alzander
Replied by alzander on topic Access Level: author
I'm assuming you're using the "Facebook User Only" user creation option? Just want to make sure first, before we give a full answer, because for that, we'd have to do a little testing.

For the "Full Joomla User" setting, it should use whatever you have set in your Global Configuration area as the setting for "New User Registration Type".

If you're looking for something different, where FB users only are Authors, and Joomla users are registered (or something like that), let us know, and we'll try to help you figure that out too.
The topic has been locked.
Active Subscriptions:

None
13 years 6 months ago #5358 by pierdonato
Replied by pierdonato on topic Access Level: author
Yes, the option only for facebook users.
The topic has been locked.
Support Specialist
13 years 6 months ago #5371 by alzander
Replied by alzander on topic Access Level: author
There's no way to selectively make Facebook users into one group, while everyone else goes into another. Here's some code you can change to do what you're looking for. This is all assuming you're using the "Full Joomla User" setting, if not, please let us know.

In the /components/com_jfbconnect/controllers/loginregister.php file, find and alter the following lines:
Line 43:
$newUserType = $userConfig->get('new_usertype');
Change to:
$newUserType = "Author";

And on line 62, change:
$user->set('gid', $ACL->get_group_id('', $newUserType, 'ARO'));
To:
$user->set('gid', 19);

Test these changes to ensure they have the desired effect!

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

None
13 years 6 months ago #5378 by pierdonato
Replied by pierdonato on topic Access Level: author
Not working.
I changed:
$newUserType = "Author"; It should not be 'Author'? I tried both ways but I did not get changes.
// $newUserType = $userConfig->get('new_usertype');

I should not change even here 'Registered' in 'Author'? I tried both ways but I did not get changes.
if (!$newUserType)
$newUserType = 'Registered';

$userVals = $fbUserProfile." ".$fbUserProfile;
$userVals = $username;
$userVals = $email;
$userVals = $password;
$userVals = $password;

$user = JFactory::getUser();
if (!$user->bind($userVals))
{
$mainframe->enqueueMessage("Unable to bind user", 'error');
$mainframe->redirect(JRoute::_('index.php?com_jfbconnect&view=loginregister', false));
}

$user->set('id', 0);
$user->set('usertype', ''); here should not change in: $user->set('usertype', 'Author');

// $user->set('gid', $ACL->get_group_id('', $newUserType, 'ARO'));
$user->set('gid', 19);

$user->set('block', 0);

if (!$user->save())
{
$mainframe->enqueueMessage("Unable to save user. Please try again and ensure that your username and email address are not already taken.", 'error');
$mainframe->redirect(JRoute::_('index.php?com_jfbconnect&view=loginregister', false));
}
The topic has been locked.
Support Specialist
13 years 6 months ago #5385 by alzander
Replied by alzander on topic Access Level: author
What is your setting for "Create New Users" in the admin area? If it's not Full Joomla Users, the above is not your solution. Let us know.

If users are created with names like fb_12345, then we'd need to determine a different way to do what you're looking for.

Thanks
The topic has been locked.
Active Subscriptions:

None
13 years 6 months ago #5394 by pierdonato
Replied by pierdonato on topic Access Level: author
My setting is only facebook users, can you do?
The topic has been locked.
Support Specialist
13 years 6 months ago #5401 by alzander
Replied by alzander on topic Access Level: author
Yeah, we can do this. It will take a little more investigation, which is why I asked above before I posted the lengthy method to do it. We'll post here once we figure out a solution.

We're going to be adding Joomla 1.6 support in an upcoming release, which has multiple user levels, so this is something high on our list to determine the best method now anyways.
The topic has been locked.