We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21054
    • 78 Posts
    Hi.

    I’m trying to find out the best way to create a password protected area within my ModX site on a sub-page (i.e. a child of a main menu page).

    I’m not sure what the best practises are here. I tried to create a user group and assign that user group to access permissions, but the page still seems to be viewable to everyone.

    Not sure how to set up the file / permissions correctly.

    Ideally, I’d want the system to prompt the user for a password, before being allowed into that section.

    I could set it up using PHP/Apache permissions, I think... would this be the only way? It is kind of "outside" MODx.

    Anyone with experience in this area?

    Thanks!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      1. Create a web user group, a document group, and connect the two (Security -> Web Permissions).

      2. Assign the relevant documents to the document group.

      3. Assign web users to the web user group.

      Now only logged-in visitors belonging to that group can see the documents. In the configuration (Tools -> Configuration) you can specify a document to use as an unauthorized page. This document would have a login form, so in case anyone tried to access one of the protected pages they would get the login form page instead.
        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
        • 21054
        • 78 Posts
        Thanks.

        I think what they want is a simple login, e.g. like a separate server request login, that asks for a username and password to a particular MODx page. So any user (or even the public) can click on the link, but it asks for a completely different username/password.

        So kind of like password protecting a directory on cPanel (but of course, you can’t do it on cPanel because there is no actual real "folder", only a MODx URL.

        MODx is set up to show friendly URLs, but I’m not sure if cPanel sees them as actual URLs to password protect. Know what I mean?

        The page would have documents for downloading, for instance that can be edited through MODx, but the URL is blocked with that password when they try to view the page. Is that the sort of thing that would require a server handler to detect the URL and block its access?

        I know, it is a "special" need, but an interesting one to find out how to resolve!

        Thanks!
          • 4466
          • 14 Posts
          Quote from: nclemente at Feb 16, 2010, 09:44 PM

          Thanks.

          I think what they want is a simple login, e.g. like a separate server request login, that asks for a username and password to a particular MODx page. So any user (or even the public) can click on the link, but it asks for a completely different username/password.

          So kind of like password protecting a directory on cPanel (but of course, you can’t do it on cPanel because there is no actual real "folder", only a MODx URL.

          MODx is set up to show friendly URLs, but I’m not sure if cPanel sees them as actual URLs to password protect. Know what I mean?

          The page would have documents for downloading, for instance that can be edited through MODx, but the URL is blocked with that password when they try to view the page. Is that the sort of thing that would require a server handler to detect the URL and block its access?

          I know, it is a "special" need, but an interesting one to find out how to resolve!

          Thanks!

          thats what i’m looking for i just want to password one page.
          any one got any thing that may work????
            • 26931
            • 2,314 Posts
            you could try "DocPassword - DocPassword - Protect MODx documents with a unique password (Member accounts are not necessary!)" http://modxcms.com/forums/index.php?topic=21331
              • 3749
              • 24,544 Posts
              Or use Susan’s solution above and put a copy of the Personalize snippet on the page to show the login form to un-logged-in users and the page to others.
                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
                • 29201
                • 239 Posts
                I think Susan’s solution is exactly what I need however I don’t like that the password protected pages don’t show up in the menu/navigation despite being set to do show.

                Is there a workaround?
                  • 29201
                  • 239 Posts
                  ah yes good ole Weblinks. I’m thinking I’ll use managermanager to remove the weblinks from the client’s view....so as not to confuse them?

                  Thank you!!
                    • 12147
                    • 182 Posts
                    Finally gave this a try and it works great - the first time. Then it vanishes from the page. Tried both cached and uncached, installed as directed (checked 3 times).

                    Any pointers?

                    Evo 1.0.5, using FF2/Mac.
                      • 36709
                      • 4 Posts
                      Hi,

                      if still intersted, you can check this extension:
                      http://shop.spletnisistemi.si/en/modx-lock-website-with-password.html