im just simply after something that tells me how many times a certain page has been hit... not necesarily permissions and what not... there are other functions in the admin CP to do that w/...
But not for non-content pages.
Sure, you can protect forums so that members have to be registered to view (read) them, but this MOD will also allow you to protect the memberlist, user profiles, and other pages on your board with similar logic.
This sounds great! Let's see some source code dude? 8)
When you can snatch this pebble from my hand...
Seriously, that's what the ALPHA status means. The source isn't ready, but it's getting really close. Here's some updated screen shots for managing group permissions on private pages.
A recap for those that haven't or won't
read the posts before this one. This MOD will allow you to set permissions on pages and on functions within those pages. So you can set your memberlist to Registered and only registered members will be allowed to view that page. The permissions are Public, Registered, Private, Moderator, and Admin.
Public = guest
Registered = registered and logged in user
Private = registered and logged in user that is a member of a selected group
Mod, Admin... you can figure those out for yourself.
Everything was done and working until the idea of Private (group) access was mentioned. I thought about how to do it, and to be "formal" there should be another database table that includes the page_id and the group_id whenever access rights have been granted. Yeah, for perfect "normal form" and all that, sure.
I broke the normal form and stored the list of group id values in a text field. Yeah, it's a "dumb" database design, and if a group is ever deleted there will still be a group id stuck in this text field.
But it won't break anything, and it makes the code / design a LOT easier, so there.
Here's what the interface looks like for setting up a page, showing the drop-down control for setting access level:
Here's a screen shot showing the multi-select for the groups.
Notes on this... the group selector is a multi-select, meaning you can select from 1 to N where N is the total number of groups. The size of the selector is keyed to the number of groups with a limit of 25. That means that if you have one group you'll have a one-line select box. If you have 10 groups you'll have a 10-line select box. If you have 30 groups you'll have a 25 line select-box with a scroller. Why 25? It seemed like a good number. 8) Feel free to change it.
The listing will be there all the time, you can use it anytime, but the code will only execute for private pages.
Finally, note the "function" in the screen shot? The page is profile.php, and it has multiple functions. You can viewprofile, editprofile, register... so you can't just set permissions on profile.php. Well, you could, but you would never get any user registrations if you set anything other than Public. So for now, the code looks for a $mode variable on the URL and keys the function on that. This is the weakest part of the code, as far as I can tell, and I'm open for suggestions on how to design it better.
On my development board, I have "profile.php?mode=register" as public, and "profile.php?mode=viewprofile" as registered. There's no need to control "editprofile" as the current page logic already handles that.