/** * Return true if a password reset key can be created. * * Returns the setting for the definition whan no user is passed, otherwise * returns the answer for this specific user. * * @param \Gems_User_User $user Optional, the user whose password might change * @return boolean */ public function canResetPassword(\Gems_User_User $user = null) { if ($user) { // Depends on the user. if ($user->hasEmailAddress() && $user->canSetPassword()) { $email = $user->getEmailAddress(); if (empty($email)) { return false; } else { return true; } } } else { return true; } }