Fixed password double encoding when updating a register and a security bug

Some tests needed. It's your risk ;-)

No login is needed for send passwords by mail. Corrected in last commit.