Skip to content

Commit

Permalink
Fixed bug when restricting by IP
Browse files Browse the repository at this point in the history
  • Loading branch information
jmelnick committed Dec 17, 2011
1 parent 7c99785 commit 25abe51
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/code/community/Dhmedia/Devel/Block/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ protected function _construct()
* Check Devel is allowed to run
*/
if (! Mage::helper('devel/config')->isDevelMode()) {
//return false;
return false;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Dhmedia/Devel/Helper/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public function allowDevel()
* If there are IP restictions, check remote IP against them.
* Deny if IP is restricted.
*/
$restrictedIpString = Mage::app()->getStore()->getConfig('dev/restrict/allow/ips');
$restrictedIpString = Mage::app()->getStore()->getConfig('dev/restrict/allow_ips');
if ($restrictedIpString) {
$restrictedIps = explode(',', str_replace(' ','', $restrictedIpString));
if (! in_array(Mage::app()->getRequest()->getServer('REMOTE_ADDR'), $restrictedIps)) {
Expand Down
17 changes: 0 additions & 17 deletions app/design/frontend/default/default/layout/devel/frontend.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,6 @@
<!-- Replace varien's js file with ours -->
<action method="removeItem"><type>js</type><name>varien/js.js</name></action>
<action method="addJs"><script>devel/varien/js.js</script></action>

<action method="addJs"><script>devel/data.js</script></action>
<action method="addJs"><script>devel/helpers.js</script></action>
<action method="addJs"><script>devel/toolbar.js</script></action>
<action method="addJs"><script>devel/hints.js</script></action>
<action method="addJs"><script>devel/panels.js</script></action>
<action method="addJs"><script>devel/sprites.js</script></action>

<!--<action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action>-->
<action method="addCss"><stylesheet>devel/css/data.css</stylesheet></action>
<action method="addCss"><stylesheet>devel/css/animations.css</stylesheet></action>
<action method="addCss"><stylesheet>devel/css/krumo.css</stylesheet></action>
<action method="addCss"><stylesheet>devel/css/toolbar.css</stylesheet></action>
<action method="addCss"><stylesheet>devel/css/panels.css</stylesheet></action>
<action method="addCss"><stylesheet>devel/css/hints.css</stylesheet></action>
<action method="addCss"><stylesheet>devel/css/sprites.css</stylesheet></action>
<action method="addCss"><stylesheet>devel/css/forms.css</stylesheet></action>
</reference>
<reference name="after_body_start">
<block type="devel/frontend" name="devel_frontend" before="-" />
Expand Down
41 changes: 37 additions & 4 deletions app/design/frontend/default/default/template/devel/frontend.phtml
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
<!--
To ensure the JS and CSS files only get loaded when Devel
is allowed to run, we've moved them from the frontend.xml file
to here.
@todo At some point, we should move them somewhere else, in
order to get them out of the template.
-->

<script type="text/javascript" src="<?php echo Mage::getBaseUrl() ?>js/devel/data.js"></script>
<script type="text/javascript" src="<?php echo Mage::getBaseUrl() ?>js/devel/helpers.js"></script>
<script type="text/javascript" src="<?php echo Mage::getBaseUrl() ?>js/devel/toolbar.js"></script>
<script type="text/javascript" src="<?php echo Mage::getBaseUrl() ?>js/devel/panels.js"></script>
<script type="text/javascript" src="<?php echo Mage::getBaseUrl() ?>js/devel/hints.js"></script>
<script type="text/javascript" src="<?php echo Mage::getBaseUrl() ?>js/devel/sprites.js"></script>

<style>
/*@import url(<?php echo Mage::getBaseUrl() ?>skin/frontend/default/default/devel/css/styles-ie.css);*/
@import url(<?php echo Mage::getBaseUrl() ?>skin/frontend/default/default/devel/css/data.css);
@import url(<?php echo Mage::getBaseUrl() ?>skin/frontend/default/default/devel/css/animations.css);
@import url(<?php echo Mage::getBaseUrl() ?>skin/frontend/default/default/devel/css/krumo.css);
@import url(<?php echo Mage::getBaseUrl() ?>skin/frontend/default/default/devel/css/toolbar.css);
@import url(<?php echo Mage::getBaseUrl() ?>skin/frontend/default/default/devel/css/panels.css);
@import url(<?php echo Mage::getBaseUrl() ?>skin/frontend/default/default/devel/css/hints.css);
@import url(<?php echo Mage::getBaseUrl() ?>skin/frontend/default/default/devel/css/sprites.css);
@import url(<?php echo Mage::getBaseUrl() ?>skin/frontend/default/default/devel/css/forms.css);
</style>

<!--
Main block
-->
<div id="dhmedia_devel_block_frontend">

<a
Expand All @@ -17,10 +47,10 @@

<div class="devel-data" rel="layoutXml" title="Xml">
<!--
You can't tab or space the following textarea without
creating problems with the editor. Putting in all on
one line works too.
-->
You can't tab or space the following textarea without
creating problems with the editor. Putting in all on
one line works too.
-->
<textarea id="layout-xml" name="layout-xml" class="devel-editor">
<?php echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n" ?>
<?php echo $this->getLayoutXml() ?>
Expand All @@ -29,6 +59,9 @@ one line works too.

</div>

<!--
Panel
-->
<div id="dhmedia_devel_block_panels">

<!-- These blocks are only here for reference. Remove when panel refactoring is done. -->
Expand Down

0 comments on commit 25abe51

Please sign in to comment.