• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] login with facebook

Started by arpit,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arpitTopic starter

Hi,
i upgraded phpvibe 3.6 to 4 now when clicked login with facebook i am getting this error

Notice: Undefined variable: user_profile in /home/visuaoqv/public_html/callback.php on line 51

Notice: Undefined index: id in /home/visuaoqv/public_html/callback.php on line 59

Notice: Undefined index: name in /home/visuaoqv/public_html/callback.php on line 60

Notice: Undefined index: username in /home/visuaoqv/public_html/callback.php on line 61

Notice: Undefined index: email in /home/visuaoqv/public_html/callback.php on line 62

Notice: Undefined index: email in /home/visuaoqv/public_html/callback.php on line 65

Notice: Undefined index: bio in /home/visuaoqv/public_html/callback.php on line 66

Notice: Undefined index: gender in /home/visuaoqv/public_html/callback.php on line 67
Error. Please go back

what should i put in Valid OAuth redirect URIs in facebook???
gmail login is working fine
  •  

PHPVibe A.

Hi! I assume your domain or nothing, since the exact url for the callback is passed by PHPVibe on login trigger.

Go to status and review on your app, it will tell you if there are any problems with the app.

https://www.youtube.com/watch?v=C_R4WK8DDag

arpitTopic starter

Hi, i tried to review but it wont allowed i assume since i setup facebook login app 2 days ago n yes i have setup app same as video still not working getting the same error help???
  •  

arpitTopic starter

tried setup another app now getting this error

Notice: Undefined index: username in /home/visuaoqv/public_html/callback.php on line 61

Notice: Undefined index: bio in /home/visuaoqv/public_html/callback.php on line 66
  •  

PHPVibe A.

Ok, this is the notice, it's pretty harmful (if for example the facebook user has no user name), but what's the actual error?
Where does the processing stop?

arpitTopic starter

when i fill email and password on facebook page and click on login it shows this error
  •  

PHPVibe A.

Can I see a copy of your error_log?


PHPVibe A.

Ok, so the error is this

CSRF state token does not match one provided.


I've read somewhere that from some $_REQUEST['state'] fails, returning ON and not the token.

Try this web solution (found it on Google):


Facebook SDK code has a bug when checking against tokens twice in the same handler.

I edited the getCode function of facebook.php like this:

protected function getCode() {
    if (!isset($_REQUEST['code']) || !isset($_REQUEST['state']) || $this->state === null) {
      return false;
    }
    if ($this->state === $_REQUEST['state']) {
        // CSRF state has done its job, so clear it
        $this->state = null;
        $this->clearPersistentData('state');
        return $_REQUEST['code'];
    }
    self::errorLog('CSRF state token does not match one provided.');

    return false;
}

to be more clear and does not state invalid token if called twice.

To be clear the function can be called twice on the same url handler if eg:

$facebook->getUser(); and then in the same handler $facebook->getLogoutUrl() then the getCode() is called twice thus resulting into and invalid error message

PHPVibe A.

lib/facebook/ is the sdk folder in PHPVibe.

arpitTopic starter

Hi,
There is no getcode function in lib/fb/facbook.php but i find it in lib/fb/base_facebook.php and i replaced it with this code but still getting the same error

Notice: Undefined index: username in /home/visuaoqv/public_html/callback.php on line 61

Notice: Undefined index: bio in /home/visuaoqv/public_html/callback.php on line 66

this is error_log
https://docs.google.com/document/d/1Q_SukGiUThZLHYdsBudL2m7emwFYjcj_dhsE-0aJm3o/edit?usp=sharing
  •  

PHPVibe A.

There's a code error:

PHP Parse error:  syntax error, unexpected '}' in /home/visuaoqv/public_html/lib/fb/base_facebook.php on line 707


Clear your error_log, so you don't have older errors.

arpitTopic starter

there was this syntax error but i correct it now only these error

Notice: Undefined index: username in /home/visuaoqv/public_html/callback.php on line 61

Notice: Undefined index: bio in /home/visuaoqv/public_html/callback.php on line 66
  •  

PHPVibe A.

The notice basically says that it gets no result back from the facebook api when asking for the details.
It's not very conclusive, it doesn't show the error. Make sure the app is live, public and ok.

arpitTopic starter

okay i'll check that and i also change my timezone but it still not showing the proper time
  •  

PHPVibe A.

That depends on the timezone config in both PHPVibe and server.

arpitTopic starter

  •  

arpitTopic starter

  •  

PHPVibe A.

These are the block's titles, in admin -> Homepage

arpitTopic starter

Yes i know but i want to give them <a> tag where in the code i can do that
  •  

PHPVibe A.


arpitTopic starter

Sorry but that code has been outdated not working for phphvive 4 Please help.......
  •  

PHPVibe A.

Quote from: arpit on
Sorry but that code has been outdated not working for phphvive 4 Please help.......

Oh, I've noticed now.
I'll build an updated one, but for now have a ton of other priorities which are overdue.

Similar topics (7)