loadCache(self::VERIFICATION_RESULT_CACHE_KEY)) { return false; } if ($this->_isFileAccessible()) { return true; } $adminSessionLifetime = (int)Mage::getStoreConfig('admin/security/session_cookie_lifetime'); Mage::app()->saveCache(true, self::VERIFICATION_RESULT_CACHE_KEY, array(), $adminSessionLifetime); return false; } /** * If file is accessible return true or false * * @return bool */ private function _isFileAccessible() { $defaultUnsecureBaseURL = (string) Mage::getConfig()->getNode('default/' . Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL); $http = new Varien_Http_Adapter_Curl(); $http->setConfig(array('timeout' => $this->_verificationTimeOut)); $http->write(Zend_Http_Client::POST, $defaultUnsecureBaseURL . $this->_filePath); $responseBody = $http->read(); $responseCode = Zend_Http_Response::extractCode($responseBody); $http->close(); return $responseCode == 200; } /** * Prepare html output * * @return string */ protected function _toHtml() { if (!$this->_canShowNotification()) { return ''; } return parent::_toHtml(); } }