Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jul 2007
    Posts
    10
    Plugin Contributions
    0

    Idea or Suggestion PHPbb2 Single Login

    Hi
    Ive been trying to make a single login for zencart and phpbb2. I have successfully done it. code is pasted below.
    This actually works. If you know a better way please tell me. :)

    First i edited:
    /includes/templates/yourtemplate/common/tpl_header.php

    Code:
    <img src="bridge.php" />
    In the root of my shop, bridge.php contents

    Code:
    <?php // bridge.php 
    include_once ( "includes/application_top.php" );
    
      define("IN_LOGIN", true);
      define('IN_PHPBB', true);
      $phpbb_root_path = './forum/';
      include($phpbb_root_path . 'extension.inc');
      include($phpbb_root_path . 'common.'.$phpEx);
    
      if (!empty($_SESSION['customer_id'])) { 
      $query= "SELECT customers_nick,customers_password FROM customers WHERE customers_id ='".$_SESSION['customer_id']."'";
      if (!($res=mysql_query($query))) {
      $username='';
      $password='';
       }
       if (mysql_num_rows($res)) {
        list($username,$password)=mysql_fetch_row($res);
        } else {
            $username='';
             $password='';
        }
     
      $query2= "SELECT user_id FROM phpbb_users WHERE username ='".$username."'";
      if (!($res2=mysql_query($query2))) {
      $fid = '';
      }
      if (mysql_num_rows($res2)) {
        list($fid)=mysql_fetch_row($res2);
        } else {
            $fid = '';
        }
    
    $last_visit = 0;
    $current_time = time();
    
    session_begin($fid, encode_ip(zen_get_ip_address()), PAGE_INDEX, FALSE, $autologin, 0);
    }
    ?>
    Now when a member logins in the shop they are logged into the forum automatic. Theres gotta be a better way????:)

    Im trying to figure out how to destroy the phpbb2 session.. will update soon...

  2. #2
    Join Date
    Jul 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: PHPbb2 Single Login

    Update

    Moved
    Code:
    <img src="bridge.php" />
    to tpl_account_default.php so its not logging in the forum on every page loaded in the shop.

  3. #3
    Join Date
    Jul 2007
    Posts
    10
    Plugin Contributions
    0

    Have a Drink Re: PHPbb2 Single Login

    UPDATE!

    Ok, now you can put <img src="bridge.php" /> anywhere, header or footer of your template
    Change:

    Code:
     if (!empty($_SESSION['customer_id'])) {
    To:

    Code:
      if (!empty($_SESSION['customer_id']) && empty($userdata['session_logged_in'])) {
    Now it will not run session_begin() all the time :)


    Next is to figure out how to destroy the session on logout.

    Is anyone interested in this!??!! Single phpbb zencart login integrated yay!

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: PHPbb2 Single Login

    Why do you use img tag?
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    Jul 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: PHPbb2 Single Login

    I use the img tag because doing a include or require_once conflicts. This way its actually working. I will go live with this and post my site soon.

  6. #6
    Join Date
    Jul 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: PHPbb2 Single Login

    Try it out here at rocky.nu

  7. #7
    Join Date
    Jul 2008
    Posts
    29
    Plugin Contributions
    0

    Default Re: PHPbb2 Single Login

    I'm a bit confused. if you have
    PHP Code:
    <img src="bridge.php" /> 
    wouldn't you get a broken image on your page ? I guess you could do
    PHP Code:
    <img src="bridge.php" syle="display: hidden" /> 
    Is that what you had in mind ?

    With the last change you made (empty($userdata['session_logged_in'])) ) I assume this means the image no longer has to go in tpl_account_default.php and can go back to tpl_header.php.


    I also had a look at the session_begin function, but it only has 1 parameter.

    PHP Code:
    function session_begin($update_session_page true
    I assume you are refering to the one in forum\include\session.php

  8. #8
    Join Date
    Jul 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: PHPbb2 Single Login

    to fix the broken image

    <img src="bridge.php" width="2" height="2" />

    I blogged it here http://www.rocky.nu/forum/viewtopic.php?t=5


  9. #9
    Join Date
    May 2008
    Posts
    6
    Plugin Contributions
    0

    Default Re: PHPbb2 Single Login

    In accordance with the method you have done, but not

    zen cart:http://www.goods88.com/

    forum:http://goods88.com/forum

  10. #10
    Join Date
    Jul 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: PHPbb2 Single Login

    Coool you did it with PHPBB3

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. two shops with single login
    By balihr in forum General Questions
    Replies: 0
    Last Post: 3 Nov 2009, 12:59 AM
  2. Single User Login Bridge
    By volmark in forum General Questions
    Replies: 2
    Last Post: 21 Jul 2008, 04:21 AM
  3. Replies: 0
    Last Post: 20 Nov 2007, 09:05 PM
  4. phpBB2 accounts as Zen login??
    By Valaroopie in forum General Questions
    Replies: 0
    Last Post: 13 Mar 2007, 12:38 AM
  5. Simultaneous login to zen-cart phpbb2 and by extension gallery 2
    By petpromises in forum General Questions
    Replies: 1
    Last Post: 10 Sep 2006, 10:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR