benchmark(); /* -------------------- Verificar página ---------------------------*/ if (array_key_exists('screen',$_GET)) { $_screen = basename($_GET['screen']); } else { $_screen = 'home'; } define('_screen',$_screen); define('_action',$_GET['a']); define('_mode',$_GET['m'] ? $_GET['m'] : 0 ); define('_page_url','?screen=' . _screen . '&m=' . _mode); define('_page_href',htmlspecialchars(_page_url)); if (file_exists('./pages/system/admin/' . $_screen . '.php')) { $_s->_page_admin = TRUE; } if (file_exists('./pages/system/' . $_screen . '.php')) { $_s->_page_super = TRUE; } if (file_exists('./pages/system/noauth/' . $_screen . '.php')) { $_s->_page_noauth = TRUE; } /* -------------------- Iniciar classes: -------------------- */ require "./system/classes/date.php"; require "./system/classes/users.php"; require "./system/classes/layout.php"; require "./system/classes/articles.php"; /* -------------------- Iniciar idioma: -------------------- */ require "./system/classes/strings.php"; $_l->loadLanguage(_default_language); if (file_exists('./language/' . _language . '.php')) { $_l->loadLanguage(_language); } /* -------------------- Carregar página: -------------------- */ if (file_exists('./pages/system/noauth/' . $_screen . '.php')) { include './pages/system/noauth/' . $_screen . '.php'; } else if (file_exists('./pages/system/' . $_screen . '.php')) { if ($_u->_is_logged) include './pages/system/' . $_screen . '.php'; else $_fail = true; } else if (file_exists('./pages/' . $_screen . '.php')) { if ($_u->_is_logged) include './pages/' . $_screen . '.php'; else $_fail = true; } else if (file_exists('./pages/admin/' . $_screen . '.php')) { if ($_u->_user_level >= 4) include './pages/admin/' . $_screen . '.php'; else $_fail = true; } else if (file_exists('./pages/supervisor/' . $_screen . '.php')) { if ($_u->_user_level >= 5) include './pages/supervisor/' . $_screen . '.php'; else $_fail = true; } else { $_fail = true; } if ($_fail) { include './pages/system/noauth/home.php'; } ?>