Topic: Using punbb with own usertable

Hi Board :-)

I just found punbb on my search trough the www.
I just have to say it´s great!

but there ist one thing I´d like to know.

I am running a system with  a usertable and like to use this one, so users don´t have to register and login again on the board.

Is there any chance to realise this?


Thx so far...

Re: Using punbb with own usertable

Well, you can use one table for both forums and the rest of your site, but modifying PunBB to use an external table would be a lot of work. Doing it the other way round would probably be easier. It all depends though. Bottom line is yes, it's possible, but it can involve a great deal of work and you will have to know PHP and little about databases to do it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Using punbb with own usertable

ok, thanks for this hint.

there is no other chance for me to use punbb with my running table.
seems like this is gonna be a long night :-)
I will have a look at the source and see what I can do.

again, great work rickard!

Re: Using punbb with own usertable

Kennel wrote:

Well, you can use one table for both forums and the rest of your site, but modifying PunBB to use an external table would be a lot of work. Doing it the other way round would probably be easier. It all depends though. Bottom line is yes, it's possible, but it can involve a great deal of work and you will have to know PHP and little about databases to do it.

To make my own user database integrated into PunBB, only about 20 lines of code was needed and some small database fetching functions to work.

Schematic
-----------
Login -> Fetch user from my database
                |                              |
              Exists                  Doesn't exist
                |                              |
      Insert new user            Let punbb look
      into pbb_users             in pbb_users
      with all values              if user already
      needed                       exists there
                |                              |          \
      Set variables                   Exists         \
      needed by punbb                 |           Doesn't exist
                |                              |              \
                |                             /                \
                 ------PunBB's own login           PunBB shows the
                        procedure takes              error login
                        care of the rest

Then I disable the functions for sending out lost password, register new users, etc, because those I already have in my own software :-).

5

Re: Using punbb with own usertable

I am looking to build an integrated site which will include PunBB and where other parts of the site will also require users to be logged in. I was thinking of simply using PunBB's membership system which would be linked from the front page of the site and would return users to whichever page they had come from. Other parts of the site restricted to members would then simply check for the PunBB cookie. Would that work or is it too simplistic. Is there a better way of doing it?

6 (edited by chacmool 2003-12-28 11:23)

Re: Using punbb with own usertable

Don't forget to set PUN_DONT_UPDATE_COOKIE when you login from a page "outside" punbb. Otherwise the new-posts-thing wont work.

7

Re: Using punbb with own usertable

chacmool wrote:

Don't forget to set PUN_DONT_UPDATE_COOKIE when you login from a page "outside" punbb. Otherwise the new-posts-thing wont work.

If I do that will the login still work with people who don't have an existing cookie?

Re: Using punbb with own usertable

Defining PUN_DONT_UPDATE_COOKIE before including common.php will make sure that PunBB doesn't set a new cookie. It will still read the cookie, but it just won't update it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Using punbb with own usertable

If somebody could make a tutorial on how to use PunBB's database to authenticate users on the site itself, would really be awesome.

Re: Using punbb with own usertable

Wait until PunBB 1.1. Some things have changed.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Using punbb with own usertable

Wouldn't mind waiting.