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


/ Published in: PHP
Save to your folder(s)

use the magento developer IP


Copy this code and paste it in your HTML
  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 } ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.