We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15716
    • 57 Posts
    I’d like to create a one time user account. Let me explain what I want to do...

    - A user is assigned a arbitrary username and password from an admin (via email).
    - The user is then instructed to go to this website, log-in, and take a survey.
    - Once the survey is taken, the user is automatically logged off and their account is deleted.
    - (info from the survey is stored in a database...)

    I just can’t wrap my head around the whole user account thing...everything else is in place.

    How feasible is this? I’d just like some opinions...

    Thanks for any feedback!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You can create a webgroup for these users, then either manually create the user and assign him to that group, or use one of the snippets for allowing users to register themselves (WebLogin or WebLoginPE).

      Your code for processing the survey (I presume you will be storing that data in a table in the database) will need to take care of

      1. Logging the user out (see the WebLogin or WebLoginPE snippets for how to handle logouts)

      2. Deleting the user from the relevant tables in the database (web_users, web_user_attributes and web_groups; again you can see this done in the WebLoginPE 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