• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

"Debug Info" in Footer for Admins Only

Vincent

Well-known member
#1
VincentU submitted a new resource:

"Debug Info" in Footer for Admins Only (version 1.0) - Only show the debug information in the footer to administrators.

Hello,
I think my users don't have to know when debug mode is on, that's why I made this modification. It only shows the debug info for logged in admins.

Open up the template called footer,

Search for:
Code:
<xen:if is="{$debugMode}">
Replace with
Code:
<xen:if is="{$debugMode} AND {$visitor.is_admin}">
Done ;)
Read more about this resource...
 
#2
I've been looking for this, but even if I replace the code as above, the debug info wont show for admins.

The only way to make it show is if I enable debug mode in config.php
 

Vincent

Well-known member
#3
I've been looking for this, but even if I replace the code as above, the debug info wont show for admins.

The only way to make it show is if I enable debug mode in config.php
That's not a bug, that's how it's designed.
The debug info, by default, only shows when debug mode is on. Normally it shows it to everyone but thanks to this modification it only shows the debug information to admins when debug mode is on.
 
#5
Doesn't seem to be working with 1.5.6.

But this works:

// Enable debug mode for these IP addresses
$allowedIPs = array(
'127.0.0.1', // First allowed IP address
'127.0.0.1', // Second allowed IP address
);

if (in_array($_SERVER['REMOTE_ADDR'], $allowedIPs)) {
$config['debug'] = true;
}