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

    I’m curious about what would be the best solution to let user subscribe and allow them to create documents in Revolution.

    So let’s say a user registers on the website and then he can create documents in the manager structure.

    One way is that when a user registers, a container with his name or userid is created and the user will only have access to that container.

    Second way is to put all the documents in a special created container and allow user access only to the documents he created.

    Also would be nice to allow the user to change it’s personal information and probably associate some other fields similar to WebLoginPE.

    I just want to understand how this would work in Revolution. Would a custom module be the right way to go?

    Thank you

      • 1778
      • 659 Posts
      Hi
      Have a look at Login and its children (Register, ForgotPassword, UpdateProfile...) it should be a part of what you’re searching for (ability for users to register, update their personal info (profile) etc...)

      At this time I don’t know any add-on for Revo to allow users to create document in front-end.
      Cheers
        • 5340
        • 1,624 Posts
        Quote from: anso at Jun 05, 2010, 10:43 AM

        At this time I don’t know any add-on for Revo to allow users to create document in front-end.

        Why not use the manager and set up some sort of security like container start id functionality

        Thx
          • 3749
          • 24,544 Posts
          The tree_root_id user setting sets the top of the resource tree in the manager on a per-user basis. The user can only see resources in or below the container specified in tree_root_id.

          That would be one way to go.

          There are no modules in Revo and I don’t think a custom manager page would be necessary. It should be possible to create the user’s container when he or she registers and then set their tree_root_id user setting to that ID. You could also assign them to a user group with limited rights and a customized manager. When they log in to the Manager, they’ll only see the one container resource in the tree.
            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
            • 22295
            • 153 Posts
            One way is that when a user registers, a container with his name or userid is created and the user will only have access to that container.

            I’ve implemented it as you describe above (and actually, in a way also your second method, i used for blackboards). The application i did (social network) uses only front-end for everything, from administration to content editing, etc.. manager is never used as i (and the admins and surely the end users) dislike it.. it’s not customizable enough (surely without breaking the core code) - and mostly - in revo, it is very simple to make your own front-end, exactly as your client wants.

            To link the user to his container - I extended modUser class so the user also has ’profileId’ - which is the id of his container document. yet, this is not mandatory, you can just run a query based on ’createdby’, for example.
            Get to know also $modx->hasPermissions, although not necessary for what you describe - it can be very helpful once your logic grows beyond just: if (createdby = user->get(’id’)).
            Security is also not an issue, as your processors will always start with this check (createdby=userid?) - so nobody can try to change other’s content.




            I just want to understand how this would work in Revolution. Would a custom module be the right way to go?

            Processors is the way to go. This (+xpdo) is truly one of the best things in revolution, imho..
            I advice you to look at: \core\model\modx\processors
            You’ll find at least 80% of your code already there.. another tip is to use firebug’s NET tab to trace what’s going on when using the manager for actions you’re interested to have in the front-end.


            For simpler stuff - you can also combine [[formit]] with your own hook (which is the same idea, more or less..)