We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    It seems to me it would be great to have a plugin to automatically create a user folder when a web user is created.
    It would allow to have a user page with a FileDownload and FileUpload call to set up a web user download page in their folder.

    Anyone wants to take a stab at this ?
    Or maybe someone already did ?
      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l'outil id
      • 7231
      • 4,205 Posts
      I think there was recent discussion on this but I can’t find the bookmark for it.
        [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]
        • 6726
        • 7,075 Posts
        Thanks, I’ll try to find this... if I am lucky the search is sometimes a bit ineffective tongue
        I’ll try with boardreader...

        Edit : No luck sad
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 4749
          • 623 Posts
          David, is this what you’re looking for:

          http://modxcms.com/forums/index.php/topic,25087.msg154044.html#msg154044

          Good luck!
            The MODx has you...
            Utah Web Design
            • 7231
            • 4,205 Posts
            cbaone: that is the project i had seen, now properly bookmarked. grin
              [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]
              • 6726
              • 7,075 Posts
              Thanks for the link !

              But no that’s not what I am looking for, what I need is to create a physical folder on the server for web users to have their own folder to upload files to.

              I already have a page which dynamically use the user name as folder name for donwload list and upload form, I’ll write this soon in a tutorial as it can be very handy.

              Only problem is there is no OnWUsrCreate event. You have OnBeforeWUsrFormDelete, OnBeforeWUsrFormSave, OnWUsrFormDelete OnWUsrFormPrerender, OnWUsrFormRender, OnWUsrFormSave but that’s all sad




                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l'outil id
                • 25551 ☆ A M B ☆
                • 1,231 Posts
                I will be keeping an eye on this thread as well! I have been waiting for a while to see if anyone could create folders per user and only be accessible to that user.

                I am currently working on a new website for myself that will be for a small group of designers. There are a few teething problems with it but it’s slowly getting there... the addition of user folders for uploads would be great.
                  Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                  AugmentBLU - MODX Partner

                  BLUcart - MODX Revolution E-Commerce & Shopping Cart
                  • 34017
                  • 898 Posts
                  use onWUsrSave

                  only run the new folder creation if ’mode = ’new’’

                  it’s line 165 of save_web_user_processor

                  or you could use OnUserFormSave

                  line 365 od save_user.processor.php
                    Chuck the Trukk
                    ProWebscape.com :: Nashville-WebDesign.com
                    - - - - - - - -
                    What are TV's? Here's some info below.
                    http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                    http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                    • 36416
                    • 589 Posts
                    Quote from: ChuckTrukk at Oct 30, 2008, 05:54 AM

                    use onWUsrSave
                    only run the new folder creation if ’mode = ’new’’

                    Even more foolproof way is to create it on demand by checking for folder availability on every webuser form save...
                      • 30223
                      • 1,010 Posts
                      There’s another event which is even simpler to use: ’OnWebSaveUser’. It isn’t listed under Web Users but under Web Access Service Events. The advantage with OnWebSaveUser is that you have access to all the user’s properties (in $modx->Event->params) including the username. With onWUsrSave you only have access to the user id and you’ll have to do an extra database lookup.

                      Here’s a plugin I just gobbled together:
                      //<?php
                      $evt    = &$modx->Event;
                      
                      switch($evt->name){
                      	case 'OnWebSaveUser': 
                      		if($evt->params['mode']=='new'){
                      			$dir = $modx->config['base_path'].$modx->config['rb_base_dir'].'files/'.$evt->params['username'];
                      			$folder_permissions = octdec($modx->config['new_folder_permissions']);
                      			if(! @mkdir($dir,$folder_permissions) ){
                      				$modx->webAlert("Unable to create user folder!");
                      			}			
                      		}	
                      		break;
                      }
                      //?>