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

    Currently the way the ’manage web users’ tab is setup in Modx Manager is with fullname. I’d like to changed fullname to firstname lastname, two separate fields and have it show up like that in the Manager. What Modx file would I have to mess with to get something like that going?

    Also, the way I’m creating login/logout is with email address and password, rather than username/password. I will be adding the email field to web_users table and delete it from the web_users_attributes.

    My overall question is, if I change Modx backend stuff, when I upgrade to newer versions of it, will the upgrade change any of my specific settings?

    Thanks,

    Josh
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Any changes you make to the core code will be overwritten if you upgrade.

      To make the changes you want, you will need to make changes to several files and the database.

      You can use email addresses as usernames without any changes. The email address must be in the web_users_attributes table for the user manager scripts to work properly.

      You are, of course, free to hack away, but it will mean you will not have a clear upgrade path.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 22815
        • 1,097 Posts
        Personally I think that having the email address in web_users_attributes is short-sighted and pointless, and I’ve mentioned this previously. But that’s what we’ve got. So I don’t blame anyone for wanting to change it. And as many other systems have First Name, Last Name I can see why someone would want to change that.

        However, you need to be prepared to reapply the changes each time you upgrade, and to expect issues with other snippets.

        It is probably therefore easier to code up a web login snippet that uses web_users_attributes, as that doesn’t mean any changes to the core. (Personally, I’d make it look for username unless there was an @ sign, in which case it would look at the email logins).

        If you’re changing Full name > First Name, Last Name, then that *will* need changing. I’d suggest adding the fields rather than removing Full Name, and populating Full Name whenever First Name & Last Name are changed. Removing a field will make stuff error; adding fields is harmless.

        There are a number of MODx files you’d have to add to to get this to work; there’s like processors and actions and stuff. Search for one of the fieldnames from the form to find the pages.

        If you’re doing a lot of customisations to web user management, then I’d recommend that you consider writing it as a distinct module. That way you would isolate your changes from the rest of MODx, and it would survive an upgrade.

        In short, the methods of working alongside MODx should always be considered before hacking. It may take more time now, but it will save time later. And because you can then share your work, there’s a whole heap of other benefits too.
          No, I don't know what OpenGeek's saying half the time either.
          MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
          Forum: Where to post threads about add-ons | Forum Rules
          Like MODx? donate (and/or share your resources)
          Like me? See my Amazon wishlist
          MODx "Most Promising CMS" - so appropriate!
          • 14796
          • 59 Posts
          Thank you Susan and Paul for the helpful information smiley

          Susan - You mentioned I can use the email as the username without hacking anything. Could you please explain further in how I would go about doing something like that?

          Thanks again!

          Maybe in the future this feature can be embedded within Modx so someone has more flexibility over what they would like to use as the username for login purposes, and when going to the "manage web users" section of the Modx Manager...I’ll suggest it in the suggestion area.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Just use an email for the username, and fill in the email field as well. That’s what I do in the RegisterX snippet.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 14796
              • 59 Posts
              I’m currently using the Weblogin snippet. Is the RegisterX better than the standard snippet?
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                RegisterX is unrelated. It’s intended to provide a simple way to have users register for ... whatever, such as newsletters or something. The user submits his email address, and a new web user is created with a random password, and assigned to a web user group you specify in the snippet call. Then you can do whatever you want with the users belonging to that group.

                The point was that the web user is created with the username as the email address, and to satisfy the manager user system the email is also inserted into the web_users_attributes table.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 14796
                  • 59 Posts
                  Hey Susan,

                  Thanks for the helpful hint. I got it to work using email addresses as the username smiley