title: How to change user's password in joomla?
body: <p>I am writing a custom registration / authorization module for joomla and I'm wondering how with default joomla methods I could change user password? At the moment I have:</p>
  
  <pre><code>private function UpdateUser(){
      $user = JFactory::getUser($this-&gt;user_data['username']);
      $user-&gt;set('password', $this-&gt;user_data['password']);
      $user-&gt;set('password2', $this-&gt;user_data['password']);
      // $user-&gt;bind();
      $user-&gt;save();
  }
  </code></pre>
  
  <p>but the password is not updated.</p>
  
  <p>P.S.
  <code>$this-&gt;user_data</code> includes other staff about user, but i need update only password.</p>