/**
  * Inits configuration
  *
  * @see Hackathon_MageMonitoring_Model_Widget::initConfig()
  */
 public function initConfig()
 {
     $helper = Mage::helper('magemonitoring');
     parent::initConfig();
     // add config for slow mode
     $this->addConfig(self::CONFIG_ALLOW_SLOW_MODE, $helper->__('Enable slower php methods to collect dir size?'), $this->_defAllowSlowMode, 'widget', 'checkbox', false, $helper->__('Warning! Depending on the size of your media directory this might take a very long time.'));
     return $this->_config;
 }
 /**
  * Display whether Mangento backend is reachable under the default "admin" route.
  *
  * @return $this
  */
 protected function _renderMoreChecks()
 {
     parent::_renderMoreChecks();
     $helper = $this->_getHelper();
     $node = (string) Mage::getConfig()->getNode(self::CONFIG_ADMIN_URL_XML);
     $this->getRenderer()->addRow(array($helper->__('Admin-URL in XML'), 'XML-Node: ' . self::CONFIG_ADMIN_URL_XML, $node, $helper->__('not admin')), $this->_getRowConfig(!is_null($node) && $node !== 'admin'));
     $configValue = Mage::getStoreConfig(self::CONFIG_ADMIN_URL_CUSTOM_PATH);
     $this->getRenderer()->addRow(array($helper->__('Custom admin URL'), self::CONFIG_ADMIN_URL_CUSTOM_PATH, is_null($configValue) ? 'not set' : $configValue, $helper->__('not admin')), $this->_getRowConfig(!is_null($configValue) && $configValue !== 'admin'));
     $this->_output[] = $this->getRenderer();
     return $this;
 }
 /**
  * Render the privacy report results.
  *
  * @return $this
  */
 protected function _renderMoreChecks()
 {
     parent::_renderMoreChecks();
     /** @var Hackathon_MageMonitoring_Helper_Data $helper */
     $helper = Mage::helper('magemonitoring');
     $secureUrl = Mage::getStoreConfig(self::CONFIG_SECURE_URL);
     $isHttps = substr($secureUrl, 0, 8) === 'https://';
     $this->getRenderer()->addRow(array($helper->__('Secure URL is https'), self::CONFIG_SECURE_URL, $secureUrl, $helper->__('starting with https://')), $this->_getRowConfig($isHttps));
     $this->_output[] = $this->getRenderer();
     return $this;
 }
 /**
  * Init Config
  *
  * @see Hackathon_MageMonitoring_Model_Widget::initConfig()
  */
 public function initConfig()
 {
     parent::initConfig();
     $configOrg = $this->getConfig();
     $configNew = array();
     $configNew[] = reset($configOrg);
     // "reset" config
     $this->_config = $configNew;
     // add title config
     $this->addConfig(self::CONFIG_WIDGET_TITLE, 'Widget Title:', $this->_defWidgetTitle, 'widget', 'text', true);
     // append old config
     $this->_config += $configOrg;
     return $this->_config;
 }
 /**
  * Render the accessibility status.
  *
  * @return $this
  */
 protected function _renderMoreChecks()
 {
     parent::_renderMoreChecks();
     $this->_checkFileAccessible('.git/config');
     $this->_checkFileAccessible('.svn/entries');
     $this->_checkFileAccessible('.htaccess');
     $this->_checkFileAccessible('.htpasswd');
     $this->_checkFileAccessible('index.php.sample');
     $this->_checkFileAccessible('install.php');
     $this->_checkFileAccessible('php.ini.sample');
     $this->_checkFileAccessible('LICENSE.html');
     $this->_checkFileAccessible('LICENSE.txt');
     $this->_checkFileAccessible('LICENSE_AFL.txt');
     $this->_checkFileAccessible('RELEASE_NOTES.txt');
     $this->_checkFileAccessible('favicon.ico', true);
     $this->_checkTouchIconSize()->_checkTouchIconSize(57)->_checkTouchIconSize(72)->_checkTouchIconSize(76)->_checkTouchIconSize(114)->_checkTouchIconSize(120)->_checkTouchIconSize(144)->_checkTouchIconSize(152);
     return $this;
 }
Пример #6
0
 /**
  * Render log file statistics.
  *
  * @return $this
  */
 protected function _renderMoreChecks()
 {
     parent::_renderMoreChecks();
     $firstDayOfThisMonth = strtotime(date('Y-m-01'));
     $firstDayOfLastMonth = strtotime(date('Y-m-01', $firstDayOfThisMonth - 1));
     $firstDayOfMonthTwoBefore = strtotime(date('Y-m-01', $firstDayOfLastMonth - 1));
     $firstDayOfMonthThreeBefore = strtotime(date('Y-m-01', $firstDayOfMonthTwoBefore - 1));
     // all error messages
     $this->_countLoggedErrors('Logged errors%s', 'The number of all logged errors (ERR, CRIT, ALERT, EMERG)');
     // error messages in log files last months
     $this->_countLoggedErrors('Logged errors%s', '', $firstDayOfMonthThreeBefore, $firstDayOfMonthTwoBefore);
     $this->_countLoggedErrors('Logged errors%s', '', $firstDayOfMonthTwoBefore, $firstDayOfLastMonth);
     $this->_countLoggedErrors('Logged errors%s', '', $firstDayOfLastMonth, $firstDayOfThisMonth);
     $this->_countLoggedErrors('Logged errors%s', '', $firstDayOfThisMonth, time());
     // all reports
     $this->_countReports('Reports%s', 'The number of reports currently saved in /var/reports');
     // reports last month
     $this->_countReports('Reports%s', '', $firstDayOfMonthThreeBefore, $firstDayOfMonthTwoBefore);
     $this->_countReports('Reports%s', '', $firstDayOfMonthTwoBefore, $firstDayOfLastMonth);
     $this->_countReports('Reports%s', '', $firstDayOfLastMonth, $firstDayOfThisMonth);
     $this->_countReports('Reports%s', '', $firstDayOfThisMonth, time());
     return $this;
 }
 /**
  * Render the patch status for all known patches in the list.
  *
  * @return $this
  */
 protected function _renderMoreChecks()
 {
     parent::_renderMoreChecks();
     foreach (array_keys($this->_patches) as $_patch) {
         $this->_checkPatchApplied($_patch);
     }
     return $this;
 }