Advertisement:

Author Topic: redirect to "url" after login with facebook  (Read 2481 times)

Jeffe

  • Newbie
  • *
  • Posts: 17
redirect to "url" after login with facebook
« on: May 07, 2015, 06:48:32 pm »
hi,
I want facebook login to redirect  to dashboad after login .
Can you help me please ?
I have the Last version of osclass !

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: redirect to "url" after login with facebook
« Reply #1 on: May 16, 2015, 01:06:48 am »
:) That is actually one of the things I would still like to do as well.
At this moment it is hard to see if login through Facebook login was succesfull.... unless someone beats me to it here I'll see what I can come up with

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: redirect to "url" after login with facebook
« Reply #2 on: May 16, 2015, 02:50:26 am »
Got it! :)

1) In the plugin folder find the file OSCFacebook.php
2) On line 121 replace
"header( 'Location: ' . osc_base_url() );"
with
"header( 'Location: ' . osc_user_profile_url() );"


2) On line 91 you see this code
Code: [Select]
return self::$facebook;     Move this line down using enter key and place this code
Code: [Select]
header( 'Location: ' . osc_user_profile_url() ); on line 91
     Saven & Close this file

Now, open the index.php file in the plugin folder.
The plugin is setup in such a way that the init function is loaded with every page load, this is not needed and since we want a working relocation we will add an if statement.

Replace the function called 'fbc_init()' with this function:
Code: [Select]
    function fbc_init() {
//Let's check if we're on login page, if not no need for init
if(osc_is_login_form()) {
$facebook = OSCFacebook::newInstance()->init();
}
    }

It works for me, let me know if you run into issues.


Regards,
Eric
« Last Edit: May 17, 2015, 02:53:23 am by SmaRTeY »

fre2mansur

  • Hero Member
  • *****
  • Posts: 711
Re: redirect to "url" after login with facebook
« Reply #3 on: September 21, 2015, 10:32:51 am »
not working

The page isn't redirecting properly

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: redirect to "url" after login with facebook
« Reply #4 on: September 21, 2015, 10:19:33 pm »
I have given up on this plugin, sorry :)