3
votes

I have managed to get a system working for logging to our site from Facebook, twitter, google etc.. It is a modified version of the wordpress social login plugin.

It was fetching email addresses from the social networks and adding them into the user accounts on our system. Now it is not. It is adding an email address a bit like this one.. [email protected]

How do I get it to fetch the proper address again.

It is true that I was tinkering with settings that made the email address and user name the same, however it overrode the username with the email field and not the other way around.

EDIT---

I have undone my tinkering, but it is still doing this. I am checking for other script interference and am deleting all erroneous social integrations unrelated to this. So far no results.

BY THE WAY --

example.com is really what it is saying, that is not code for my or anyone else's domain.

FURTHERMORE --

I have found these lines in one of the folders. Evidently it cannot be fetching the emails as this is what we are getting instead.

// generate an email if none
        if ( ! isset ( $user_email ) OR ! is_email( $user_email ) ){
            $user_email = strtolower( $provider . "_user_" . $user_login ) . "@example.com";
        }

        // email should be unique
        if ( email_exists ( $user_email ) ){
            do
            {
                $user_email = md5(uniqid(wp_rand(10000,99000)))."@example.com";
            } while( email_exists( $user_email ) );
        }

Evidently that is creating our phantom email address, the question is then why is it not getting the correct one from the social network.

Any Ideas?

1
I think it would be helpful to know what example.com is exactly?Pekka
My apologies.. It is actually example.com It is not short for my domain or anyone else's they are all saying [email protected]RIK

1 Answers

0
votes

The problem is being caused by repetitive information. The plugin uses the user name from social networking sites. Since that is predominantly the email address that is the data it retrieves.

In test mode the accounts being tested from these social networks used email addresses already registered with the site. Thus it was detecting that they already existed and assigning a randomly generated procedural number which is what it should do if no email address is supplied. This is actually very clever. A shame it has taken half a day to work out.

So if the email address is unique it works perfectly fine.

Another user registered whilst we were in test mode. This lead to investigations. Much to the annoyance of Facebook we set of 4 accounts for testing with unique email address and all worked perfectly.

Now that Twitter has confirmed to be correct to we know the rest are fine.

SOLUTION....

Make sure there is no repeated email addresses in user account.