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

    Using NewsPublisher to allow users to do front end resource submissions.

    Edit: MODX 2.6.5-pl and NewsPublisher 3.0.4

    NewsPublisher uses ElFinder and I am having problems restricting users from seeing and being able to access the entire public_html directory tree in the file explorer when uploading an image.

    I have tried to follow Bob's Guide for NewsPublisher as closely as I can. Currently, my ElfinderConnector snippet looks like this:

    [[!npElFinderConnector? &disableCommands=`archive, download, cut, copy, paste, duplicate, edit, open, mkdir, mkfile, netmount, netunmount, rm, rename, quicklook, view` &browserStartPath=`/directory/sub_directory` &browserStartURL=`/directory/sub_directory` &browserBasePath=`/home/mysite/public_html` &browserBaseURL=`/directory/sub_directory`]]

    What am I doing wrong? Any help would be really appreciated, this has been a major roadblock for me.

    This question has been answered by mick2470. See the first response.

      • 3749
      • 24,544 Posts
      You're explicitly giving them access to the entire public_html directory with this property:

      &browserBasePath=`/home/mysite/public_html`


      Change that to a directory lower down and they will only be able to browse that directory and those below it. IOW, it should match the &browserBaseURL setting.
        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
        • 53143
        • 9 Posts
        Hi Bob,

        Thanks for your reply and thanks for creating NewsPublisher - it's great.

        I'm sorry if I'm not understanding this right, but I have updated my snippet to the below:

        [[!npElFinderConnector? &disableCommands=`archive, download, cut, copy, paste, duplicate, edit, open, mkdir, mkfile, netmount, netunmount, rm, rename, quicklook, view` &browserStartPath=`/subfolder` &browserStartURL=`/subfolder` &browserBasePath=`/home/mysite/public_html/subfolder` &browserBaseURL=`/home/mysite/public_html/subfolder`]]


        ElFinder is still showing the entire public_html directory though.



        EDIT: Grammar. [ed. note: mick2470 last edited this post 5 years, 8 months ago.]
          • 42562
          • 1,145 Posts
          Try to remove anything StartPath
          &browserBasePath=`/home/mysite/public_html/subfolder/`//add final slash
          &browserBaseURL=`/subfolder/` //make this a proper web-accessible url
          
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 53143
            • 9 Posts
            Quote from: donshakespeare at Aug 22, 2018, 09:40 PM
            Try to remove anything StartPath
            &browserBasePath=`/home/mysite/public_html/subfolder/`//add final slash
            &browserBaseURL=`/subfolder/` //make this a proper web-accessible url
            

            Hey donshakespeare,

            Tried this, but still no luck unfortunately.
            • discuss.answer
              • 53143
              • 9 Posts
              For anyone interested, I have solved this.

              I had to create a new Media Source that specified the directory restrictions and apply it to the image TV.

              Thanks for everyone that tried to help, I really appreciate it.

              Cheers,
              Mick
                • 3749
                • 24,544 Posts
                I'm glad you got it sorted. Thanks for reporting back. smiley
                  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