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

    I wanted that people could register as users by some form on webpage (as it was possible in modx evolution) and attach them to some group. I couldn’t find anything in api or docs so I took a glance at modx/processors/security/user/create.php

    I don’t quite understand what’s going on there. As I understand this part of code is responsible for creating new user ’slot’ and then modyfing it:
    $modx->invokeEvent('OnBeforeUserFormSave',array(
    	'mode' => 'new',
    	'id' => $_POST['id'],
    ));


    As I later read in some Wiki:
    invokeEvent();
    This is not an API Function and requires extensive knowledge of the MODx core in order to be used correctly. Use of this function in areas other than the core code is discouraged and the team may provide little or no help on the use of this function.

    My question is:

    Does MODx Revolution provide some way of adding users in 3rd party code?

    --
    Regards
    MM
      • 22295
      • 153 Posts
      There are a couple.
      In case you don’t have any custom schema - the quickest way is "Login" snippet, it has "Register" - registration form, email activation, forget password and so on...

      http://svn.modxcms.com/docs/display/ADDON/Register
      http://svn.modxcms.com/docs/display/ADDON/Login+Snippet
        • 32699 ☆ A M B ☆
        • 427 Posts
        Just be aware the included chunks are a bit sparse and will need a little attention if you are wanting to capture more than the username, fullname, and a password.

        Overall these snippets appear to be even simpler than the Evo versions
          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