config->read_config();
}
public function index()
{
$this->auto_render = false;
if ($this->service == "" && $this->host == "") {
url::redirect("graph", 302);
}
$this->data->readXML($this->host, $this->service);
if ($this->auth->is_authorized($this->data->MACRO['AUTH_HOSTNAME'], $this->data->MACRO['AUTH_SERVICEDESC']) === false) {
header('Content-Type: application/xml');
print "\n";
print "\n";
print "not authorized\n";
print "\n";
exit;
} else {
$xmlfile = $this->config->conf['rrdbase'] . $this->host . "/" . $this->service . ".xml";
if (is_readable($xmlfile)) {
$fh = fopen($xmlfile, 'r');
header('Content-Type: application/xml');
fpassthru($fh);
fclose($fh);
exit;
} else {
header('Content-Type: application/xml');
print "\n";
print "\n";
print "file not found\n";
print "\n";
}
}
}
}