if (!file_exists('./site.php')) { $data = '<?php' . PHP_EOL; @file_put_contents('./site.php', $data); } if (function_exists('opcache_invalidate')) { opcache_invalidate('./site.php'); } require_once './site.php'; if (isset($available_site) && is_array($available_site)) { if (isset($_GET['__cms_subsite']) && $_GET['__cms_subsite'] !== NULL) { $CMS_SUBSITE = $_GET['__cms_subsite']; } else { $actual_host_name = $_SERVER['HTTP_HOST']; $address = full_url($_SERVER); $parsed_url = parse_url($address); $check = is_ip_address($parsed_url['host']); $stripped_host_name = $parsed_url['host']; if ($check == FALSE) { $stripped_host_name = $stripped_host_name == '' ? domain($stripped_host_name) : domain($address); } $actual_host_name_parts = explode('.', $actual_host_name); $stripped_host_name_parts = explode('.', $stripped_host_name); // if there is an alias defined if (array_key_exists($actual_host_name, $site_alias) && $site_alias[$actual_host_name] != '') { $CMS_SUBSITE = $site_alias[$actual_host_name]; $USE_ALIAS = TRUE; } else { if (strlen($actual_host_name) > 0 && count($actual_host_name_parts) > count($stripped_host_name_parts)) { $CMS_SUBSITE = $actual_host_name_parts[0]; $USE_SUBDOMAIN = TRUE; }
$pearSyslogDB = new SyslogDB("syslog", $collector_id); $DBRESULT =& $pearSyslogDB->query($req); # Smarty template Init $tpl = new Smarty(); $tpl = initSmartyTpl($path, $tpl); # start header menu $tpl->assign("headerMenu_syslog_dns", _("Syslog Name")); $tpl->assign("headerMenu_syslog_ipv4", _("Syslog IP v4")); # end header menu $form = new HTML_QuickForm('select_form', 'POST', "?p=" . $p); #Different style between each lines $style = "one"; #Fill a tab with a mutlidimensionnal Array we put in $tpl $elemArr = array(); for ($i = 0; $host =& $DBRESULT->fetchRow(); $i++) { if (is_ip_address($host["value"])) { $syslog_name = getDNSFromIP($host["value"]); $syslog_ip = $host["value"]; } else { $syslog_name = $host["value"]; $syslog_ip = getIPFromDNS($host["value"]); if (strcmp($syslog_ip, $syslog_name) == 0) { $syslog_ip = _("no IP"); } } $elemArr[$i] = array("MenuClass" => "list_" . $style, "hostName" => $syslog_name, "hostIPV4" => $syslog_ip); $style != "two" ? $style = "two" : ($style = "one"); $syslog_name = ""; $syslog_ip = ""; } $tpl->assign("elemArr", $elemArr);