Jump to:

10845 Posts in 2513 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » facebookconnect-silverstripe

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3
Go to End
Author Topic: 3690 Views
  • dacar
    Avatar
    Community Member
    168 Posts

    Re: facebookconnect-silverstripe Link to this post

    Hi nimeso,

    unfortunately not.

    @willr: i am not using SSL. It is facebook, who usese SSL: 0 => 'https://graph.facebook.com/me'. Is there anybody who got this working?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: facebookconnect-silverstripe Link to this post

    Add the following line before any FB-calls are being issued (preferably just one line before you do new Facebook(...))

    Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;

    Worked for me, although I don't use Willrs FacebookConnect class.

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: facebookconnect-silverstripe Link to this post

    hi banal,

    i have tried your suggestion and put CURLOPT_SSL_VERIFYPEER => false to line 92 in facebookconnect/code/client/Facebook.php:

    /**
    * Default options for curl.
    */
    public static $CURL_OPTS = array(
    CURLOPT_CONNECTTIMEOUT => 10,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 60,
    CURLOPT_USERAGENT => 'facebook-php-2.0',
       CURLOPT_SSL_VERIFYPEER => false,
    );

    Then i get an error in my logs:
    [05-Oct-2010 10:58:10] PHP Fatal error: Call to undefined method Group::add_to_group_by_code() in /home/www/22/42/cwflade549/facebookconnect/code/FacebookConnect.php on line 216

    in 216 of FacebookConnect you will find the following:

    if($groups = self::get_member_groups()) {
                      foreach($groups as $group) {
                         Group::add_to_group_by_code($member, $group);
                      }
                   }

    Without Group::add_to_group_by_code($member, $group); the Login works.

    Questions:
    1. I have set FacebookConnect::set_member_groups('facebook-members'); in my _config.php. Why can't i add the member to the db?
    2. If i use the "login as an other user" Button, i get the following, but why?


    3. If i use the "login as an other user" Button from the facebook tab, i get the following, but why?

    The action 'FacebookLoginForm' does not exist in class Security

    by the way: have you seen the new social media featrures on http://www.samsung.com/us (at the bottom of the page). This would be cool features for a modul.

    Greetings, Carsten.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: facebookconnect-silverstripe Link to this post

    Hey Carsten

    I'm sorry, I can't help you out with the FacebookConnect code, since I never used it before. I'm using the facebook class directly in a current project.
    Apparently the CURLOPT_SSL_VERIFYPEER option seem to have helped.
    Maybe Willr can give you a hint regarding the issues with Group.

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: facebookconnect-silverstripe Link to this post

    Questions:
    1. I have set FacebookConnect::set_member_groups('facebook-members'); in my _config.php. Why can't i add the member to the db?
    you have to change it to: $member->addToGroupByCode($member, $group); to make it work!

    2. If i use the "login as an other user" Button, i get the following, but why?

    [User Warning] Already directed to https://www.facebook.com/logout.php?api_key=155555175293223&next=http%3A%2F%2Fwww.flavourtripping.de%2FSecurity%2FLoginForm&session_key=2.TRU355555mQjU1C8YvG5g__.3600.1286276400-1513896489; now trying to direct to http://www.flavourtripping.de/Security/Login

    There seems to be a problem with $backURL in FacebookLoginForm.php?!

    3. If i use the "login as an other user" Button from the facebook tab, i get the following, but why?

    The action 'FacebookLoginForm' does not exist in class Security

  • nimeso
    Avatar
    Community Member
    17 Posts

    Re: facebookconnect-silverstripe Link to this post

    Figured this out if anyone is wants to know....

    you need to add

    $opts[CURLOPT_SSL_VERIFYPEER] = false;

    in the makeRequest() method of FaceBook.php

    so it looks like

    protected function makeRequest($url, $params, $ch=null) {
    if (!$ch) {
    $ch = curl_init();
    }

    $opts = self::$CURL_OPTS;
    $opts[CURLOPT_SSL_VERIFYPEER] = false; // Add this in

  • banal
    Avatar
    Community Member
    901 Posts

    Re: facebookconnect-silverstripe Link to this post

    @nimeso
    If you would have read the previous posts, you could have noticed that we figured that out already

    Btw: Usually you should avoid changing third party libs like the Facebook class because all your changes will be lost whenever you upgrade to a new version. That's why options like CURLOPT_SSL_VERIFYPEER are made static and can be changed from outside the code. So in your Code, you can set:

    Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;

    before you issue any Facebook calls. This can be in Page.php or anywhere else and you don't have to modify facebook.php directly.

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: facebookconnect-silverstripe Link to this post

    @willr: do you have an idea about the last two problems i have withe your facebooc-connct?

    1. If i use the "login as an other user" Button, i get the following, but why?

    [User Warning] Already directed to https://www.facebook.com/logout.php?api_key=155555175293223&next=http%3A%2F%2Fwww.flavourtripping.de%2FSecurity%2FLoginForm&session_key=2.TRU355555mQjU1C8YvG5g__.3600.1286276400-1513896489; now trying to direct to http://www.flavourtripping.de/Security/Login

    There seems to be a problem with $backURL in FacebookLoginForm.php?!

    2. If i use the "login as an other user" Button from the facebook tab, i get the following, but why?

    The action 'FacebookLoginForm' does not exist in class Security

    3690 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.