NULL (ei viska Notice't) //millal üldse sessioon aegub serveril? $user =& new User(); $response =& new Component(); if (in_array($req_page_name, $authorization_required_pages)) { if (!isset($_SESSION['user_id'])) { $auth =& Component::get_comp('login'); $auth->go_next($req_page_name); redirect("?page=login"); } else { // kasutaja on autenditud: if(isset($_REQUEST['logout'])) { $user->logout(); redirect("?page=welcome"); } $game =& new Game($_SESSION['user_id'], @$_SESSION['game_id']); $response->set_tplfile('outer.authenticated.tpl.php'); //kui mäng pole kindlaks määratud: if (!isset($_SESSION['game_id'])) { $req_page_name = 'gamelist'; } $response->url->add('page', $req_page_name); $response->add_comp($req_page_name, 'body', $game); } } elseif (in_array($req_page_name, $open_pages)) { $response->set_tplfile('outer.unauth.tpl.php'); //ajutiselt: if ($req_page_name == 'welcome') $req_page_name = 'login'; $response->url->add('page', $req_page_name); $result = $response->add_comp($req_page_name, 'body', $user); } else redirect("?page=welcome"); $response->set('title', 'Simulatsioonimäng kooliuuendusest'); $response->set('session_id', session_id()); echo $response->render(); ////////////////////////////////////////////////////////// include_once 'log.php'; ?>