Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- declare(encoding='UTF-8');
- $title = "Administrace";
- $ecode = 200;
- session_start();
- include_once("modules/user.inc");
- $currentUser = new user($db);
- require_once("libs/yatee/yatee.php");
- $yatee = new yatee\main();
- if( $currentUser->WebLogged() || $currentUser->CustomerLogged() || $currentUser->AdminLogged() ) {
- $mainpage = $yatee->AddSection("main", array(), "templates/admin.tpl");
- $mainpage->AddVariable("web_logged", $currentUser->WebLogged());
- $mainpage->AddVariable("customer_logged", $currentUser->CustomerLogged());
- $mainpage->AddVariable("admin_logged", $currentUser->AdminLogged());
- $mainpage->AddVariable("customer_logout", "?action=customerlogout");
- $mainpage->AddVariable("web_logout", "?action=weblogout");
- $mainpage->AddVariable("logout_url", "?action=logout");
- $mainpage->AddVariable("title", $title);
- if ($currentUser->AdminLogged()){
- $mainpage->AddVariable("admin_name", $currentUser->GetAdminName());
- $menutype = "admin";
- }
- if ($currentUser->CustomerLogged()){
- $mainpage->AddVariable("customer_name", $currentUser->GetCustomerName());
- $menutype = "customer";
- }
- if ($currentUser->WebLogged()) {
- $mainpage->AddVariable("web_name", $currentUser->GetWebName());
- $menutype = "web";
- }
- $menu = new menu(1, array($menutype), "menuitem", $yatee, true);
- $mainpage->AddVariable("menutype", $menutype);
- $mainpage->AddVariable("menutitle", $menu->GetPartialTitle(2, 3));
- if (is_file($menu->GetFolderName()."index.inc")) {
- include($menu->GetFolderName()."index.inc");
- $main = new main($yatee, $currentUser, $db, $menu->GetURL());
- //$main->Render($panel->GetPart(2), $currentUser, $db, $menu->GetURL());
- }
- else {
- $content = $yatee->AddSection("content", array(), "templates/404.tpl");
- $content->AddVariable("file", $menu->GetFolderName()."index.inc");
- }
- }
- else {
- $page = $yatee->AddSection("main", array(), "templates/login.tpl");
- $page->AddVariable("title", $title);
- $page->AddVariable("login_url", "?action=login");
- }
- $response = new response();
- $response->AddHeader(200, "Strict-Transport-Security: max-age=".(31*86400));
- $page = $response->GetPage(200);
- $page->SetNaked(true);
- $cnt = $page->GetContent();
- $cnt->Replace($yatee->render());
- $response->Render();
Advertisement
Add Comment
Please, Sign In to add comment