Jump to content
thejudge99

CONTRIBUTION Social Login with Facebook / Google 2.3.1/2

Recommended Posts

Hi Jules,

 

I thought I would have troubles with installing your work, but it actually worked out really nicely! Thanks for that!!

 

I use osCommerce 2.3.1.

 

I only need the facebook-login, so i decided to delete all datas with "google". Is it okay to do so?

 

Cause I've got a problem. I can sign into my page, but cannot view my account. This is the error that I get:

 

My Account Information

 

1054 - Unknown column 'valid_address' in 'field list'

 

select valid_address from customers_info where customers_info_id = '1'

 

[TEP STOP]

 

 

 

Have no idea what to do.

Share this post


Link to post
Share on other sites

Solved my problem, it was actually pretty obvious after sleeping a night over it... forgot to copy two lines in the step where you create the table in the database.

Works perfectly, thanks again Jules

Share this post


Link to post
Share on other sites

Hi Vivianeb - seems the sexytooltip update doesnt actually have a google button included ( looking at your own login pages source code ).

 

Also the Javascript rewrite script wont get called ( my crude way of determining is javascript is on ) so the login part will always try to make a php redirect instead of javascript close popup + refresh parent.

 

With Chrome it seems there is a 2nd minipopup using the jquery slide animation - as mentioned above - which requires a click on the "Log in" to login- but with explorer this doesnt happen.

 

This is the original javascript button rewriter

 

<script>
$('#wojnf,#wojnt').remove();  
$(".jqt").append('<a class="slogin" href="login.php?login&oauth_provider=facebook&js=1" name="windowX"><img src="images/fb_login.png"></a> <a class="slogin" href="login.php?login&oauth_provider=google&js=1" name="windowX"><img src="images/g_login.png"></a>'); 
</script>

 

which removes the 2 buttons completely then rewrites them both with the &js=1

 

from here

 

<a id="wojnf" class="slogin" href="login.php?login&oauth_provider=facebook" name="windowX"><img src="images/fb_login.png"></a> <a id="wojnt" class="slogin" href="login.php?login&oauth_provider=google" name="windowX"><img src="images/g_login.png"></a>
<div class="jqt"></div>

 

 

I would suggest re-adding those 2 code parts ( the later being the buttons themselves) and retest for functionality.

 

 

Jules

Share this post


Link to post
Share on other sites

This module can work under osc2.2 RC2A , I have install on one site. But need note some code different. Little change

 

can you post the code for 2.2 RC2A that you made?

thanks

Share this post


Link to post
Share on other sites

This module can work under osc2.2 RC2A , I have install on one site. But need note some code different. Little change

Could I also ask for the code you mentioned as I have a couple of RC2A sites I would like this on?

Thanks,

Paul.

Share this post


Link to post
Share on other sites

After installing this magnific add on (Congratulations Judge) I found i little mistake, at least it occurs to me.

 

When I try to log in with google, it gives me an error on the birthdate. It says that the date should follow a type **/**/****. After a little investigation, I found that I don't have my birth year public in google+, and the login system is reading my birthdate as **/**/0000. After I set my birth year as public, I found no mistakes.

 

Can anybody solve this problem?

My solution by now is hide the filed date of birth from every client, but I wanted to get that back.

Thanks

Share this post


Link to post
Share on other sites

Hi Jose - the social login is respecting the oscommerce setup - in that if you setup your oscommerce to require DOB then it will require it from google and facebook too. If you dont sell anything that requires you to know DOB (like to check if someone is over 18) then you can disable it in your oscommerce.

 

Jules

Share this post


Link to post
Share on other sites

Hello,

 

I installed your contribution in osCommerce 2.3.3 and found followwing issues:

 

1) I get this message when accessing to my store:

 

Warning: session_save_path() has been disabled for security reasons in /home/anclasol/public_html/prog/osc/web233/catalog/includes/functions/sessions.php on line 169

 

2) I cannot access to my admin area where shows followin messages:

 

Warning: session_save_path() has been disabled for security reasons in /home/anclasol/public_html/prog/osc/web233/catalog/PanelControl/includes/functions/sessions.php on line 165

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/anclasol/public_html/prog/osc/web233/catalog/PanelControl/includes/functions/sessions.php:165) in /home/anclasol/public_html/prog/osc/web233/catalog/PanelControl/includes/functions/sessions.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /home/anclasol/public_html/prog/osc/web233/catalog/PanelControl/includes/functions/sessions.php:165) in /home/anclasol/public_html/prog/osc/web233/catalog/PanelControl/includes/functions/general.php on line 38

 

3)After log in with Google I get following message:

 

There was an error with your Social Login attempt !

 

4) After log in with Facebook I get following messages:

 

Warning: session_save_path() has been disabled for security reasons in /home/anclasol/public_html/prog/osc/web233/catalog/includes/functions/sessions.php on line 169

 

Fatal error: Call to a member function restore_wishlist() on a non-object in /home/anclasol/public_html/prog/osc/web233/catalog/includes/login-facebook.php on line 78

 

I have installed Security Pro 2.0 r11 and made two exclusions: googleloader.php and login.php

