Current location: Hot Scripts Forums » Programming Languages » PHP » phpbb login integration


phpbb login integration

Reply
  #1 (permalink)  
Old 06-22-04, 04:27 PM
SR_Ben SR_Ben is offline
Newbie Coder
 
Join Date: May 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
phpbb login integration

Hi, I'm trying to integrate a login script (members only access) for my site with my phpbb forums.
I have managed to make it so that a user can login from the main site and when they go to the forums the session carries through so they do not need to login twice, but what I need help with is restricting certain pages so you need to be loged in to view them, preferably by inserting a bit of code into each members only page rather than having an entire members only directory.

you can test what I have so far here - http://www.solve-records.com/test.php
username - test
password - test
then after logging in (from login box ontop of page) go to forums and you will automatically be logged in
Anyway, if that makes sense to anyone could you please help me out.
Thanks
Reply With Quote
  #2 (permalink)  
Old 06-22-04, 06:13 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
ahh so simple..

PHP Code:

define('IN_PHPBB'true);

$phpbb_root_path './';
include(
$phpbb_root_path 'extension.inc');
include(
$phpbb_root_path 'common.' $phpEx);

// Start session management

$userdata session_pagestart($user_ipPAGE_INDEX);
init_userprefs($userdata);

if(!
$userdata['session_logged_in']) {
message_die(GENERAL_ERROR'Only registered users may view this page');
}

... 
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png

Last edited by Infinite_Hackers; 06-22-04 at 06:16 PM.
Reply With Quote
  #3 (permalink)  
Old 06-23-04, 11:52 AM
SR_Ben SR_Ben is offline
Newbie Coder
 
Join Date: May 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
typical, it's always the simplist bloody thing in the world.
hoiw can I now make it so that instead of just showing an error message when a user is not logged in, it redirects to a login page and after logging in then goes back to the page they were previously at?
thanks a lot for your help
Reply With Quote
  #4 (permalink)  
Old 06-23-04, 06:26 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

$url 'securepage.php';

redirect(append_sid("login.$phpEx?redirect=$url"true)); 
i think that's it
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Reply With Quote
  #5 (permalink)  
Old 08-10-06, 05:04 AM
karpar karpar is offline
New Member
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Hi ppl,
This is my first post here...what I'd like to do is to know how SR_Ben integrated the login script of his main site with phpBB. I mean, I have a site with a login script that logs in users to their control panel at the main site. What I need to do is to make it so that they don't have to re login when they access the forums. So, literally, I'd like to carry over the sessions without any modifications to the variables of the main script. I would like all the changes to be made to the phpBB script.
Thanks in advance...
Karthik
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
simple board that shares db with phpbb Greener Script Requests 1 04-21-04 07:12 AM
Free phpBB Forum Hosting epic1231 General Advertisements 0 03-15-04 05:11 PM
HELP! Php to login to HTACCESS? godfather PHP 4 03-06-04 12:03 AM
User Management - forum login used throughout site. Ayumi PHP 5 12-01-03 08:29 PM
merge into just one login ... ?? orgil PHP 4 07-30-03 05:06 PM


All times are GMT -5. The time now is 05:03 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.