We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39632
    • 13 Posts
    I searched the forum for a way to import users from a csv file to modx Revolution to a specific User Group. From what I understand, you have to use the Modx API, yet I could not find some clear step by step instructions of how to do it. Also tried ImportUsersX 1.0.1-pl plugin but it does not work.
    Could anyone point me in the right direction? Thanks in advance.

    https://forums.modx.com/index.php?topic=67023.0
    https://forums.modx.com/index.php/topic,67079.0.html

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

    [ed. note: nunofil last edited this post 13 years, 2 months ago.]
      MODX Revolution 2.2.8-pl
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      ImportX is for resources, not users. Did you mean http://modx.com/extras/package/importusersx
        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
        Quote from: sottwell at Jul 29, 2013, 01:53 AM
        ImportX is for resources, not users. Did you mean http://modx.com/extras/package/importusersx

        Thank you sottwell, sorry I meant ImportUsersX 1.0.1-pl

        Even with this example I get a 404 error when I try to import the csv:
        Alfred;Amsterdam;[email protected]
        Benjamin;Baltimore;[email protected]
        Charles;Casablanca;[email protected]
        David;Danemark;[email protected]
        Edward;Edison;[email protected]

        https://github.com/ackwa/ImportUsersX [ed. note: nunofil last edited this post 13 years, 2 months ago.]
          MODX Revolution 2.2.8-pl
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Sounds like you don't have the .csv file in the right place. Check your paths and permissions.
            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
            Once I select the csv files, ImportUsersX outputs 404 html. I really I'am confused about the way this plugin works.
            Its not from this UserEmailChunk, that would send the new user a way to set a new password. I don't see an option to get the file from my data sources/filesystem. Or even If I add the .csv extension to my content types. It doesn't work. Thanks again for the prompt answer. [ed. note: nunofil last edited this post 13 years, 2 months ago.]
              MODX Revolution 2.2.8-pl
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Hm. I get the "forbidden - you don't have permission to access /blah/core/components/importusersx/controllers/home.class.php on this server" error upon selecting the file. This is on localhost, so there's no file permissions problem.
                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
                Hey sottwell, I'll install on MAMP later and test it. If all goes ok, I will post it here.
                Thank you again for all your help.
                  MODX Revolution 2.2.8-pl
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I know why I'm getting the "forbidden" error; I've enabled the .htaccess file in the core directory to deny access for any HTTP request for any .php files! The form generated by the javascript is using "../core/blah/blah/..." as the action for the form. Bad idea. How could it work if somebody puts the core outside of the web root? Or, as I have with the .htaccess file, and the MODx Cloud does with nginx configurations, denys access? Bogus!!!
                    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
                  • discuss.answer
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    I see that in other places it also hard-codes presumed paths, such as ../assets/blah... which again could be useless if someone renamed their assets directory. Very sloppy.

                    I think those should be configuration settings, unless there is a default variable or constant in modExt for these paths/URLs. I'm a little hazy on that. But in any case, paths/URLs for the top-level directories (assets, connectors, core, manager) should never be hard-coded! [ed. note: sottwell last edited this post 13 years, 2 months 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
                      I don't have the .htaccess enabled on the core just on the root:
                      IndexIgnore *
                      RewriteEngine On
                      RewriteBase /
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                      
                      RewriteRule ^tags/([A-Za-z0-9]+)$ ?tag=$1 [L,QSA]

                      And changed the name of the /manager and /connectors probably I will need to have a look at the users import x plugin class to see what paths the author is using. All the other plugins/modules work fine.
                        MODX Revolution 2.2.8-pl