Source of file Privacy.php

Size: 2,404 Bytes - Last Modified: 2015-05-15T11:18:15+02:00

/www-data/git/Hackathon_MageMonitoring/src/app/code/community/FireGento/MageMonitoring/Model/Widget/Privacy.php

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
<?php
/**
 * This file is part of a FireGento e.V. module.
 *
 * This FireGento e.V. module is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * This script is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * PHP version 5
 *
 * @category  FireGento
 * @package   FireGento_MageMonitoring
 * @author    FireGento Team <team@firegento.com>
 * @copyright 2015 FireGento Team (http://www.firegento.com)
 * @license   http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
 */

/**
 * Class FireGento_MageMonitoring_Model_Widget_Privacy
 * checks common privacy/security settings such as https urls.
 *
 * @category FireGento
 * @package  FireGento_MageMonitoring
 * @author   FireGento Team <team@firegento.com>
 */
class FireGento_MageMonitoring_Model_Widget_Privacy
    extends FireGento_MageMonitoring_Model_Widget_Abstract
{
    const NODE_NAME = 'privacy';
    const CONFIG_SECURE_URL = 'web/secure/base_url';

    /**
     * Returns widget name.
     *
     * @return string
     */
    public function getName()
    {
        return Mage::helper('magemonitoring')->__('Privacy');
    }

    /**
     * Returns the name of the widgets xml node
     *
     * @return string
     */
    protected function _getNodeName()
    {
        return self::NODE_NAME;
    }

    /**
     * Render the privacy report results.
     *
     * @return $this
     */
    protected function _renderMoreChecks()
    {
        parent::_renderMoreChecks();

        /** @var FireGento_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;
    }

}