1
M4d3L
Allow view debug mode for admin only??
  • 2004/2/16 15:30

  • M4d3L

  • Just popping in

  • Posts: 60

  • Since: 2002/11/18


Hi

I want to allow the debugmode juste for adminitrator only.
What can I do or what is the file I have to hack?


2
Mithrandir
Re: Allow view debug mode for admin only??

include/common.php Line 91
if ($xoopsConfig['debug_mode'] == 1) {
        
error_reporting(E_ALL);
    } else {
        
// Turn off error handler
        
$xoopsErrorHandler->activate(false);
    }


Change it to
if (($xoopsConfig['debug_mode'] == 1) && ($xoopsUser)) {
   if (
$xoopsUser->isAdmin()) {
      
error_reporting(E_ALL);
   }
   else {
      
$xoopsErrorHandler->activate(false);
   }
} else {
   
// Turn off error handler
   
$xoopsErrorHandler->activate(false);
}

3
hsalazar
Re: Allow view debug mode for admin only??
  • 2004/2/16 16:11

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


Mithrandir:

I've bookmarked this thread in my favorite snippets list. I think this should be included in the core. Great work!

Cheers.

PS. I know this is not really a useful contribution, but it's a way of calling attention to a piece of code that in my opinion is smart, useful and pertinent.

4
Mithrandir
Re: Allow view debug mode for admin only??

I'd like a system setting, which allowed the administrator to define the groups with debug access. Until then, this snippet can work fine.

5
M4d3L
Re: Allow view debug mode for admin only??
  • 2004/2/16 19:34

  • M4d3L

  • Just popping in

  • Posts: 60

  • Since: 2002/11/18


Tank a lot!!!

6
M4d3L
Re: Allow view debug mode for admin only??
  • 2004/2/16 19:40

  • M4d3L

  • Just popping in

  • Posts: 60

  • Since: 2002/11/18


Hum! If I put the hack, that not work...

It dont show any bug!

But if I dont put the hack, I have 23 Notice...

???

7
M4d3L
Re: Allow view debug mode for admin only??
  • 2004/2/17 20:35

  • M4d3L

  • Just popping in

  • Posts: 60

  • Since: 2002/11/18


this hack doesn't work!!!

8
phppp
Re: Allow view debug mode for admin only??
  • 2004/2/27 15:04

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Quote:

yoyo2021 wrote:
Hum! If I put the hack, that not work...

It dont show any bug!

But if I dont put the hack, I have 23 Notice...

???



Make sure $xoopsUser is handled before it is being called.



Login

Who's Online

163 user(s) are online (93 user(s) are browsing Support Forums)


Members: 0


Guests: 163


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits