init();
//var_dump($path);die;
if (($path['abs_section'] != 'pages' || ($path['abs_section'] == 'pages' && $path['path_array'][1] == 'redirect' )) && !isset($op)) $op = $path['path_array'][1];
//echo ' se='.$se.' path='.$path.' page='.$page.'
';
//$obj = user::online();
//var_dump($obj);die;
if (($path['active'] > 0) OR ($path['active'] == 0 AND user::is_admin())) {
if (($path['view'] == 0) || ($path['view'] == 1 AND user::is_guest() AND !user::is_admin()) || ($path['view'] == 2 AND user::is_user()) || ($path['view'] == 3 AND user::is_admin())) {
if (!empty($path['fn']) && function_exists($path['fn'])) {
$page_contents = $path['fn']($path);
} else {
$file = isset($_GET['file']) && preg_match('/^[a-z][_\-\w\.]*$/i', $_GET['file']) ? $file : 'index.php';
$sctpath=get_module_path($path['abs_section']).'/'.$file;
if (file_exists($sctpath)) {
ob_start();
include($sctpath);
$page_contents = ob_get_contents();
ob_end_clean();
} else {
$e404page = cfg::v('error404page');
if (empty( $e404page )) {
header("HTTP/1.0 404 Not Found");
exit();
} else {
Header("Location: ".$GLOBALS['siteurl'].'/'.$e404page);
}
exit();
}
}
} else {
header("HTTP/1.0 403 Forbidden");
$pagetitle = "- "._ACCESSDENIED."";
ob_start();
win_start(_ACCESSDENIED);
echo "