Topic-icon Cannot Login With Facebook

Active Subscriptions:

None
13 years 5 months ago #28685 by eileenod
I attempted to login with my facebook authorization ("O'Donnell") and received the error:

Please enter a valid username. No spaces, at least 2 characters and must not contain the following characters: \ " ' % ; ( ) &
The topic has been locked.
Support Specialist
13 years 5 months ago #28691 by alzander
Replied by alzander on topic Cannot Login With Facebook
I'm not sure what you mean.. where did you try to login with that name? Was that on the Joomla login form or in the Facebook popup box?

Do you have automatic registration enabled, and that was an error you got when the automatic name was created, or was that error from somewhere else?

We'll gladly help you narrow down the issue, and fix it if it's a problem with JFBConnect, but we just need to know more about what's happening.

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

None
13 years 5 months ago #28702 by eileenod
Replied by eileenod on topic Cannot Login With Facebook
Yes I succeeded in providing as little information as possible (at least I was successful at something :D --- well also with your product which is performing as advertised with great support).

The problem occurred at this URL when selecting the blue "Login with Facebook" button. demo.sourcecoast.com/index.php?option=co...icle&id=1&Itemid=110

My name has an apostrophe so I assumed that was the problem.
File Attachment:
The topic has been locked.
Support Specialist
13 years 5 months ago #28706 by alzander
Replied by alzander on topic Cannot Login With Facebook
Well that is incredibly interesting to hear. It sounds like our auto-username generation can fail if the user's name has those characters in it. We've honestly never heard of that problem before, but it's something that should be very easy to fix now that we've heard of it.

A fix will be in the next release of JFBConnect and we can (over the next few days) supply you with a fix once we finalize exactly what needs to be done.

Sorry for the problem, and thanks so much for the report!

Alex
The topic has been locked.
Active Subscriptions:

None
13 years 5 months ago #28787 by eileenod
Replied by eileenod on topic Cannot Login With Facebook
Thank you for professional support. I will await word from you on exactly what needs to be done...
The topic has been locked.
Support Specialist
13 years 5 months ago #28871 by alzander
Replied by alzander on topic Cannot Login With Facebook
eileenod,
Just wanted to get back to this. We've added some code for our upcoming release which will strip out any of the 'special' symbols that Joomla doesn't like from a user's first and last names before generating their automatic username. The updated code is below, if you'd like to test and implement it now. Otherwise, it will be in the next release which should be out within a week or so.

To make the change, edit the /libraries/sourcecoast/utilities.php file. Around line 450, you'll see the getAutoUsername function. Modify the top of the function and add 4 lines so it looks like:
static function getAutoUsername($firstName, $lastName, $email, $genericPrefixStr, $socialUserId, $usernamePrefixFormat)
    {
        // Scrub the first/last name for invalid characters that Joomla will deny:    # ADD THIS
        $stripChars = array('<', '>', '\\', '"', "'", '%', ';', '(', ')', '&');   # ADD THIS
        $firstName = str_replace($stripChars, '', $firstName);  # ADD THIS
        $lastName = str_replace($stripChars, '', $lastName);  # ADD THIS

        if ($usernamePrefixFormat == AUTONAME_EXT) //fb_ or li_
        {
Thanks again for the report. Silly issue that's easy to fix, we just weren't aware of it until now.

Feedback welcome, and best of luck,
Alex
The topic has been locked.