11
Lord_Venom
Re: xoops debug active for registered users
  • 2009/6/15 21:13

  • Lord_Venom

  • Not too shy to talk

  • Posts: 165

  • Since: 2006/5/12


hum no my XOOPS is 2.3.3
i'm sorry my translator is crazy...

My SourceForge

12
Lord_Venom
Re: xoops debug active for registered users
  • 2009/6/15 21:31

  • Lord_Venom

  • Not too shy to talk

  • Posts: 165

  • Since: 2006/5/12


It's ok edit include/common.php move

// #################### Error reporting settings ##################    
    
    
if ( $xoopsConfig['debug_mode'] == 1  || $xoopsConfig['debug_mode'] == ) {
        
error_reporting(E_ALL);
        
$xoopsLogger->enableRendering();
        
$xoopsLogger->usePopup = ( $xoopsConfig['debug_mode'] == );
    } else {
        
error_reporting(0);
        
$xoopsLogger->activated false;
    }
    
$xoopsSecurity->checkBadips();


after
if ($xoopsModule->getVar('hasconfig') == || $xoopsModule->getVar('hascomments') == || $xoopsModule->getVar'hasnotification' ) == 1) {
            
$xoopsModuleConfig =& $config_handler->getConfigsByCat(0$xoopsModule->getVar('mid'));
        }
    } elseif(
$xoopsUser) {
        
$xoopsUserIsAdmin $xoopsUser->isAdmin(1);
    }


And modify

// #################### Error reporting settings ##################    
    
if ( $xoopsConfig['debug_mode'] == && $xoopsUserIsAdmin || $xoopsConfig['debug_mode'] == ) {
        
error_reporting(E_ALL);
        
$xoopsLogger->enableRendering();
        
$xoopsLogger->usePopup = ( $xoopsConfig['debug_mode'] == );
    } else {
        
error_reporting(0);
        
$xoopsLogger->activated false;
    }
    
$xoopsSecurity->checkBadips();
i'm sorry my translator is crazy...

My SourceForge

13
trabis
Re: xoops debug active for registered users
  • 2009/6/15 22:59

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Lord_Venom, do you have this lines on common.php?
/**#@+
 * Debug level for XOOPS
 * Check /XOOPS-data/configs/xoopsconfig.php for details
 *
 * Note: temporary solution only. Will be re-designed in XOOPS 3.0
 */
if ( $xoopsLogger->activated ) {
    
$configs =@ include $GLOBALS['xoops']->path"var/configs/xoopsconfig.php" );
    
$level intval( @$configs['debugLevel'] );
    if ( (
$level == && empty($xoopsUserIsAdmin)) || ($level == && !$xoopsUser) ) {
        
error_reporting(0);
        
$xoopsLogger->activated false;
    }
}
/**#@-*/



14
hrac
Re: xoops debug active for registered users
  • 2009/11/5 17:21

  • hrac

  • Quite a regular

  • Posts: 305

  • Since: 2002/7/15


Hello,

How can I modify to enable debug messages for admin user and another test user (a registered user without admin privilages). And I don't want to show debug messages to other users.

I want this because if I need to debug a live system, I need to test it with an ordinary user and admin user (and even with guest user) and look for debug messages and other users should not see debug messages.

Is it easy to create another debug mode: IP address level debugging ? In this case I can test my live system as admin, any user or not logged in easily. Debugging messages will be shown only for specific IP address. If XOOPS detects my IP, shows debug messages, else does not show any debug message.

Any idea how to implement or hack this?

Thanks

15
ghia
Re: xoops debug active for registered users
  • 2009/11/5 18:20

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


In the above code you could disable the check for the usergroups and add a check to show if your IP is correct. The IP is found by:
$client_ip $_SERVER['REMOTE_ADDR'];

16
hrac
Re: xoops debug active for registered users
  • 2009/11/5 18:22

  • hrac

  • Quite a regular

  • Posts: 305

  • Since: 2002/7/15


I don't understand which file to be hacked and which code should be changed?

17
hrac
Re: xoops debug active for registered users
  • 2009/11/5 18:40

  • hrac

  • Quite a regular

  • Posts: 305

  • Since: 2002/7/15


I added following code, and it seems to be working

// #################### Error reporting settings ##################
if ( $xoopsConfig['debug_mode'] == || $xoopsConfig['debug_mode'] == ) {
    
error_reporting(E_ALL);
    
$xoopsLogger->enableRendering();
    
$xoopsLogger->usePopup = ( $xoopsConfig['debug_mode'] == );
} else {
    
error_reporting(0);
    
$xoopsLogger->activated false;
}

// added code
if ( $xoopsConfig['debug_mode'] == ) {
  if (
$_SERVER['REMOTE_ADDR'] == "111.111.111.111") {
    
error_reporting(E_ALL);
  }
}


should I add $xoopsLogger->enableRendering(); or other codes?

18
ghia
Re: xoops debug active for registered users
  • 2009/11/5 23:56

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


It is best to set these lines too:
$xoopsLogger->enableRendering();
$xoopsLogger->usePopup 0;


Login

Who's Online

126 user(s) are online (85 user(s) are browsing Support Forums)


Members: 0


Guests: 126


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