$time_start=time(); $s=explode(' ', microtime()); $time_start_micro=$time_start+$s[0]; $global_code=true; ini_set('display_errors', 1); ini_set('error_prepend_string', ''); ini_set('error_append_string', 'Vnitrni chyba systemu.' .' Kontaktujte nas, prosim, na tohe@centrum.cz'); ini_set('error_log', './html/log/php_error_'.date('ym').'.log'); if(function_exists('date_default_timezone_set')) date_default_timezone_set('Europe/Prague'); function handle_php_error($errno, $errmsg, $filename, $linenum, $vars){ $dt = date("Y-m-d H:i:s").' '.microtime(); $errortype = array ( E_ERROR => 'ERROR', E_WARNING => 'WARNING', E_PARSE => 'PARSE', E_NOTICE => 'NOTICE', E_CORE_ERROR => 'CORE_ERROR', E_CORE_WARNING => 'CORE_WARNING', E_COMPILE_ERROR => 'COMPILE_ERROR', E_COMPILE_WARNING => 'COMPILE_WARNING', E_USER_ERROR => 'USER_ERROR', E_USER_WARNING => 'USER_WARNING', E_USER_NOTICE => 'USER_NOTICE', // E_STRICT => 'STRICT', // E_RECOVERABLE_ERROR => 'RECOVERABLE_ERROR', -1 => 'GET', -2 => 'POST', -3 => 'SQL_ERROR' ); $err='['.$dt.']'; if(isset($errortype[$errno])) $err.=' '.$errortype[$errno]; if($errmsg) $err.=' '.$errmsg; if($filename||$linenum) $err.=' ('.$filename.($filename&&$linenum?':':'').$linenum.')'; if($errno==-2) $err.=' {'.implode('} {', $vars).'}'; elseif(is_array($vars)) if(!isset($vars['global_code'])) foreach($vars as $k=>$v) $err.=' {'.$k.'='.$v.'}'; $f=fopen('./html/log/php_error_handled_'.date('ym').'.log', 'a'); fwrite($f, $err."\n\n"); fclose($f); return true; } set_error_handler('handle_php_error'); ob_start(); require_once('./lib/lib.php'); require_once('./lib/menu_cz.php'); init_access_session(); /* Comment next lines to disable logging */ if(isset($_GET)) if(count($_GET)) handle_php_error(-1, '', $_SERVER['REQUEST_URI'], '', $_GET); if(isset($_POST)) if(count($_POST)) handle_php_error(-2, '', $_SERVER['REQUEST_URI'], '', array_keys($_POST)); /* End */ use_sent_var('debug_mode', 'PGS', 0); $_SESSION['debug_mode']=$debug_mode; use_sent_var('p', 'PG', 'xhome'); $_GET['p']=$p=str_replace('-', '/', $p); if(strchr($p, '.')) $p='ise'; if(($p=='')||($p=='index')) $p='xhome'; if($p=='xhome') $p='home/'; if($p[strlen($p)-1]=='/') $p.='.std'; if(false); elseif(ereg('^root', $p)){ if(($_SESSION['access_level']!=3)&&($_SESSION['access_level']!=4)) $p='ise'; } elseif(ereg('^rest', $p)){ if($_SESSION['access_level']!=2) $p='ise'; } elseif(ereg('^user', $p)){ if($_SESSION['access_level']!=1) $p='ise'; } elseif(ereg('^brig', $p)){ if($_SESSION['access_level']!=17) $p='ise'; } if(!file_exists('./pages/'.$p.'.php')) if(!file_exists('./pages/'.$p.'.intro.php')) if(!file_exists('./pages/'.$p.'.left.php')){ $p.='/.std'; if(!file_exists('./pages/'.$p.'.php')) if(!file_exists('./pages/'.$p.'.intro.php')) if(!file_exists('./pages/'.$p.'.left.php')) $p='ise'; } foreach(require_exists($p, './pages/', '.intro.php') as $v) if(file_exists($v)) require($v); $ob_intro=ob_get_clean(); ?>
foreach(require_exists($p, './pages/', '.head.php') as $v) if(file_exists($v)) require($v); ?> if(!isset($body_onload)) $body_onload=''; $body_onload.='; ajax_time_start();'; ?> > require('./html/top.php'); ?> require('./html/left.php'); ?>