You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added a configuration setting to configure a list of allowed IP-Addresses. All other IPs won't see a jdump output. But there will be no error when dc_dump is used in the code.
In the plugin constructor, i have added the following code:
$com_params = JComponentHelper::getParams('com_dump');
$checkforIP=$com_params->get('dump_ip');
$userIP=$_SERVER['REMOTE_ADDR'];
$checkforIP=$checkforIP ? explode(',',$checkforIP) : false;
if (!$checkforIP || in_array($userIP,$checkforIP) ) {
define("DUMP_ALLOWED",true);
} else {
define("DUMP_ALLOWED",false);
}
The whole code in the onAfterRender-function is in this if-clause:
if(defined('DUMP_ALLOWED') && DUMP_ALLOWED) { ... }
The same if-clause wraps the code in the dump-function from the fourth line of code:
if(defined('DUMP_ALLOWED') && DUMP_ALLOWED) {
if (function_exists('debug_backtrace')) {
....
In the components config.xml, i have added an additional parameter to store the IP-Addresses (and a helper element to show me the current ip):
<param name="dump_ip" type="textarea" cols="30" rows="5" label="IP-Address" description="Set the IP-Address(es) for which the JDump should be active. Separate multiple addresses with comma, leave empty for every user." default="" />
<param name="@currentip" label="Your current IP-Address" type="currentip" extension="com_dump" ptype="system" />
The text was updated successfully, but these errors were encountered:
I have added a configuration setting to configure a list of allowed IP-Addresses. All other IPs won't see a jdump output. But there will be no error when dc_dump is used in the code.
In the plugin constructor, i have added the following code:
$com_params = JComponentHelper::getParams('com_dump');
$checkforIP=$com_params->get('dump_ip');
$userIP=$_SERVER['REMOTE_ADDR'];
$checkforIP=$checkforIP ? explode(',',$checkforIP) : false;
if (!$checkforIP || in_array($userIP,$checkforIP) ) {
define("DUMP_ALLOWED",true);
} else {
define("DUMP_ALLOWED",false);
}
The whole code in the onAfterRender-function is in this if-clause:
if(defined('DUMP_ALLOWED') && DUMP_ALLOWED) { ... }
The same if-clause wraps the code in the dump-function from the fourth line of code:
if(defined('DUMP_ALLOWED') && DUMP_ALLOWED) {
if (function_exists('debug_backtrace')) {
....
In the components config.xml, i have added an additional parameter to store the IP-Addresses (and a helper element to show me the current ip):
The text was updated successfully, but these errors were encountered: