miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Specific miniBB Support Forums / Specific /   

Using minibb login system on separate page.

Author breezey
#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
#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
#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
#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
#5 | Posted: 23 Sep 2005 12:44 

And... what about this: ?

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

$_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. Top

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

 Short link for this topic:

You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB