/** * overrule to add your own buttons. * * @return \Gems_Menu_MenuList */ protected function getMenuList() { if ($this->user->isPasswordResetRequired()) { $this->menu->setVisible(false); return null; } return parent::getMenuList(); }
/** * Test the password for maximum age (in days). * * @param mixed $parameter * @param string $password */ protected function maxAge($parameter, $password) { $age = intval($parameter); if (is_null($password)) { // We return the description of this rule $this->_addError(sprintf($this->translate->_('should be changed at least every %d days'), $age)); } elseif ($age > 0 && !$this->user->isPasswordResetRequired() && $this->user->getPasswordAge() > $age) { // Skip this if we already should change the password $this->_addError(sprintf($this->translate->_('has not been changed the last %d days and should be changed'), $age)); $this->user->setPasswordResetRequired(); } }
/** * 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(); }