Esempio n. 1
0
function configure_php()
{
    global $opt;
    if ($opt['php']['debug'] == PHP_DEBUG_SKIP) {
    }
    if ($opt['php']['debug'] == PHP_DEBUG_ON) {
        ini_set('display_errors', true);
        ini_set('error_reporting', E_ALL);
        ini_set('mysql.trace_mode', true);
        // SQL_CALC_FOUND_ROWS will not work with trace_mode on!
        // Use the next two functions below as workaround.
        // not for production use yet (has to be tested thoroughly)
        register_errorhandlers();
    } else {
        ini_set('display_errors', false);
        ini_set('error_reporting', E_ALL & ~E_NOTICE);
        ini_set('mysql.trace_mode', false);
    }
}
define('regex_statpic_text', '^[a-zA-Z0-9\\.\\-_ @äüöÄÜÖß=)(\\/\\\\&*\\$+~#!§%;,-?:\\[\\]{}¹²³\'\\"`\\|µ°]{0,29}$');
//load default webserver-settings and common includes
require_once $opt['rootpath'] . 'lib/consts.inc.php';
require_once $opt['rootpath'] . 'lib/settings.inc.php';
require_once $opt['rootpath'] . 'lib2/errorhandler.inc.php';
// check for banned UAs
$useragent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "";
foreach ($opt['page']['banned_user_agents'] as $ua) {
    if (strpos($useragent, $ua) !== false) {
        die;
    }
}
// basic PHP settings
date_default_timezone_set($timezone);
if ($debug_page) {
    register_errorhandlers();
}
// not for production use yet, must be tested
$dblink_slave = false;
$db_error = 0;
// sql debugger?
if (!isset($sql_allow_debug)) {
    $sql_allow_debug = 0;
}
// prepare EMail-From
$emailheaders = 'From: "' . $emailaddr . '" <' . $emailaddr . '>';
function logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
{
    sql("INSERT INTO logentries (`module`, `eventid`, `userid`, `objectid1`, `objectid2`, `logtext`, `details`) VALUES (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '&1', '&2', '&3', '&4', '&5', '&6', '&7')", $module, $eventid, $userid, $objectid1, $objectid2, $logtext, serialize($details));
}
// read a file and return it as a string