Sharing cookies across two php logins

Discussion in 'OT Technology' started by celendin, Feb 8, 2006.

  1. celendin

    celendin New Member

    Joined:
    Feb 26, 2005
    Messages:
    697
    Likes Received:
    0
    Location:
    Melbourne Australia
    Hi I have a website. It's a small games related website, I have php-Nuke for the content management where we post new articles and I want to add a phpBB forum where visitors can post forum messages to each other.

    Right now people can login to the php-Nuke and post articles, but when they want to post on the forum, they have to login again to the phpBB database. I was just wondering if you guys knew a way to share the cookies across both scripts, so when they login to the php-Nuke they also login to php-BB database as well?
     
  2. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    PostNuke I know for a fact has a snippet of code to integrate phpBB. I would think someone would have done the same and created some code for PHPNuke as well. It would be the easiest and fastest way to make this work. Otherwise, you get into the hassle of writing your own to integrate the two apps together (which isn't impossible, but requires you to fully understand how the two apps work).
     
  3. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    There is a port of phpBB to PHP-Nuke called called BBtoNuke.
     
  4. Grelmar

    Grelmar New Member

    Joined:
    Jan 25, 2006
    Messages:
    88
    Likes Received:
    0
    Location:
    Calgary, Alberta, Great White North
    In index.php of the phpBBS file:

    Code:
    if ($popup != "1")
        {
            $module_name = basename(dirname(__FILE__));
            require("modules/".$module_name."/nukebb.php");
        }
        else
        {
            $phpbb_root_path = 'modules/Forums/';
        }
    define('IN_PHPBB', true);
    include($phpbb_root_path . 'extension.inc');
    include($phpbb_root_path . 'common.'.$phpEx);
    
    //
    // Start session management
    //
    $userdata = session_pagestart($user_ip, PAGE_INDEX, $nukeuser);
    init_userprefs($userdata);
    //
    // End session management
    //
    But that only works if you imported the phpBB as a module.

    http://www.nukecops.com - they've done a lot of work on melding phpBBS with phpNuke. Tons of info and FAQs so you can avoid re-inventing the wheel.
     

Share This Page