/** * Should the for asking for an old password * * @return boolean */ public function getAskOld() { if (null === $this->askOld) { // By default only ask for the old password if the user just entered // it but is required to change it. $this->askOld = !$this->user->isPasswordResetRequired(); } // Never ask for the old password if it does not exist // // A password does not always exist, e.g. when using embedded login in Pulse // or after creating a new user. return $this->askOld && $this->user->hasPassword(); }