MyBB Community Forums

Full Version: mybb 1.6 authentication system
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,
I like very much mybb and I would like to implement its authentication and user management system in a php-based upload/download system developed by me.
Given that this will be absolutely *not commercial*, I would like to make 2 questions:

1) Would it be allowed to take some code from mybb 1.6.1 package and add it to something developed by me ? Up to now I wouldn't even need to distribute it, just use it for my web site.

2) If the answer to the previous question is yes, Angel which files contain the authentication logic (user registration, login, permission management, allow access only to registered users) ? What exactly should I integrate in my code (other than obviously a mysql database) ?

Thnak you very much for any hint and suggestion.
Diabolik


I believe that according to the license that MyBB is released under you may use, modify, and redistribute any code from the MyBB source as long as proper credit is given. (I would leave a comment like "Based on the original code of MyBB" and leave their copyright in your php documents.) The full license in all of its glory can be found here: http://www.mybb.com/about/license

The source documentation will help you understand the source code including the functions and classes related to user authentication. You can find that here: http://www.mybb.com/sourcedocs/
(2011-01-04, 07:54 PM)Zach Wrote: [ -> ]The source documentation will help you understand the source code including the functions and classes related to user authentication.

Ok, I'll give it a look, thanks.
The most important point is the check which allows only registered users to view forums and post, do you know the exact point where is this check ?

Bye,
Diab
(2011-01-05, 10:17 AM)Diabolik Wrote: [ -> ]
(2011-01-04, 07:54 PM)Zach Wrote: [ -> ]The source documentation will help you understand the source code including the functions and classes related to user authentication.

Ok, I'll give it a look, thanks.
The most important point is the check which allows only registered users to view forums and post, do you know the exact point where is this check ?

Bye,
Diab

The MyBB initialization scripts load up all the relevant variables in to the $mybb object from where the rest of the script then picks up and checks various items.

To check for whether a user is registered, member, modertaor, admin etc, it simply becomes a matter of checking variables in the $mybb object:

if($mybb->user['uid'] != 0) << If this is true user is registered

if($mybb->usergroup['canmodcp'] == 1) << User is Moderator

if($mybb->usergroup['cancp'] == 1 << User is Admin

The class in inc/class_core.php is where all the variables are put in to the $mybb object
(2011-01-05, 10:33 AM)- G33K - Wrote: [ -> ]The class in inc/class_core.php is where all the variables are put in to the $mybb object

Ok, thanks, I'll study on it. Smile
Bye,
Diab

I have been working on it for few days, but it seems not feasible, as I should
include a lot of files deeply linked among each other. Dodgy

I think I'll have to do it by myself.
Bye