miniBB ® 

miniBB

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

Integration with external DB and Session management

 
 
Page  Page 1 of 6:  1  2  3  4  5  6  Next »

Author madaxe
Partaker
#1 | Posted: 22 Feb 2005 17:29 
Hi there - I'm currently trying to integrate minibb with a website I'm working on.

I am after seamless integration - I don't want people to have to log in twice. The site I am working on uses cookie based sessions already, and I have successfully tricked the forum script into taking a userid from the already existing cookie. This, unfortunately, always results in a 'NO FORUMS YET?' message and nothing else. Logins using the already existing form (not ideal, i do not want to have to log in again) work to an extent, in that authentication succeeds after tweaking the md5 hashing slightly, however then fails due to the headers having already been altered (i am including my own headers and footers, using the script as suggested in the manual).

What are the strictly necessary columns in the users table? Why, in passing an external userid, even when the external user table is being referred to (in an external database), does it fail to then find the forums? I'm assuming I'm missing an important column in the users table.

Cheers for any help you can offer!

Max

Author madaxe
Partaker
#2 | Posted: 22 Feb 2005 17:33 
Actually, to tell the truth, the easiest way to do this would be to eliminate all internal session management for minibb - any ideas on this?

Author Team
8-)
#3 | Posted: 23 Feb 2005 10:27 
We have still no time for complete manual on integrating with another DB, but there are some points:

1) Obligate fields (fields keys) in database for miniBB are: username, user_id, user_regdate, password, email, activity, user_viewemail, user_sorttopics, language. If they are not in database, you must add them and define in DB scheme. Another fields define user profile, and it is not obligate to insert them (but you can redefine them in DB scheme, of course, if your table uses another names for ICQ or website fiedds, for example).

2) Site should use cookies for authorisation, not sessions. If the site is using cookie-sessions, you must turn sessions in miniBB OFF, and then create some kind of authentification in bb_cookie.php, rewriting default miniBB functions to whatever you need, so user_logged_in() function reports, either user is logged or not (and which user), setMyCookie() sets new cookie or session, when user is logging in, with necessary parameters - username, password, expiration time, getMyCookie() returns array of username, pass and exp.time, and deleteMyCookie() deletes the whole authentification when logging out. In this case, you need to UNDERSTAND, how your site authorisation is working, and which parameters you need to pass by.

3) For best reasons, you should disable registrations, editing profiles on your board (setting off the corresp. option), also as password receiving.

'NO FORUMS YET?' error actually appears not because of your users database, but because there are no forums defined at all. Be sure you are using correct database where miniBB tables are installed.

Author Kingfish
Partaker
#4 | Posted: 23 Feb 2005 21:58 
2) Site should use cookies for authorisation, not sessions. If the site is using cookie-sessions, you must turn sessions in miniBB OFF, and then create some kind of authentification in bb_cookie.php, rewriting default miniBB functions to whatever you need, so user_logged_in() function reports, either user is logged or not (and which user), setMyCookie() sets new cookie or session, when user is logging in, with necessary parameters - username, password, expiration time, getMyCookie() returns array of username, pass and exp.time, and deleteMyCookie() deletes the whole authentification when logging out. In this case, you need to UNDERSTAND, how your site authorisation is working, and which parameters you need to pass by.

That is well explained in the simplest form. Doing a google search on php and cookies is also helpful. I'm currently in the process of hoping to get the bb_cookie.php working with my main login. which uses 2 cookies(1 for username and the other for password). I never really fooled with cookies, and I like the idea of having just 1 cookie handle everything.

Author Anonymous
Guest
#5 | Posted: 23 Feb 2005 22:28 
Ok - I figured a few things out - I was getting the 'NO FORUMS YET' error because I am using two separate databases, not just two tables - the result of which it was trying to find the forum tables in the wrong database - fixed this with a bit of a hack - I already kludged all of the scripts to work with it - this was all that was holding me back - works beautifully now - thanks for a great product!

Author rvpelt
Guest
#6 | Posted: 16 May 2005 02:09 
Great to see someone managed to integrate the login.

Is there an example available?!
I'd really like to see a good solution to this.
(I currently can't get the cookie info in other pages that the
forums pages.)

Kind regards

