/** * Update the password for a contact. Check with the current password when given * New accounts have no password so this check is not always needed. * * @param string $password * @param Contact $contact * * @return bool */ public function updatePasswordForContact($password, Contact $contact) { $Bcrypt = new Bcrypt(); $Bcrypt->setCost($this->getZfcUserOptions()->getPasswordCost()); $pass = $Bcrypt->create(md5($password)); $contact->setPassword(md5($password)); $contact->setSaltedPassword($pass); $this->updateEntity($contact); return true; }