Login system

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
Ankabout
Registered User
Posts: 54
Joined: Thu Jun 20, 2002 8:41 am

Login system

Post by Ankabout » Wed May 28, 2003 10:02 am

Hey, I have managed to link my phpbb with my user system in such a way that registration takes place in both systems at once.

Now I want to link both login systems also. Basically how my login system works, is the user enters a password and username, my script checks it with the database and then registers a few session variables. My pages then all check to see if the session variables exist.

How can I link my login system with phpbb???

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: Login system

Post by drathbun » Wed May 28, 2003 1:59 pm

Ankabout wrote: How can I link my login system with phpbb???

Better suggestion would be to simply use the phpBB login code / session management on all of your pages, instead of writing something new. I've added numerous pages to my site, all falling within the phpBB session, because I use this skeleton to start any new page on my site:

Code: Select all

<?php

// standard hack prevent
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

// standard session management
$userdata = session_pagestart($user_ip, PAGE_CODE_HERE);
init_userprefs($userdata);

// set page title
$page_title = 'Page Title Here';

// standard page header
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

// assign template
$template->set_filenames(array(
        'body' => 'PAGE_body.tpl')
);

// build page body
$template->pparse('body');

// standard page footer
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
I can put anything I want into the template, in this case no variables are passed, and it inherits the standard phpBB session tracking code. Makes life very easy. 8)

Dave
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

lordgate
Registered User
Posts: 7
Joined: Wed Apr 30, 2003 4:35 pm
Location: Ottawa
Contact:

Post by lordgate » Fri Jul 04, 2003 2:39 pm

Maybe I'm an idiot, but I'm not quite sure what PAGE_CODE_HERE should be..
Is is just a unique page identifier number?

I also need to create a second page called PAGE_body.tpl that has the content for the page I want to use, right?

I just want to make sure I'm using this correctly. I'm rather new to this, and have been having trouble finding out how to do this all.

If that's all I have to do, I think I'm set. After learning the .tpl format that is.
Ste

lordgate
Registered User
Posts: 7
Joined: Wed Apr 30, 2003 4:35 pm
Location: Ottawa
Contact:

Post by lordgate » Fri Jul 04, 2003 9:41 pm

I figured that my tpl file needs to be in templates/subSilver/

I was able to get a page up by choosing a random number for the Pagecode.
The $page_title reference didn't seem to make it through - it came up as "Page Title Here" when the page is displayed. I took a look in page_header file to see if i could get an idea of what is going on. The one occurance of $page_title leads me to believe it should work, but it doesn't

Is there a way to include php in tpl files? I've been looking around and haven't found any references to the possibility. One thread says that tpl files are processed by php which suggests I couldn't add any functionality by using this method, just static pages. Is that correct, or did I miss something?

Thanks for the help!

Ste
Ste

hartlijn
Registered User
Posts: 36
Joined: Sat Oct 20, 2001 11:32 pm

Post by hartlijn » Sat Jul 05, 2003 10:31 am


hartlijn
Registered User
Posts: 36
Joined: Sat Oct 20, 2001 11:32 pm

Post by hartlijn » Sat Jul 05, 2003 10:39 am

I tried this way too, as well as some other mods, but I get this error very often.

Code: Select all

Please ensure both the install/ and contrib/ directories are deleted
for the record: I dont have contrib nor install directory anymore.

Anyone knows a solution?

OK..I had a filename INSTALL in the dir I ran the script :oops:

lordgate
Registered User
Posts: 7
Joined: Wed Apr 30, 2003 4:35 pm
Location: Ottawa
Contact:

Got it working

Post by lordgate » Thu Jul 17, 2003 2:14 pm

Ok I got it working!

One thing though... Is there a variable I can set so that when users login, they aren't forwared to the index page? That is, if they login from a page called xzzz.php, can they be redirected to that page, instead of index.php?

Thanks!

Ste
Ste

Post Reply

Return to “[2.0.x] MOD Requests”