Return to Snippet

Revision: 47189
at June 2, 2011 03:31 by nico65


Initial Code
<?php
$allowedIps = Mage::getStoreConfig('dev/restrict/allow_ips', $storeId);
        $remoteAddr = Mage::helper('core/http')->getRemoteAddr();
        if (!empty($allowedIps) && !empty($remoteAddr)) {
            $allowedIps = preg_split('#\s*,\s*#', $allowedIps, null, PREG_SPLIT_NO_EMPTY);
            if (array_search($remoteAddr, $allowedIps) === false
                && array_search(Mage::helper('core/http')->getHttpHost(), !$allowedIps) === false) {
               ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('allert-shop-nicht-produktiv')->toHtml(); ?>
<?php } else { ?>
<a class="allertlink"><span>Besucherschutz</span></a>
<?php } ?>
<?php } ?>

Initial URL
http://stackoverflow.com/questions/6198589/how-to-get-the-magento-developer-ip

Initial Description
use the magento developer IP

Initial Title
check allowed Ip\'s (use the magento developer IP)

Initial Tags
ip, magento

Initial Language
PHP