check_debug_log_override()

Description

Check and set the debug log override status for the current user.

This function determines if debug logging should be enabled based on system variables
and the user's ID. If a debug override is set for a specific user or globally, and the
override has not expired, debug logging will be activated. Expired overrides are removed.

Parameters

This function accepts no parameters.

Return

void

Location

include/debug_functions.php lines 12 to 37

Definition

 
function check_debug_log_override()
{
    global 
$debug_log_override$userref;

    if (isset(
$debug_log_override) || !isset($userref)) {
        return;
    }

    
$debug_log_override false;

    
$debug_user get_sysvar('debug_override_user''');
    
$debug_expires get_sysvar('debug_override_expires''');

    if (
$debug_user == "" || $debug_expires == "") {
        return;
    }

    if (
$debug_expires time()) {
        
ps_query("DELETE FROM sysvars WHERE name='debug_override_user' OR name='debug_override_expires'", array());
        return;
    }

    if (
$debug_user == -|| $debug_user == $userref) {
        
$debug_log_override true;
    }
}

This article was last updated 6th April 2025 20:05 Europe/London time based on the source file dated 21st January 2025 15:20 Europe/London time.