Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

CONTRIBUTION Social Login with Facebook / Google 2.3.1/2


thejudge99

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.

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
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.

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
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

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
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.

Link to comment
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 ;)

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
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
Link to comment
Share on other sites

  • 1 month later...

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)

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...