We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8609
    • 607 Posts
    I’m cracking my brain on this but haven’t come up with a solution yet... school is stealing all my brain cells away shocked

    I need to create a client portal of sorts on my modx site (using evo 1.0) where clients can log in, see their files/folders and be able to download them. The main thing is that a client should only see folders and files related to their projects. I’m managing several clients and it’s important that none of them be able to see each others files. Additionally, I don’t want the client to see the manager backend in totality, just their project files.

    Initially I planned to code something from the ground up and then just integrate it with my MODx site, but I’m wondering if I can get away without having to do that. Any ideas?
      • 7231
      • 4,205 Posts
      I have seen a plugin that will create a directory when adding a new user. You could do this and and use a setup like fileDownload that will hide the files actual location. Another option would be to use webloginPE and have some custom fields for the files.

      If it is only for download (not upload) then it is not as tough to setup with a system like filedownload (or filedownloadPE) and might not even need a custom dir for each user.

      Just some thoughts, but I haven’t used either setup tongue

      Not sure about the manager question
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 8609
        • 607 Posts
        Quote from: dev_cw at Sep 23, 2009, 09:48 AM

        I have seen a plugin that will create a directory when adding a new user. You could do this and and use a setup like fileDownload that will hide the files actual location. Another option would be to use webloginPE and have some custom fields for the files.

        If it is only for download (not upload) then it is not as tough to setup with a system like filedownload (or filedownloadPE) and might not even need a custom dir for each user.

        Just some thoughts, but I haven’t used either setup tongue

        Not sure about the manager question

        Shane,
        thanks for the ideas. I haven’t used or seen either of these snippets before, will definitely give them a try. Maybe I can do the manager thing with ManagerManager? Haven’t used that one before either... lol - motivation to get out of my comfort zone and play with some new snippets! rolleyes
          • 4310
          • 2,310 Posts
          EDIT!
          I was getting help on something like this a while ago, here’s a working plugin for creating a folder with the users name, when creating a new user from the manager.
          $e = &$modx->Event;
          $folder = $_REQUEST['newusername'];
          //$dir = $modx->config['rb_base_dir']."images/".$folder;
          $dir = "/Users/mine/Sites/dev/assets/images/".$folder;
          $folder_permissions = octdec($modx->config['new_folder_permissions']);
          
          function mkdirs($strPath, $mode){ // recursive mkdir function
                  if (is_dir($strPath)) return true;
                  $pStrPath = dirname($strPath);
                  if (!mkdirs($pStrPath, $mode)) return false;
                  return @mkdir($strPath);
          }
          
          switch ($e->name) {
          case "OnWUsrFormSave":
          if($_REQUEST['mode']== '87'){
            $old_umask = umask(0);
                  mkdirs($dir,$folder_permissions);
            umask($old_umask);
          }
            break;
            
            default: "";
          
            return;
          }

          Should give you some ideas for modifying to fit your needs.
            • 8609
            • 607 Posts
            Quote from: bunk58 at Sep 23, 2009, 11:14 AM

            EDIT!
            I was getting help on something like this a while ago, here’s a working plugin for creating a folder with the users name, when creating a new user from the manager.
            $e = &$modx->Event;
            $folder = $_REQUEST['newusername'];
            //$dir = $modx->config['rb_base_dir']."images/".$folder;
            $dir = "/Users/mine/Sites/dev/assets/images/".$folder;
            $folder_permissions = octdec($modx->config['new_folder_permissions']);
            
            function mkdirs($strPath, $mode){ // recursive mkdir function
                    if (is_dir($strPath)) return true;
                    $pStrPath = dirname($strPath);
                    if (!mkdirs($pStrPath, $mode)) return false;
                    return @mkdir($strPath);
            }
            
            switch ($e->name) {
            case "OnWUsrFormSave":
            if($_REQUEST['mode']== '87'){
              $old_umask = umask(0);
                    mkdirs($dir,$folder_permissions);
              umask($old_umask);
            }
              break;
              
              default: "";
            
              return;
            }

            Should give you some ideas for modifying to fit your needs.

            Thanks! this looks like a good start, will add it to my site tonight and do some tweaking to see how far I get
              • 34077 ☆ A M B ☆
              • 64 Posts
              Were you able to get this working successfully? I likely will be needing to build something exactly like this and would love to leverage anything you’ve figured out thus far.

              -Jason
                Jason Bird
                Twitter: @jasonabird @threeeyedbird
                • 8609
                • 607 Posts
                einsteinsboi Reply #7, 17 years ago
                Quote from: Bird at Oct 14, 2009, 02:12 PM

                Were you able to get this working successfully? I likely will be needing to build something exactly like this and would love to leverage anything you’ve figured out thus far.

                -Jason

                jason
                still working on it. So far I’m using FileDownloadPE and the Weglogin snippet. I’ve made quite some progress without doing any custom coding or snippets. I’m having a little trouble with the permissions but working on it. Will update when I have made more progress and hopefully completed it.
                  • 34077 ☆ A M B ☆
                  • 64 Posts
                  Thought I’d checkin and see how this is going. In the next month or so I’ll be trying to accomplish something similar and would love to see where you are at and how I might be able to help get it finished up.

                  -Jason
                    Jason Bird
                    Twitter: @jasonabird @threeeyedbird