Posted By

nico65 on 06/02/11


Tagged

ip dev magento


Versions (?)

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


 / Published in: PHP
 

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

use the magento developer IP

  1. <?php
  2. $allowedIps = Mage::getStoreConfig('dev/restrict/allow_ips', $storeId);
  3. $remoteAddr = Mage::helper('core/http')->getRemoteAddr();
  4. if (!empty($allowedIps) && !empty($remoteAddr)) {
  5. $allowedIps = preg_split('#\s*,\s*#', $allowedIps, null, PREG_SPLIT_NO_EMPTY);
  6. if (array_search($remoteAddr, $allowedIps) === false
  7. && array_search(Mage::helper('core/http')->getHttpHost(), !$allowedIps) === false) {
  8. ?>
  9. <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('allert-shop-nicht-produktiv')->toHtml(); ?>
  10. <?php } else { ?>
  11. <a class="allertlink"><span>Besucherschutz</span></a>
  12. <?php } ?>
  13. <?php } ?>

Report this snippet  

You need to login to post a comment.