We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10405
    • 288 Posts
    I've found what seems to be an issue with Login when used on a page set as the Site Start page. For some reason I can use the Login snippet without any problems on other pages (which all use the same template as the site start page) but when I try to log in when on the Site Start page (which was set to ID 1, though I also set it to a different ID and the same thing happened) it actually takes me to the site's holding page! (index.html)

    The whole snippet and everything associated with it works fine on every other page. It isn't a template issue, and if I set a particular page to "Site start" it just stops working on that page.

    Any ideas?

    The snippet is pretty standard:

    [[!Login? &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &errTpl=`lgnErrTpl` &loginResourceId=`12` &logoutResourceId=`10`]]
    


    And it's set inside a left column chunk in the template (exactly the same on all pages)

    I also tried putting the snippet in the content of the Site Start page but that did exactly the same thing... [ed. note: galahad5 last edited this post 14 years, 4 months ago.]
      • 10405
      • 288 Posts
      Anyone know what might be causing this? It works on all pages except whichever one is set to "Site Start"...
        • 10405
        • 288 Posts
        Ok, so if no one knows why this is happening on the Site Start page, should it be reported as a bug? I'm surprised no one else has encountered this problem before, I would have thought a signin form availablem on every page would be pretty common?
          • 3749
          • 24,544 Posts
          I just tried it on MODX 2.2.4 and had no trouble (not that that helps you).

          Is the LoginResourceId set to the site_start page? If so, that could be your problem.

          Is the error_page System Setting set to a different page than the site_start setting? Making them different pages might help.



          ------------------------------------------------------------------------------------------
          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
            • 10405
            • 288 Posts
            My LoginResourceID is set to ID 12, which is the Members Welcome page (restricted page I set up for landing on when login is successful) - the ID of the Site Start page is 13.

            I also set the Error page system setting to ID 17.

            Same thing is still happening- from the index.php (site start page, ID 13) if I use the login call, it simply redirects to the holding page for the site (index.html). I checked to see if it was authenticating at all, by trying to browse to members-welcome.html (ID 12) after the redirect, but it isn't logging the user in.

            Bizarre. From every other page it works fine.

            I *could* just set up a Login page and have a button linking to it rather than the actual form on each resource, but ideally I wanted people to be able to log in from any site page that contains the login call...

            ???
              • 10405
              • 288 Posts
              Interestingly, I've just set up Login on a different site / domain, from scratch, and on the Site Start page, when I place the Login call in the header, it's doing the exact same thing... going to the site holding page...

              BUT I just figured it.

              It doesn't seem to like a holding page being in place. I renamed my (non-MODx) holding page index.html to index.html.holding and tried again. Presumably, when it couldn't find that page, it went on to execute the login script, and I got through to the Members Welcome page.

              So the bug only seems to be on the site start page, and only happens if an index.html is in place.

              I have no idea why it does that (maybe Bob or one of team can shed some light!) but I got a fix for it anyway. smiley [ed. note: galahad5 last edited this post 14 years, 4 months ago.]
                • 3749
                • 24,544 Posts
                MODX sites often have trouble when you have an index.html file in the site root. It looks like your server sends you to the index.html file under some circumstances when it doesn't find the file it's looking for.

                Out of curiosity, what's the action in the form tag of the Login form?



                ------------------------------------------------------------------------------------------
                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
                  • 10405
                  • 288 Posts
                  Well, the Login snippet call is:

                  [[!Login? &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &errTpl=`lgnErrTpl` &loginResourceId=`8` &logoutResourceId=`6`]]
                  


                  And the form action in the template chunk is:

                  action="[[~[[*id]]]]" 


                  [ed. note: galahad5 last edited this post 14 years, 4 months ago.]
                    • 3749
                    • 24,544 Posts
                    If your login form is in a chunk, make sure the chunk tag is uncached -- otherwise the action ID may not be correct.

                    [[!$LoginChunkName]]




                    ------------------------------------------------------------------------------------------
                    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