Results 1 to 5 of 5

Thread: Facebook redirection rears its ugly head again

  1. #1
    Senior Member
    Join Date
    Nov 2006
    Posts
    140

    Default Facebook redirection rears its ugly head again

    Hey Brian, just updated my dev site to 4.1.1 and immediately noticed it was forcing me to log in via Facebook. Based off the previous ticket I had opened, I was able to find and correct the issue.

    In the Query Page Data plugin we have:
    Current, Incorrect

    Code:
    if ((do_facebook_redirect() AND 
                ($vbulletin->userinfo['userid'] AND $vbulletin->userinfo['fbuserid'] != vB_Facebook::instance()->getLoggedInFbUserId())
                OR (!$vbulletin->userinfo['userid'] AND !vB_Facebook::instance()->getVbUseridFromFbUserid()))
            )
    Corrected (removed first paren and moved it down in front of the $vbulletin variable)
    Code:
    if (do_facebook_redirect() AND 
                (($vbulletin->userinfo['userid'] AND $vbulletin->userinfo['fbuserid'] != vB_Facebook::instance()->getLoggedInFbUserId())
                OR (!$vbulletin->userinfo['userid'] AND !vB_Facebook::instance()->getVbUseridFromFbUserid()))
            )

  2. #2
    Administrator Brian's Avatar
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,434

    Default

    Thank you for pointing this out. I'm not sure how that change got left out, but I've went ahead and updated the install file in the download package here to include the correct code so it shouldn't be an issue for future installs.
    Frequently Asked Questions
    CMPS Users Manual

    For vBadvanced software assistance, please use the support forums.
    Unsolicted PMs, IMs, and email will not be responded to.
    If you have a non-software related question or problem with your account, please submit a support ticket.

  3. #3
    Twisted Monkey
    Join Date
    Apr 2005
    Location
    California, USA
    Posts
    138

    Default

    Having the same issue.

    Can you explain where I can make this tweak myself without having to reload vBa? I just upgraded last week and really don't want to do it again if it's a simple tweak I can go make.

    Please and thank you.

  4. #4
    Administrator Brian's Avatar
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,434

    Default

    Just go to Admin CP => Plugins & Products => Plugin Manager, edit the plugin called 'Query Page Data', and replace the 'Plugin PHP Code' with the following:
    PHP Code:
    if (defined('VBA_PORTAL'))
    {
        
    // ##### Facebook Redirect
        
    if (THIS_SCRIPT == 'adv_index' AND function_exists('is_facebookenabled') AND is_facebookenabled() AND $show['facebookuser'] = vB_Facebook::instance()->userIsLoggedIn())
        {
            if (
    do_facebook_redirect() AND 
                ((
    $vbulletin->userinfo['userid'] AND $vbulletin->userinfo['fbuserid'] != vB_Facebook::instance()->getLoggedInFbUserId())
                OR (!
    $vbulletin->userinfo['userid'] AND !vB_Facebook::instance()->getVbUseridFromFbUserid()))
            )
            {
                
    exec_header_redirect($vbulletin->options['bburl'] . '/register.php' $vbulletin->session->vars['sessionurl_q']);
            }
        }

        global 
    $phrasegroups;

        
    // Figure out which page to grab
        
    $pagevar false;
        if (
    THIS_SCRIPT == 'adv_index')
        {
            
    $pagevar $vbulletin->adv_portal_opts['adv_portal_main']['portal_pagevar'];
        }

        if (
    defined('VBA_PAGE'))
        {
            
    $getpage VBA_PAGE;
        }
        else if(
    $pagevar AND isset($_REQUEST[$pagevar]))
        {
            
    $getpage $_REQUEST[$pagevar];
        }
        else
        {
            
    $getpage 'home';
        }

        
    $initialize_dynamics false;

        (
    $hook vBulletinHook::fetch_hook('vba_cmps_include_getpage')) ? eval($hook) : false;

        
    // ##### Now grab the page
        
    if ($getpage == 'home')
        {
            
    $pages =& $vbulletin->adv_portal_home;
        }
        else
        {
            
    $pages $db->query_first("
                SELECT *
                FROM " 
    TABLE_PREFIX "adv_pages
                WHERE name = '" 
    $db->escape_string($getpage) . "'
                    " 
    iif(!($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']), 'AND active = 1')
            );

            
    $pages['modules'] = unserialize($pages['modules']);
            
    $pages['userperms'] = explode(','$pages['userperms']);
            
    $pages['advanced'] = unserialize($pages['advanced']);
            
    $pages['meta'] = unserialize($pages['meta']);
        }

        
    $vbulletin->adv_pages =& $pages;

        if (!empty(
    $pages['modules']))
        {
            foreach (
    $pages['modules'] AS $pagecol => $pagemodules)
            {
                if (!empty(
    $pagemodules))
                {
                    foreach (
    $pagemodules AS $advmodid => $advmodorder)
                    {
                        if (
    $vbulletin->adv_modules[$advmodid]['dyna_prefix'])
                        {
                            
    $initialize_dynamics true;
                            
    $phrasegroups[] = $vbulletin->adv_modules[$advmodid]['dyna_prefix'];
                        }
                    }
                }
            }
        }
    }
    else if (
    defined('VBA_CMPS_ADMIN_FILE') AND in_array($_REQUEST['do'], array('addmodule''editmodule''copymodule''addpage''editpage''copypage''modifysettings')))
    {
        global 
    $phrasegroups;
        
    $getdyna false;
        if (!empty(
    $vbulletin->adv_modules))
        {
            foreach (
    $vbulletin->adv_modules AS $modid => $mod)
            {
                if (
    $mod['dyna_prefix'])
                {
                    
    $getdyna true;
                }
            }

            if (
    $getdyna)
            {
                
    $phrasegroups[] = 'adv_dyna';
                
    $phrasegroups[] = 'adv_dyna_cp';
            }
        }
    }
    else if (
    $vbulletin->options['vba_portal_navtabs'])
    {
        
    $datastore_fetch[] = "'adv_portal_page'";

    Frequently Asked Questions
    CMPS Users Manual

    For vBadvanced software assistance, please use the support forums.
    Unsolicted PMs, IMs, and email will not be responded to.
    If you have a non-software related question or problem with your account, please submit a support ticket.

  5. #5
    Twisted Monkey
    Join Date
    Apr 2005
    Location
    California, USA
    Posts
    138

    Default

    And now it works. Thank you very much! Much appreciated as always.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Facebook with vba
    By blacura in forum "How Do I..." Questions
    Replies: 0
    Last Post: 09-28-2009, 12:20 AM
  2. Getting rid of the goto redirection
    By BonjourChine in forum Troubleshooting & Problems
    Replies: 5
    Last Post: 07-31-2008, 11:37 AM
  3. Redirection
    By fancom in forum "How Do I..." Questions
    Replies: 3
    Last Post: 03-12-2008, 07:40 AM
  4. Redirection issues with 3.5.7
    By chkdg8 in forum Troubleshooting & Problems
    Replies: 2
    Last Post: 11-26-2006, 03:24 AM
  5. Redirection after login
    By azarl in forum "How Do I..." Questions
    Replies: 19
    Last Post: 10-30-2006, 11:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •