コード例 #1
0
 /**
  * Get array of notification messages
  *
  * @param array $admin
  * @return array
  */
 public function adminNotifications(Auth_Model_User $admin)
 {
     $result = array();
     $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
     $this->config = $bootstrap->getOptions();
     $daySeconds = 3600 * 24;
     $expire_password = strtotime($admin->get_changed_password_dt()) + $daySeconds * $this->_getBootstrapOption('expire_password_day', 'default', 90);
     if ($expire_password < time() + 30 * $daySeconds) {
         if ($expire_password < time()) {
             $result['expire_password'] = $this->view->translate('Your password expired. Please update.');
         } else {
             $result['expire_password'] = strtr($this->view->translate('Your password expires in {days} days. Please update.'), array('{days}' => floor(($expire_password - time()) / $daySeconds)));
         }
     }
     return $result;
 }