Author Team
8-)
#7 | Posted: 16 May 2005 10:46 
Solution for this is in our closest TODO list, so it will be available really soon. I think, we will take WordPress as a practical example.

Author Anonymous
Guest
#8 | Posted: 16 May 2005 12:22 
Hey - I got it working a while back - not too challenging - basically involves setting it up to point at your own users table, kludging it to accept values from your own cookie checking script, and then going through editing whatever else you need.... Took a few days, but works beautifully.

Author Anonymous
Guest
#9 | Posted: 16 May 2005 19:44 
Hi,

actually i'm doing the same job like madaxe.. but still not working..
is that any problem if i change field name for this field :
username, user_id, user_regdate, password, email, activity, user_viewemail, user_sorttopics, language

i try modify at setup option for

$dbUserSheme=array(
'username'=>array(1,'username','login'),
'password'=>array(3,'password','passwd'),
'email'=>array(4,'email','email'),
'fviewemail'=>array(10,'fviewemail','user_viewemail'),
'fsorttopics'=>array(11,'fsorttopics','user_sorttopics'),
'flanguage'=>array(14,'flanguage','language')

pls help if any of u have any idea because i'm newbie in php

Author Team
8-)
#10 | Posted: 17 May 2005 11:22 
You can not change the names of the KEYS! Keys are used for miniBB internal procedure. You must change only NAMES and INDEXES.

Example #1:

'fsorttopics'=>array(11,'fsorttopics','user_sorttopics'),

bolded is a key and it must be named 'user_sorttopics'.

Example #2:

'user_sorttopics'=>array(11,'user_sorttopics','user_sorttopics'),

bolded is TABLE FIELD NAME, so in your case, it probably must be 'fsorttopics' (however, I don't know why do you need to rename this field, if it is not in your database already).

Example #3:

'user_sorttopics'=>array(11,'user_sorttopics','user_sorttopics'),

bolded is a <FORM> element name. Look at the templates/user_dataform.html

At last... integration with external DB is definitely not the thing for newbies! You must have imagination how it works, not really know about the techniques which are easy by the sense.

Author blade
Partaker
#11 | Posted: 5 Jun 2005 16:04 
hey guys

im having a bt of trouble with intergration still.

i can log in as admin and view the usernames and user_IDs of my existing user database.
when i try to view any users profile, i get "User doesnt exist" error.

secondly. when i try to login with the forum login. it doesnt give any error..yet it doesnt login neither. ive directed miniBB to user my custom user table. the passwords are not md5, i removed thes md5() from the login script.

any ideas?

******

Ok managed to get the login to work. but came across another issue.
You don`t have access to this forum. is the error i get now.
I do not wish to have unregistered users to post into my forums.

user_logged_in() => is the function used to check wether a user is logged it correct? if so then it should be possible to change it to detect Session vars that were generated by my custom login?

Author Team
8-)
#12 | Posted: 5 Jun 2005 17:01 
when i try to view any users profile, i get "User doesnt exist" error - check that your $dbUserId is specified properly.

Actually, nobody will tell you exactly what your problem is. Because nobody knows how your default users table works. Very SOON we will publish a very detailed solution, based on WordPress integration, how to unite miniBB with outside users table. So just take a look at it and think what's wrong.

Sessions are not supported in our solution, but it is still possible to integrate something with them. BUT: if you are not professional in PHP, don't even try to make it happen :-)

Author blade
Partaker
#13 | Posted: 5 Jun 2005 17:56 
i can just write my own setcookie() along with my existing session stuff in my login script.

is there anything that the forum needs to determin that a user has logged in apart from what is in setMyCookie($user_usr,$user_pwd,$cookieexptime);

Author Team
8-)
#14 | Posted: 5 Jun 2005 18:20 
For authorization, forum needs only information provided in bb_cookie.php file's functions. So, you can rewrite this file on your wish, providing session data, too.

Author Ant Eksiler
Guest
#15 | Posted: 6 Jun 2005 15:14 
I would be waiting for your Wordpress integration for users. I have 1000+ wordpress users and I dont want them to reregister!

Page  Page 1 of 6:  1  2  3  4  5  6  Next » 
Master Class miniBB Support Forums / Master Class /
 Integration with external DB and Session management
 Share Topic's Link
 Visit: online betting NZ

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
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