We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Looks like the problem is in that assets/components.../home.panel.js file, where the form is defined.
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Ok, I removed that .htaccess file, and it worked fine. So it's just that hard-coded "action" URL setting in the form causing the problem. It's on line 166.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 39632
        • 13 Posts
        should be this one:

        	req.open("POST", "../assets/components/importusersx/elements/import.php", true);
        


        if you dont give permission to the folder on the filesystem, it won't work. If I get what you are saying. Thanks
          MODX Revolution 2.2.8-pl
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          that's one of the hard-coded URLs. The one causing the problem when selecting the file is on line 166
           uploadForm.setAttribute('action',"../core/components/importusersx/controllers/home.class.php");
          
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 39632
            • 13 Posts
            is there a way to contact the author about this? so no more people would have to go through this troubleshoot.
              MODX Revolution 2.2.8-pl
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I've added to a bug report on his github account. Whether or not he's still actively supporting the add-on, I don't know. The last update to the github repository was a year ago.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 39632
                • 13 Posts
                Thanks sottwell for all your patience and detective work to find those hard coded paths.
                  MODX Revolution 2.2.8-pl
                  • 32699 ☆ A M B ☆
                  • 427 Posts
                  Quote from: nunofil at Jul 29, 2013, 05:45 AM
                  is there a way to contact the author about this? so no more people would have to go through this troubleshoot.

                  If you are looking for a one time import, skip all this.

                  Use phpMyAdmin. Create a dummy database and table. Import the csv. Export it as a PHP Array.

                  Iterate through the array via foreach.

                  In the loop add the user with modx->newObject
                  save the user.

                  With the user object API

                  • add the user to the group.
                  • force the password

                  save the user.

                  $profile= $userObj->getOne('Profile');
                  $profile->set('someField','someCsvColumnNameFromPhpExportArray['someField']');

                  Iterate through everything being imported to the profile and then $profile->save();

                  CSV is a poor mans way of exporting, but using Notepad++ or other decent editor you can change the field names listed in it to match the MODX ones and simply do something exotic like (from the top of my head - normal disclaimers of suitability, liability, and use at your own risk apply):
                  $userObj = $modx->newObject('modUser', $phparray);
                  $userObject->set('password', $phpArray['oldPassword');
                  $userObj->save();
                  
                  $userObj->joinGroup('groupName');  // if you have a create a MODX user role then $userObj->joinGroup('groupName', 'roleName');
                  
                  $profile = $userObj->getOne('Profile');
                  
                  $newProfile = $profile->fromArray($phpArray);
                  
                  $newProfile->save();
                  



                  Note: do not try to directly import the old password. MODX has a very nice password mechanism and your old password simply will not work unless you use it. I don't even want to know how you would have a user's clear text password.....

                  You can always put a bogus one in there and send all of the users to Login's reset password function... Just saying.

                  References:

                  http://www.shawnwilkerson.com/modx-revolution/2012/03/10/programmatically-working-with-the-moduser-object/
                  http://www.shawnwilkerson.com/modx-revolution/2012/03/04/modx-revolution-object-cheat-sheet-moduser/
                  http://www.shawnwilkerson.com/modx-revolution/2013/07/29/modx-revolution-object-cheat-sheet-moduserprofile/ *new this morning
                    Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                    Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    If you're importing hundreds of users, this add-on helps a lot by generating passwords, emailing everybody, and putting them in the group you specify all at the same time. Saves hours of work if you're dealing with a lot of users (as I will be doing sometime in the next few weeks). It's just that these hard-coded top-level URLs need to be changed to settings or to MODx variables or constants. I know the modExt allows for this, I just don't know how.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 32699 ☆ A M B ☆
                      • 427 Posts
                      I didn't even know such an addon was in the repository.

                      I believe we need to come up with a better way to catalog addons. I just went through the three areas I would have thought it to appear in and even searching for it, it does not appear.



                        Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                        Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com