WebsiteBaker Community Forum

General Community => Off-Topic => Topic started by: Leon on May 11, 2007, 12:53:42 PM

Title: users & groups access permission
Post by: Leon on May 11, 2007, 12:53:42 PM
Hi guys & WebsiteBaker developers,

Am so impress with this script, it seems like a great work & lots of effort by many. Am a amaturer php programmer whos looking at learning more about writing web applications. I have been looking into developing a user/groups access permission script to help maintain different groups of users, display different menu options to eg. technician's menu compare to accountant menu. After seeing how WebsiteBaker made it possible, am really keen to learn how to make one, could someone possibly show me some logic or the right way to walk?

Thanks very much
Title: Re: users & groups access permission
Post by: icouto on May 13, 2007, 02:43:11 AM
@Leon: the user authentication system in WB is good, but not perfect. To understand how it works, and how the menus are drawn, I would suggest you try the following:

1) using a DB Admin tool - such as phpMyAdmin - have a look at the 'pages' table in the WB database. Examine the fields there that are used to store information about which users are able to view and administer the page, and how that information is stored.

2) examine the function 'show_page()', in the class file 'class.wb.php', which lives inside the folder 'framework'. This is the function that is called to determine whether a page should be SHOWN to the current user. Note: sometimes a page is not shown, but DOES appear in the menu! - such as for pages with visibility set to 'Registered'.

3) slowly and carefully examine the 'show_menu()' function, in the file 'frontend.functions. php', in the 'framework' folder - this is the function that creates the menus. It calls functions from 'class.frontend.php', which in turn calls functions from 'class.wb.php', so it gets quite confusing to work out what's going on!

I hope this helps!