We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    HI,

    OK I have Login set up and it works OK.
    I have changed form using Resource Groups, to using a template which only allows logged in users to view them - but now, when a user registers, they get the activation email, but when they click on the link, they get a 404 error.

    The URL they get is in this format:
    http://domain.com/membership-confirmation-handler/?lp=XXXXXXXXXXXX=XXXXXXXXX

    Which looks OK to me.

    I've checked:
    &activationResourceId=`114`
    &submittedResourceId=`113`

    And they are all correct.

    Anything I'm missing at all?

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

      • 46886
      • 1,154 Posts
      I think someone should stop by soon with some real knowledge of this problem, but for now I did some research on this.

      Let's see your confirmation snippet pls, after copying it over here pls put in the &errorPage=`X` variable to try to get more info.

      Also, is the link confirming the registration? Just because it is going to 404 doesn't mean the user isn't being activated, pls check that as well.
        • 3749
        • 24,544 Posts
        The resource at the URL they get sent to should contain just the ConfirmRegister snippet tag. It's easy to get confused about the Register, thanks for registering, ConfirmRegister, and "you are confirmed" pages.
          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
          • 51020
          • 670 Posts
          Quote from: nuan88 at Apr 14, 2016, 08:06 AM
          I think someone should stop by soon with some real knowledge of this problem, but for now I did some research on this.

          Let's see your confirmation snippet pls, after copying it over here pls put in the &errorPage=`X` variable to try to get more info.

          Also, is the link confirming the registration? Just because it is going to 404 doesn't mean the user isn't being activated, pls check that as well.

          Hi - thanks for this.
          The confirmation snippet is:

          [[ConfirmRegister? &redirectTo=`3`]]

          3 = the ID of the members only page.

          I wasn't quite sure what you mean by this:
          "pls put in the &errorPage=`X`"

          The link isn't confirming registration - it's staying greyed out in the users page.
            • 51020
            • 670 Posts
            Quote from: BobRay at Apr 15, 2016, 03:42 AM
            The resource at the URL they get sent to should contain just the ConfirmRegister snippet tag. It's easy to get confused about the Register, thanks for registering, ConfirmRegister, and "you are confirmed" pages.

            Yes - I think I have that correct though as per the comment above.
            I did have this all working, until I removed the resource group settings. Could that have anything to do with it not working?
            Originally I had a resource group with the member pages inside, but I wanted them to be visible to all visitors, so went down the route of using a snippet called [[!PrivatePage]] at the top of the template for all member pages.

            The snippet code is this:

            <?php
            /* PrivatePage snippet */
            /* Redirect anyone who is not logged in */

            $key = $modx->context->get('key');
            if (! $modx->user->hasSessionContext($key)) {
            $modx->sendUnauthorizedPage();
            }
            return '';


            So it detects whether the user is logged in or not.

            I have to admit that I copied and pasted this code (possibly form you bob!) so I don't completely understand what's going on behind the scenes.
            • discuss.answer
              • 51020
              • 670 Posts
              Scrap that - I think it must have been a weird caching issue - even though I always use private browsing when testing thee things to allow multiple sessions, it seems that it's all working now!
                • 46886
                • 1,154 Posts
                Ah great you got it sorted. Yeah caching issues can be a pain, its so important to flush everything out.

                By the way the &errorPage variable allows you to specify a custom error page, this is to see if the snippet is firing, and I think it can provide more info too
                  • 51020
                  • 670 Posts
                  Ah OK thanks - I'll check out the &errorPage variable too.
                    • 51020
                    • 670 Posts
                    Quote from: nuan88 at Apr 20, 2016, 07:03 AM
                    Ah great you got it sorted. Yeah caching issues can be a pain, its so important to flush everything out.

                    By the way the &errorPage variable allows you to specify a custom error page, this is to see if the snippet is firing, and I think it can provide more info too

                    Thought this problem had gone away, but seems to be lingering!
                    Where do I put the &errorpage variable? I added it to my confirmation handler, but it still gives me a standard 404 error message.

                    [[ConfirmRegister? &redirectTo=`3` &errorPage=`140`]]

                    is the above wrong?

                      • 3749
                      • 24,544 Posts
                      That's correct, but the &errorPage will only be used if the user has already visited the ConfirmRegister page before and is already active.

                      BTW, the code above (sendUnauthorizedPage() ) will send the user to the page specified in the unauthorized_page System Setting.
                        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