Has anyone given any thought to making the user management feature more abstract?
What I'm thinking is making all the calls for user management and user permissions standard but then having it so that you can use any user tables you want. Such as using phpBB user tables (or other product/BB).
Conceptually this would work by including a user management class/php file that would take the CMS Made Simple calls and mapping them to whatever system the user wanted. In the default install that would just be the way it handled now but users would have the capability to add additional modules to handle translating the calls to the other database tables instead.
I haven't really looked at the CMS Made Simple user management so I don't really know how hard it would be to implement. Though I think it would be a very big draw to have this abstraction in place and then people could write additional modules to use other products easily. I've noticed a lot of other products that don't use any kind of abstraction and it makes it hard to integrate different products.
Anyway, what do you think?
User Management Abstraction
Re: User Management Abstraction
I just briefly looked at the class.user.inc.php file and it looks like it might be possible to just rewrite different versions of it to handle user management. Though it wouldn't be very elegent to just replace files though. I'll look into it more later.
Re: User Management Abstraction
I'm interested in a similar system for singapore. I'll be watching this thread...
Re: User Management Abstraction
That would be an interesting experiment, actually. This is why we abstract code in the first place... to easily replace it with something better! To be honest, at this point, any mods like that should just be file replacements. While it could be possible to do a module thing, it probably won't integrate as well.
Re: User Management Abstraction
I was thinking more along the lines of a conditional include. Then maybe some sort of option in the Admin area to add or configure the user system you want to use. This would need a DB area to store the systems available too, which starts to become more complex and maybe not worth it for the intended use. Since people would just use one user system anyway.
Last edited by BlueRook on Wed Apr 20, 2005 12:57 am, edited 1 time in total.
Re: User Management Abstraction
Well, I played with this a bit tonight and a couple of the things were easy, espcially if the two apps share a database. However, I couldn't get login to work with just changing the class.user.inc.php. If I was already logged in I could get it to read all the users with no problem and I would imagine it would have worked to add them to groups. But I was hoping it would be alot easier and only need modifications to that one user file.
I'm now thinking it might just be better to write a import script to poplulate your user table for the cms with the one from phpBB (or the other app). Then maybe modify the other app to handle user creation and populating the cms database with new users. I don't really need that functionality though I might write up a tool to do it for fun if I get the time.
I'm now thinking it might just be better to write a import script to poplulate your user table for the cms with the one from phpBB (or the other app). Then maybe modify the other app to handle user creation and populating the cms database with new users. I don't really need that functionality though I might write up a tool to do it for fun if I get the time.
Re: User Management Abstraction
Strange. The only reason I could see the login not working is because the password check is done differently. CMSMS uses a simple md5sum created by PHP and saves that to the database. It then md5sums's the password that was given and sees if they match (UserOperations::LoadUserByUsername). I imagine that not all apps use this same algorithm and it would have to be changed accordingly.
To be honest, I would think the first way is better. CMS users only have a small number of fields and except for the password thing, should really work with just about any apps database.
To be honest, I would think the first way is better. CMS users only have a small number of fields and except for the password thing, should really work with just about any apps database.
Re: User Management Abstraction
Passwords are hashed by MD5 too in phpBB. So I don't think that is the problem. Though I guess I could have missed something somewhere. I looked at it again and from the code I can't really see where it is going wrong.
Re: User Management Abstraction
The weird thing is I think that the following evaluation is failing.
I even tried taking out the $oneuser and isset part and it still fails. I don't know.
Code: Select all
if ($username != "" && $password != "" && $oneuser && isset($_POST["loginsubmit"]))
Re: User Management Abstraction
Well, I finally got the login part to work fine. I had to comment out some code and I'm now working through why that code caused the failure.
*edit*
I feel stupid now. I just forgot to change one of the field values to match the phpBB value.
*edit*
I feel stupid now. I just forgot to change one of the field values to match the phpBB value.
Last edited by BlueRook on Thu Apr 28, 2005 4:19 am, edited 1 time in total.