We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19788
    • 8 Posts
    Hi again,
    I believe I am slowly but surely getting to terms with ModX, however I am a bit confused with the user system.

    What is the best way to use modUser? I mean, how do I go about creating a front end registration/login for members etc? I have gone through the wiki and documentation and it’s a bit sketchy with regards to this, all I seem to be able to do at this point is create users within the admin (manager) system.

    I know I could probably just create forms myself and write out php with mysql to insert a record into the user table for ModX, but I would have thought there was something built into the system to handle all this already?

    Thanks in advance,

    mjmac87
      • 3749
      • 24,544 Posts
      I assume that you’re using MODx Revolution. In that case, just download and install the Login package.

      If you’re using Evolution, check out the WebLoginPE add-on.
        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
        • 19788
        • 8 Posts
        Ah, that’s smashing! Thanks!

        Saves me a lot of time messing around creating it from scratch lol.

        Thanks again BobRay
          • 19788
          • 8 Posts
          Okay I have a quick question,

          I want to add some extra input fields to the registration form, I know if I add for example; mobile, referrer_name that it will use the modUser extend, but if I add dob or any of the address fields, will it populate the modUser fields rather than the extended?

          Also, I am having problems with printing out the errors? even copying and pasting the example registration form, the error reporting doesn’t seem to work, any ideas?
            • 3749
            • 24,544 Posts
            I don’t know about the error reporting, but on the fields, I think if you specify the extended field on assignment, it will go there. The same with getting them back out. It should be easy to test by looking at the extended field of the modx_user_profiles table in PhpMyAdmin. The extended fields are there in json format.
              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
              • 19788
              • 8 Posts
              Hmm, guess I will just have to implement the fields and see what happens.

              I managed to get the error reporting working, I didn’t have the submitVar set up properly with the submit button, I replaced it with an image button instead.

              Thanks again for the help BobRay
                • 19788
                • 8 Posts
                Hmmm, okay I am now facing a new problem. I have tried several different methods of trying to log the web user out but for some reason, modx still appears to have them logged in.

                Scenario:
                I am echoing out the current user’s username in the header.

                If I go to the login page, I log in as admin and the username in the head reads admin, the login form is replaced with a link to logout.

                If I click log out, the logout link is then replaced with the login form again. However, the username is still reading as Admin? I have read about using the ! to force things to not be cached, but this doesn’t seem to do anything either?

                I have gone through the actual files and read through the php, in the login.class there is only a single reference to logout and that is creating the link, the rest is within the snippet and it is hard to say how exactly it is telling modx to log the web user out?

                Any ideas?

                Thanks,
                MjMAC87

                Edit: Okay, I think I have worked it out lol, sorry, first time using a proper CMS, normally use to using my own etc. Found it was due to the resource being cached, I would have thought that if the tags where all set to be not cached it would work. Anyway, all working now smiley
                  • 3749
                  • 24,544 Posts
                  Uncached tags should work, but remember that if you’re previewing from the Manager, the username will come up as ’admin’ when you’re not logged in in the front end.
                    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
                    • 19788
                    • 8 Posts
                    Yeah I created I snippet to echo out the current session contexts, which led me in the right direction towards seeing what was happening. The snippet echoing out the username was being called uncached and within the header chunk which is on every page.