We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39927
    • 46 Posts
    I'm working on a front end registration page and everything works ... the thing I want to do is to eliminate the need to make a new user active, manually.

    Is there a way to make a newly registered front end user active automatically?

    Or ... is there a way to change the message that appears when they try to log in before they are active? At present, this message reads "Your account has been disabled. Please contact Administrator ... etc." [ed. note: alanhorvath last edited this post 14 years, 4 months ago.]
      Alan
      --------------------------------------------------------
      MODX Revolution 2.2.2-pl
      • 22019
      • 390 Posts
      You can do this using a Login.Register postHook snippet that retrieves the user id, updates the active field to 1 and then saves the user object.

      It's not great security, but you already know that....
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 4172
        • 5,888 Posts
        the register-snippet should send an activation-mail to new registered users, when configured correctly.

        whats your register-snippet-tag?
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 39927
          • 46 Posts
          odeclas: Thanks. Could you show me the snippet and also tell me where to place it? I'm only 4 days at learning all this! Thanks.

          Bruno17: Do you mean this? :

          [[!Register? 
          &submitVar=`registerbtn` 
          &activationResourceId=`10` 
          &activationEmailTpl=`myActivationEmailTpl` 
          &activationEmailSubject=`Thanks for Registering!` 
          &submittedResourceId=`9` 
          &usergroups=`Members` 
          ]]
          
            Alan
            --------------------------------------------------------
            MODX Revolution 2.2.2-pl
            • 4172
            • 5,888 Posts
            This is what I mean. The user registered should get a Mail for activating his account.
            you should have a confirmRegister - snippet - tag on page 10

            http://rtfm.modx.com/display/ADDON/Login.ConfirmRegister
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 22019
              • 390 Posts
              Hi @alanhovarth

              I was being dense. In your Register snippet just set this property:

              &activation=`0`


              and it won't send an activation email, it will make them active instead.
                Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
                • 39927
                • 46 Posts
                UPDATE: I added &activation=`0` to the Register snippet (above) and that made the new user Active ... only now, the new user isn't getting the email telling them so.

                I guess &activation=`0` turns off &activationEmailTpl=`myActivationEmailTpl` ... ?

                It's tough being a beginner ...
                  Alan
                  --------------------------------------------------------
                  MODX Revolution 2.2.2-pl
                  • 39927
                  • 46 Posts
                  Bruno17: You da MAN!!! LOL! That's what I needed ... success feels soooo good!

                  Thanks, man!
                    Alan
                    --------------------------------------------------------
                    MODX Revolution 2.2.2-pl
                    • 39927
                    • 46 Posts
                    In case anyone else is reading these posts and looking for the same answer, here's the short of it:

                    1. I put this snippet tag above the Registration Form in the New User Registration page:

                    [[ !Register?

                    &submitVar=`registerbtn`

                    &activationResourceId=`10` -- this is the page (index.php?id=10) they are directed to via the email link (see part 2 below)


                    &activationEmailTpl=`myActivationEmailTpl`

                    &activationEmailSubject=`Thanks for Registering!`

                    &submittedResourceId=`9` -- this is the page id (index.php?id=9) they see after clicking the Submit button in the Registration form


                    &usergroups=`Members`

                    ]]

                    2. I placed this HTML stuff into index.php?id=10 (see #1 above):

                    And this snippet is what I was missing before:
                    [[!ConfirmRegister]]


                    Your Membership is now active!

                    <a href="[[~8]]">Click Here to go to your Customer Dashboard!</a>


                    NOTE: href="
                    [[~8]]
                    " is the page I want members to go to when they log in.

                    I hope this helps other beginners. [ed. note: alanhorvath last edited this post 14 years, 4 months ago.]
                      Alan
                      --------------------------------------------------------
                      MODX Revolution 2.2.2-pl
                      • 4172
                      • 5,888 Posts
                      you should use modx-tags for urls like that:

                      <a href="[[~8]]">Click Here to go to your Customer Dashboard!</a>


                      this way the links will also work correctly, when you switch to FURLS

                      and please put code - tags arround all your codes with modx-tags in it here in the forum.
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!