We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33657
    • 128 Posts
    What would be the simplest / best way to allow users who register on my website access to certain files based on their username. More than user groups, I need to give each client a PDF file individually tailored to them. I can create folders on the backend that link up to each user and upload the PDF's for them, but I'm trying to find out exactly how I can reference that said user.. either with user ID or something? or maybe there is an automated way to do it?

    any help or advice to start me off? thanks
      • 1778
      • 659 Posts
      Hello
      You could create a post-hook in Login.Register that create a specific folder for the just new registered user and you can of course specify the name you want for these folder, the simplest (imo) is to name the folder something like 'u123username' or something like that to prevent duplicates (user ID is unique, adding the username is just a 'human-reading' facility....

      Hope this put you on the right way...
      Cheers
        • 22019
        • 390 Posts
        @BobRay's book has a tutorial on MemberPages, which is a plugin that fires on user creation or editing that ties a user to a bespoke landing page that would probably be of use to you. As ever in MODX, there are multiple ways of achieving the goal....
          Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86