<?php
// $Id: index.php,v 1.38 2003/11/12 15:10:20 leyeti Exp $

$myEnv["module"] = "overview";
$myEnv["output"] = "html";
$myEnv["stdsmenu"] = false;
	
include("../../config.inc.php");
include(INCLUDEPATH . "container.inc.php");

// adding file revision into global array
if(function_exists("revisionInit")) revisionInit("\$Revision: 1.38 $", __FILE__);

$tabs = array();
$i = 0;
$j = 0;
if(is_array($_SESSION["MGW"]->settings["overview_get_modules"])){
  $_SESSION["MGW"]->settings["overview_get_modules"] = array_unique ($_SESSION["MGW"]->settings["overview_get_modules"]);
  foreach ($_SESSION["MGW"]->settings["overview_get_modules"] as $module) {
    $inc_file = ROOTPATH."/modules/".$module."/inc/overview.inc.php";
    if(!empty($module) && file_exists($inc_file) && isModuleInstalled($module) && isModuleActive($module) && queryRights2_bool('root_modules_'.$module.'_accessmodule')) {
      include_once($inc_file);
      $func = "get".$module;
      $tabs[$j][]= $func();
      $i++;
      if($i%3==0) $j++;	
    }
  }
}
		
// refresh overview for local subnets
if((substr($_SERVER["REMOTE_ADDR"],0,8) == '192.168.') ||
   (substr($_SERVER["REMOTE_ADDR"],0,7) == '172.16.') ||
   (substr($_SERVER["REMOTE_ADDR"],0,3) == '10.') ||
   (substr($_SERVER["REMOTE_ADDR"],0,6) == '127.0.')
   )
     $smarty->assign('refreshjs', " onLoad=window.setTimeout(\"location.href='index.php?".SID."'\",900000)");

$smarty->assign('tabs', $tabs);
$smarty->assign('fullname', $_SESSION["MGW"]->fullusername);
$smarty->display("overview.tpl");
?>
