We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7985
    • 3 Posts
    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
      • 28042 ☆ 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
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 7985
        • 3 Posts
        Susan Ottwell first of all I appreciate the attention you gave to my doubt, also I am thankful for your observation and advice.

        I’m glad grin to tell you that I’ve already solve the problem, and I’m considering improve the web I’m doing with the upgrade of modx.