3 * This function is beign used to load info that's needed for the dashboard page.
4 * check if the person who wants to view this page is a mod/admin, if this is not the case, he will be redirected to an error page.
5 * next it will fetch a lot of information regarding to the status of the ticket system (eg return the total amount of tickets) and return this information so
6 * it can be used by the template.
7 * @author Daan Janssens, mentored by Matthew Lagoe
12 if(WebUsers
::isLoggedIn()){
15 if(ticket_user
::isMod(unserialize($_SESSION['ticket_user']))){
16 //return useful information about the status of the ticket system.
17 $result['user_id'] = unserialize($_SESSION['ticket_user'])->getTUserId();
18 $result['nrToDo'] = Ticket_Queue_Handler
::getNrOfTicketsToDo(unserialize($_SESSION['ticket_user'])->getTUserId());
19 $result['nrAssignedWaiting'] = Ticket_Queue_Handler
::getNrOfTicketsAssignedWaiting(unserialize($_SESSION['ticket_user'])->getTUserId());
20 $result['nrTotalTickets'] = Ticket_Queue_Handler
::getNrOfTickets();
21 $ticket = Ticket_Queue_Handler
::getNewestTicket();
22 $result['newestTicketId'] = $ticket->getTId();
23 $result['newestTicketTitle'] = $ticket->getTitle();
24 $result['newestTicketAuthor'] = Ticket_User
::get_username_from_id($ticket->getAuthor());
25 global $INGAME_WEBPATH;
26 $result['ingame_webpath'] = $INGAME_WEBPATH;
31 $_SESSION['error_code'] = "403";
32 header("Cache-Control: max-age=1");
33 header("Location: index.php?page=error");
34 throw new SystemExit();
39 //ERROR: not logged in!
40 header("Cache-Control: max-age=1");
41 header("Location: index.php");
42 throw new SystemExit();