I have also installed SiteMonitor but I don't think this means any problem as this program only send reports but don't take any action.

 

Is this contribution compatible with osCommerce 2.3.3 and if so, please, can you help me with this issues?

 

Thank you.

Share this post


Link to post
Share on other sites

Issue solved. The problem was with the function session_save_path() in php.ini file of my hosting server.

 

Now the contribution is working with the exception of the link "My Account" of the store front which is not working at all. Any idea about how to solve this issue?

 

Thank you for your help.

Share this post


Link to post
Share on other sites

Sorry but I had lost some code. Now is working properly.

Share this post


Link to post
Share on other sites

Hi Vivianeb - seems the sexytooltip update doesnt actually have a google button included ( looking at your own login pages source code ).

 

Also the Javascript rewrite script wont get called ( my crude way of determining is javascript is on ) so the login part will always try to make a php redirect instead of javascript close popup + refresh parent.

 

With Chrome it seems there is a 2nd minipopup using the jquery slide animation - as mentioned above - which requires a click on the "Log in" to login- but with explorer this doesnt happen.

 

This is the original javascript button rewriter

 

<script>
$('#wojnf,#wojnt').remove();
$(".jqt").append('<a class="slogin" href="login.php?login&oauth_provider=facebook&js=1" name="windowX"><img src="images/fb_login.png"></a> <a class="slogin" href="login.php?login&oauth_provider=google&js=1" name="windowX"><img src="images/g_login.png"></a>');
</script>

 

which removes the 2 buttons completely then rewrites them both with the &js=1

 

from here

 

<a id="wojnf" class="slogin" href="login.php?login&oauth_provider=facebook" name="windowX"><img src="images/fb_login.png"></a> <a id="wojnt" class="slogin" href="login.php?login&oauth_provider=google" name="windowX"><img src="images/g_login.png"></a>
<div class="jqt"></div>

 

 

I would suggest re-adding those 2 code parts ( the later being the buttons themselves) and retest for functionality.

 

 

Jules

 

A bit late on my part but thank you! Bit of a blind spot there ;)

Share this post


Link to post
Share on other sites

Hi ancla ,

glad you've sorted your problem out - its something ive never come accross so I would'nt have been able to off any advice. Good to know an something to remember for the future.

 

Jules

Share this post


Link to post
Share on other sites

Hi,

 

Am facing one problem on demo site. 1st time am login with my facebook then i logout from both oscommerce site and my facebook a/c too. After signout my FB i click again FB login on demo site, its getting logged automatically. I wonder how it is getting logged in 2nd time with out am logging to FB

Share this post


Link to post
Share on other sites

Hi marun ,

Short anwer - I dont know. This script is using the supplied API from facebook . What might be the cause is the TOKEN life ( terminology might be wrong) - in that logging in with this API generates some kind of token/session that has a lifespan - and subsequent logins within this lifespan will simply login without asking for login infos again. This obviously seems to ignore whether someone is actually logged into facebook or not.

 

Facebook API contacts facebook - asks if this persons login infos are correct - facebook replies with yes or no.

If yes facebook API on our oscommerce site creates this token .

 

This however is probably not the same as going to fxxxbook.com and loggin in.

 

Jules

Edited by thejudge99

Share this post


Link to post
Share on other sites

Hi, i found your addon and install it instead of login radius, thank you!!!

Facebook login works fine but Google login gives me the attached error directly when i click "Allow access". any help would be appreciated.

post-244988-0-81588000-1366850167_thumb.jpg

Share this post


Link to post
Share on other sites

Hi psytanium - it seems you dont have an SSL certificate installed on your webserver - Change the Google Setup to use only http and not https

Share this post


Link to post
Share on other sites

@@thejudge99 i have attached the config.php and my google api console.

 

btw, the website is modified to redirect the user to the login page if he is not logged in. users have to be logged in to browse the other pages.

but facebook login works fine.

 

again, thank you!

post-244988-0-59498000-1367310622_thumb.jpg

post-244988-0-37010900-1367310639_thumb.jpg

Share this post


Link to post
Share on other sites

i found the problem but couldn't solve it, both logins are working fine, fb and google.

 

but in my website, i have a string of code in application_top.php, that redirect users to the login page if they are not logged in:

 

//-- Login redirect
 // check if login or register page is accessed
$file_name = basename($_SERVER['PHP_SELF'], ".php");

// if file name matches any of continue
if(( strncasecmp($file_name, "login", 5) == 0) ||( strncasecmp($file_name, "create_account", 14) == 0) || ( strncasecmp($file_name, "create_account_success", 22) == 0) ||( strncasecmp($file_name, "password_forgotten", 22) == 0)){
			 // dont do any thing  
			 // let them login or create account
}elseif (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }
//-- End login redirect

 

when i remove this code, google login work fine.

do you think there is a way to keep both addons ? (login redirect and social login)

Share this post


Link to post
Share on other sites

nevermind, i craeted another application_top.php file, rename it application_top_google_log.php and removed the login redirect code from it.

 

in googleloader.php changed

require('includes/application_top.php');

to

require('includes/application_top_google_log.php');

 

this way, both addons works fine.

 

thank you for this addon, it is fully adjustable and customizable.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×