miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

Using minibb login system on separate page.

 
Author breezey
Partaker
#1 | Posted: 21 Sep 2005 11:41 
What is the best and easiest way to create a new separate page (a php file) that uses minibb login system. I mean, someone could not access the page unless he/she login to minibb. Thanks.

Author Team
8-)
#2 | Posted: 21 Sep 2005 11:54 
I think, you need just to read miniBB cookie in this file, parse it and some way make a decision, either user is logged or not. Take a look at the bb_cookie.php - it contains everything you need to know about miniBB cookies.

Author breezey
Partaker
#3 | Posted: 21 Sep 2005 12:52 
I have tried that and use the value returned by user_logged_in() function to determine if a user is logged in or not. I print out (echo command in php) the value of user_logged_in().

When I logged in to miniBB I noticed that index.php print out 1 to the screen and my other page (say main.php) print out 0. Did I miss something? Thanks

Author breezey
Partaker
#4 | Posted: 21 Sep 2005 13:55 
Got it. After reading your post on another thread it works now. I need to include setup_mysql.php as well. Thanks.

Author LopeZ
Partaker
#5 | Posted: 23 Sep 2005 12:44 
Hi...

And... what about this: ?

From our own login system (using or not miniBB user table) we do something like this:

session_start();
$_SESSION['user_usr'] = "username"; /* The username */
$_SESSION['user_pwd'] = "user_pass"; /* Password */
$_SESSION['user_id'] = "user_id"; /* Id from miniBB table */
$tiempo = time() + 108000; /* Or time defined in setup_options.php */
$_SESSION['cook'] = $_SESSION['user_usr']."|".$_SESSION['user_pwd']."|".$tiempo;
header("location:miniBB/index.php"); /* Or not here... simply the session vars are set... and we use it when clic a link to the forums... */


Well... I think this is a poor solution using Sessions instead of cookies but... it goes well for me... Am I not thinking in any important problem or bug about this code?

Opinions? (Don't fire me! I'm begginner!! :-P)

Specific miniBB Support Forums / Specific /
 Using minibb login system on separate page.
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