Hi everyone, I have a doubt and I would like to receive your ideas, suggestions or comments in order to solve it. First of all, let me tell you that I’m a beginner using MODx and I’m creating a simple web site, I already have a few created web pages and in some of them I call a snippet that help’s me to check the actual hour. If the actual hour is less than 8:00pm the user will have access to the page, I do this as follows:
if (date("G") < 20) {
//Some code is here
}
Well, now I want to create an “Administrators page” that controls and allows to have access in the hours that are restricted but obviously not for all users only for those to whom the administrator allows them access.
I thank and appreciate all the ideas, comments and suggestions that you can provide.
P.S. I use MODx 0.9.5
-
☆ A M B ☆
- 24,524 Posts
In the first place, MODx 0.9.5 is really old. I would strongly recommend you upgrade.
You could extend your snippet to check the user’s groups. Create a user group and assign the users you want to be able to access the pages to that group.
http://wiki.modxcms.com/index.php/API:isMemberOfWebGroup