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,

    Continuing form a previous thread, I have Login set up with all the relevant handler resources, but once the email is sent to the user after registering, the link provided looks O, but gives the user a 404 error.



    And for now I set the redirect to a standard unprotected resource.

    This is my Register snippet:

    [[!Register?
    &submitVar=`registerbtn`
    &activationResourceId=`114`
    &activationEmailTpl=`lgnActivateEmailTpl`
    &activationEmailSubject=`Thanks for Registering with the LTDA!`
    &submittedResourceId=`113`
    &usergroups=`Members`

    ]]

    This is resource 114

    [[!ConfirmRegister? &redirectTo=`1`]]



    And this is my Register form:

    <div class="register">
    <div class="registerMessage">[[+error.message]]</div>

    <form class="form" action="[[~[[*id]]]]" method="post">
    <input type="hidden" name="nospam:blank" value="" />

    <label for="username">[[%register.username? &namespace=`login` &topic=`register`]]
    <span class="error">[[+error.username]]</span>
    <input type="text" name="username:required:minLength=8" id="username" value="[[+username]]" />
    </label>

    <label for="password">[[%register.password]]
    <span class="error">[[+error.password]]</span>
    <input type="password" name="password:required:minLength=8" id="password" value="[[+password]]" />
    </label>

    <label for="fullname">[[%register.fullname]]
    <span class="error">[[+error.fullname]]</span>
    <input type="text" name="fullname:required" id="fullname" value="[[+fullname]]" />
    </label>
    <label for="email">[[%register.email]]
    <span class="error">[[+error.email]]</span>
    <input type="text" name="email:email" id="email" value="[[+email]]" />
    </label>

    <div class="form-buttons">
    <input type="submit" name="registerbtn" value="Register" />
    </div>
    </form>
    </div>

    The activation link looks pretty normal to me:
    http://domain.com/membership-confirmation-handler/?lp=cjJqcW13NGQ&lu=MTIzNDU2Nzg


    But it must be malformed somehow?

    Any ideas anyone?

    Thanks in advance!
    Andy
      • 51020
      • 670 Posts
      Ok - I have found the problem I think - but I don't know how to fix it!


      The activation link only fails if i user a numerical username. If i use:
      abcdefg as the username - the user gets activated and redirected to the relevant resource.
      if is use:
      12345678 as the username - the user gets a 404 error.

      unfortunately in this scenario, all the users will be using numerical user names!!

      Is there a way to enable/fix this?
        • 3749
        • 24,544 Posts
        Usernames that start with a number confuse MODX (just as variable names in PHP can't start with a number). In some MODX methods, the number indicates that the value is a number rather than a string, so MODX looks for a user with that ID rather than that username.

        The only solution at present is to prefix the usernames with a letter or string of letters.
          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