We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44827
    • 4 Posts
    Hello.
    At first my english is not so good.
    I hope you can understand what i mean. wink

    My problem is:
    We have modx only for useradministration. Becaus the rest of the site runs with a php framework.
    And now we need to save the password of the users in an nother table in pure MD5.
    Becaus we want to write an own backend for our project.
    My question is:
    Is this possible? Can i save the password before it is hashed by modx? Is it possible to save
    this password in our own database?

    With kind regards

    Wesze
      • 3749
      • 24,544 Posts
      Please don't double post.

      It depends on how you're creating the Users. You might be able to do it in a plugin connected to OnBeforeUserFormSave. I'm not sure whether the user password has been hashed at the point or not -- you'd have to check.

      If you put this in your plugin to begin with and look at the Error log, it should tell you:

      $modx->log(MODX::LOG_LEVEL_ERROR, 'USER OBJECT: ' . print_r($user, true));
      $modx->log(MODX::LOG_LEVEL_ERROR, 'SCRIPTPROPERTIES: ' . print_r($scriptProperties, true));
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 44827
        • 4 Posts
        Sorry for the double post, but i became a 503 server error when i saved it...

        thx for your answer. i will test it today and will see what happens. wink
        I will check where the hash of the password is generated, i hope it will be working. laugh

        Ok i made it another way. I generated a preHook and this hook takes the password and the username and writtes it into the database. smiley
        it can be so easy... [ed. note: wesze_ last edited this post 13 years, 1 month ago.]
          • 3749
          • 24,544 Posts
          Ah, you didn't mention that you were using a snippet. I would have recommended a preHook.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting