We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8822
    • 203 Posts
    Hi, i am having a problem with MODX Revo and PageLocker. It all appears to work fine, user must enter a password for a page etc. 24 hours later though and a password isn't required, regardless of what machine you are logging in from. If you clear the cache manually, the password is requested again, but only for about a 24 hour period and then it goes back to no password. Any ideas as to what could be the problem?

    This question has been answered by Emily. See the first response.

      • 3749
      • 24,544 Posts
      Are you calling the PageLocker snippet uncached (with the exclamation point)?

      [[!PageLocker]]
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 8822
        • 203 Posts
        Hi Boy Ray, thanks for your response - this may seem like a very silly question, but where is the pagelocker snippet called - i can't find that out? It has a pagelocker page template and two template variables assigned to the password protected page. Any ideas? Many thanks for your time
          • 3749
          • 24,544 Posts
          My guess is that it would be in the page template(s).
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 8822
            • 203 Posts
            Unfortunately not..... it does seem ridiculous that i can't find it, but it definitely isn't referenced from within the page template. Any ideas anyone!?
              • 8822
              • 203 Posts
              Been struggling with this one for a while - are there any other plugins out there for password protecting a single page?
                • 3749
                • 24,544 Posts
                Sorry, I don't know of any. The pagelocker tag would almost have to be in either the template, or in a chunk or TV referenced in the template.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 8822
                  • 203 Posts
                  That's what i would have thought, but i have been through it with a fine tooth comb. The instructions state that you can do anything with the PageLockerFormTemplate as long as the form within it contains a password field named "password" and there is no mention of the PageLocker tag (see below). The TVs we have to create, and again, they just need to be called pagePassword and pagePasswordGroup and of type 'text'.

                  I have looked for documentation on how PageLocker works in order to try and delve down some more but can't find anything, other than the instructions given below. Do you know of any other documentation that may help?

                  Instructions for PageLocker:

                  • Install PageLocker through Package Management.
                  • Create a new resource, and assign it the "PageLockerFormTemplate" template. Click save, and make a note of the resource's ID. This template can be customized as much as you want, so long as the form within it contains a password field named "password". NOTE: this template should ONLY be used for the form page, and not for any other pages (including your protected pages).
                  • Open the PageLocker plugin, and on the "Properties" tab, unlock the default properties and enter the resource ID from Step 2 as the value for "formResourceID". NOTE: The plugin will not work without a value set for this property.
                  • Create two new template variables, named "pagePassword" and "pagePasswordGroup" (if you use different names, you must also change the plugin's corresponding property values). "pagePassword" should have a text input type. "pagePasswordGroup" should ideally be either a text, tag or listbox input type (a listbox can help control the names of your password group names). Assign these two TVs to whatever templates need password protection.
                  • Go to the individual page you want to protect, and fill in a password. Optionally, choose a group. Users who successfully enter a password for a page will be able to enter any other pages within the same group without re-entering a password.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    There is no snippet. It's a plugin, and is based on the template a resource uses. If the resource has a password or a group set in its TV, then PageLocker comes into play, otherwise it doesn't. There's no time involved here, it's a simple yes/no situation. Either a TV is set or it isn't. Actually it's a pretty simple plugin.

                    If there is a TV value, and the user's submission matches the resource's password, there are a couple of SESSION values that get set. This timing business makes me think that there's something about the session tables causing this, and it's not that the page doesn't require a password, but that the user's SESSION values have been restored.

                      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
                      • 3749
                      • 24,544 Posts
                      Sorry about that. The version I found when I looked was a snippet.

                      https://github.com/aladage/pagelocker
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting