Need help with login.

Discussion in 'PHP' started by RazorGlacier, Feb 15, 2009.

  1. #1
    I'm planning to use PHPBB3 so that my users only have to login once. I've built the login and register. However, I'm not sure if I have the require login correct. Can someone look at the code, and confirm? Thanks!

    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '/forums';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
    
    foreach ($user->data as $sess => $val)
       {
       if(!$val )
       {
       print($sess ."=> NULL");
       }
       else
       {
       print($sess ."=>".$val);
       }
       print("<br />");
       }
    
    if(!$user->data["is_registered"])
       {
       die("You need to login or register to access this page.  =(");
       }
    
    PHP:

     
    RazorGlacier, Feb 15, 2009 IP
  2. DanielHB

    DanielHB Active Member

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #2
    Take a look at the following class, I used it as reference when I was connecting to PHPBB3.

    http://www.phpclasses.org/browse/package/4826.html
     
    DanielHB, Feb 19, 2009 IP