We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37946
    • 70 Posts
    Hello,
    I am trying to run changePassword but I'm not having any luck reaching the old password.

    $modx->user->changePassword($newPassword,$oldPassword)
    


    How can I access the old password of any given user?

    I thought something like this might do it but no.
    $modx->user->get('password');
    


    In my case, I don't want the "old password" input. I just want the "new pass" and "confirm new pass" input fields. Is there a way to tell the API that I don't have the old password? Something like this:
    modx->user->changePassword($newPassword,null)
    


    As soon as I put the "old password" input back, everything works fine.

    [EDIT]
    This page from the docs is really what I'm after (I think).

    If I can just run this:
    $user->changePassword('b33r4me', 'boo123');
    


    like this:
    $user->changePassword(null, 'boo123');
    

    I'm home free! [ed. note: jentree last edited this post 14 years, 4 months ago.]