We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5568
    • 35 Posts
    Updated to 1.3.0.

    I have a login page using the following:

    [!WebLoginPE? &regType=`verify` &groups=`Registered Users` &notify=`[email protected]` &customFields=`fullnameprivate,aka,website,emailprivate,div1Title,div1,div2Title,div2` &inputHandler=`Keep my email private:userPrivateEmail:emailprivate:checkbox:()||Keep my Full Name private:userPrivateFullName:fullnameprivate:checkbox:()`!]

    I found the following problem completely by accident:

    The above coding produces a login page. Clicking the Register button presents a similar page with the appropriate info on registration. All is good, however when I leave all the fields blank and click the Register button, the first time it actually registers someone with no info? The second time it tells me that username has already been used?

    Do I not have all the parameters correct to verify that an email address has actually been entered or do I need to add another missing parameter?
    Any help greatly appreciated,
    Mark

    PS: I have already said that I really like this snippet! Keep up the great work, it would be nice if MODX 9.6.1 would have this much support!
      • 26435
      • 1,193 Posts
      Quote from: cobnet at Sep 18, 2007, 07:24 PM

      I found the following problem completely by accident:

      The above coding produces a login page. Clicking the Register button presents a similar page with the appropriate info on registration. All is good, however when I leave all the fields blank and click the Register button, the first time it actually registers someone with no info? The second time it tells me that username has already been used?

      Do I not have all the parameters correct to verify that an email address has actually been entered or do I need to add another missing parameter?
      Any help greatly appreciated,
      Mark

      PS: I have already said that I really like this snippet! Keep up the great work, it would be nice if MODX 9.6.1 would have this much support!

      Hey Mark.
      If any fields that you wish to have required MUST be set in the &regRequired parameter:
      [!WebLoginPE? &type=`register` &regRequired=`username,password,email`!]

      If you don’t tell WebLoginPE what is required, it will tolerate blank fields. You would, in most scenarios, want at least "username" and "password" required.

      -sD-
      Dr. Scotty Delicious, Scientist DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 5568
        • 35 Posts
        I knew that I was missing something here, lol!  Thanks for your patience, it works now!

        UPDATED!
        I have updated the coding to the following:

        [!WebLoginPE? &regType=`verify` &groups=`Registered Users` &notify=`[email protected]`&regRequired=`username,email,formcode` &customFields=`fullnameprivate,aka,website,emailprivate,div1Title,div1,div2Title,div2` &inputHandler=`Keep my email private:userPrivateEmail:emailprivate:checkbox:()||Keep my Full Name private:userPrivateFullName:fullnameprivate:checkbox:()`!] 
        
        
        


        I took the &regRequired=`password` out due to the fact that the password is not given on &regType=`verify` option.

        Now this has created a new problem.  When I use the above coding for my modx page and call it login.html, on the inital click a Login Form appears with the appropriate Register button, all is good here.  All buttons function as needed, now if someone attempts to log in instead of register, how would I require the &regRequired=’password’ on Login and not on Register?

        In my thinking which could be wrong here, I need to create 2 pages, one for Login and one for Register, then change the coding on the Register button to goto the Register page rather than keeping this one page for everything?

          • 26435
          • 1,193 Posts
          username and password fields are necessarily required for login
          WebLoginPE will throw error messages if either of those form fields are blank. You do not have to do anything specific to make the password and username fields required for login. It is automatic.

          -sD-
          Dr. Scotty Delicious, Scientist DFPA.
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages