We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46060
    • 27 Posts
    Hi. I have a situation where a single user should be able to create new user accounts, assign users to groups, create new user groups, and upload content that is available (for download) only to set groups. it seems like this could be an already-solved task, although I have not found any documentation that matches these requirements.


    The rest of the project involves having a front-end user be able to make changes 'in-line,' without logging into the manager, and it would be nice to have it all the same. maybe for my next project I'll create a custom Manager interface, but for now I'm aiming for this to all be handled on the front-end, without having anybody log into the Manager.


    I've been pursuing a solution using a (working) FileUpload snippet call in a template similar to:

    [[!FileUpload?
    &filefields=`1`
    &uploadgroups=`aSingleUser`
    &path=`assets/[[*id]]/uploads/contentType`
    &createpath=`Yes`
    ]]

    so that the FileUpload call would create a new path for content depending on which resource ID the snippet is called from.

    then the idea I had was to write some code so that when a new user group is created, a new resource is also created, and then the resource id would be tied to the new user group. then this (front-end-)manager would have a new resource from which to upload content for the new user group.


    this is my first project where I've relied almost completely on the MODx framework, vs. writing gobs of PHP, and I'd like to keep it within the MODx framework as much as possible, because it really does do the job efficiently. I've been using Evo for a few years, although now I've just recently jumped into Revo, so please don't assume that I know a whole lot when explaining stuff to me.


    thanks for taking the time to read this, and extra thanks if you can shed some light on this endeavor.


    -Dustin


    p.s.: I've underlined my tentative goals.

    This question has been answered by multiple community members. See the first response.

    [ed. note: blankha last edited this post 12 years, 9 months ago.]
    • discuss.answer
      • 3749
      • 24,544 Posts
      It sounds like the user-interface will be the biggest challenge. I think most of the code will be dictated by that.

      You can do anything you want when a form is submitted (create users, create user groups, create resources, create Resource Group Access ACL entries, etc.). That's all fairly straightforward, though checking to make sure the group/user/resource, etc. doesn't already exist and there are no name collisions may be a little tricky. The only real question at this point is where to put the link between the resource and the user-group. If that's a one-to-one relationship, you could store it in a TV value of the resource.

      Personally, I would probably allow the user to log in to the Manager, but have them see a very limited menu. Then, I'd create a CMP to do the job that forwarded the user directly to the appropriate manager page to accomplish certain tasks (e.g., the Create/Edit Resource and Create/Edit User panels). That way, MODX would take care of all the sanity checks.
        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
        • 46060
        • 27 Posts
        ok thank you.

        I think I'll just make a CMP with a limited Manager log in. the more I dig into it, it seems like I'm re-creating the wheel going about it the way I had first intended.
        • discuss.answer
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Personally, I have strong feelings against having Manager functions (other than simple content editing and creation) done in the front-end.

          Doing Manager functions should be different to focus the user's attention. "Hey, I'm in the Manager doing Manager stuff, this is important, I have to pay attention to what I'm doing".

          For the same reason I never have a Manager login on the front-end. Anybody going to work in the Manager should be able to go to its login form, wherever you may have installed it.
            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
            • 46060
            • 27 Posts
            thanks Susan and Bob. you don't realize it, but you've helped me so many times in the past, through your answers to others on these forums, and via your websites; and Bob, a while back I purchased The Official Guide you wrote, which has gotten thorough use.
              • 3749
              • 24,544 Posts
              Thanks for buying my book and for the kind words. smiley

              The digital version is coming soon (I hope).
                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