We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31902
    • 342 Posts
    Okay, feeling stupid here.

    I'm trying to get the hang of installing a login form on a page using the Login component that would allow members to see only specific pages. At this moment, I have a test site that I'm using to teach myself how to do this, so any mistakes won't affect anything critical.

    I've installed Login and followed, to the tee, the tutorial outlined on this page:

    http://rtfm.modx.com/display/ADDON/Login.Basic+Setup


    I do have a test user, which I added through the backend (I'll teach myself how to have visitors become members on their own after I get over this first hurdle).

    What I see is that, after the 'member' adds the username and password in the form field (which is the username and password I gave the member through the control panel) and clicks the Login button, the page reloads on the same page (which in this case is the home page). When I look at the resulting source code of the page, the form shows it posting it to the URL of the site, like this:

    <form class="loginLoginForm" action="http://www.sample.com/" method="post">


    ...which no doubt comes from this part of the lgnLoginTpl chunk:

    <form class="loginLoginForm" action="[[~[[*id]]]]" method="post">


    Not that it matters, note that this forum added the "rel="nofollow"" tag to my code automatically. It's not part of my code.

    Anyway, that, and the rest of the tpl code is a direct copy/paste from the tutorial. However, it does not take the visitor to the success page, it just reloads the page the form is located on. Some notes:

    1. Both the test member and the super admin are part of the 'Members' User Group.

    2. Unlike in the tutorial, the pages' access permissions were arrived at by going to Security>Resource Groups and dragging the pages from the right column to the left column, under the 'Members Only' Resource group. In the tutorial, it just has you check the access box from within the page's Access Permissions tab (is that tab missing from the current MODx releases?)

    3. The form is called, not directly on the page's template, but rather through a chunk, which I assume shouldn't make any kind of difference.

    4. This test site is running under v2.2.2

    5. Only the page IDs were changed from the tutorial to reflect the page IDs in my test site.

    What am I missing? Is that tutorial complete?

    Thank you in advance. [ed. note: waizen last edited this post 14 years, 1 month ago.]
      • 31902
      • 342 Posts
      Well, here is what happened, but still not sure why this would be:

      For this test site, I still had the index.html page up there (with a re-direct to another site somewhere), as a simple way to keep it private (I know, not the most secure way to keep it private, but it's not that critical in this case) but still be able to work on the site as if it was live.

      ...anyway...

      As soon as I got rid of the index.html page and thereby making the index.php page live, the thing worked.

      Can anyone explain this?
        • 3749
        • 24,544 Posts
        All page requests in MODX are routed through index.php in the site root. If your server serves index.html in preference to index.php when a request comes in (most do), it bypasses MODX altogether. I the manager, requests are explicitly for index.php, so they work, but any general request in the front end is going to get hosed.


        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html
          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
          • 31902
          • 342 Posts
          Is that why a typical (non-user friendly URL) page address ends up looking like this:

          http://www.sample.com/index.php?id=11

          ...with the index.php still inside the address?

          Thanks for your prompt reply, Bob. I blew almost two days trying to figure this out. [ed. note: waizen last edited this post 14 years, 1 month ago.]
            • 3749
            • 24,544 Posts
            Yes, though that should only happen if the resource doesn't have an alias, you have FURLs turned off, or (I think) if you are previewing from the Manager in Evolution.


            ------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using.
            MODX info for everyone: http://bobsguides.com/modx.html
              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
              • 31902
              • 342 Posts
              Well, as for this test site, the FURLs are turned on, but I know what you mean. I'm running Revo v2.2.2 for this test site, not Evo.

              Yet, whether operating with FURLs or not, I assume the system still navigates with something like http://www.sample.com/index.php?id=11 behind the scenes rather than http://www.sample.com/alias.html, right? It's not as if (with FURLs) that the index.php?id=11 doesn't exist anymore, right? Hope that made sense.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                The rewrite function of the web server converts "domain.com/alias.html" to "domain.com/index.php?q=alias". MODx gets this, and uses a lookup table in memory to map "alias" to the correct resource ID.

                However, "domain.com/index.php?id=xx" will still work.
                  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