<?php
    global $CTABNAME;
    global $ERRORTEXT;
    global $RELAYPRESIP;

    require_once 'dbtools.php';
    
    include 'header.php';
    
    if (isset($_SERVER['PHP_AUTH_USER'])) {
	
	$CTABNAME = "hist";
    
	include 'topmenu.php';
	
	include 'histsubmenu.php';
	if (isset($_POST['relaypresip'])) {
	    
	    $RELAYPRESIP = $_POST['relaypresip'];
	    
	    include 'relayheader.php';
    
	    readconfig();
	    if (db_connect() == 0) {
		include 'relaybody.php';
	    };
	} else {
	    $ERRORTEXT = "Relay IP not given.";
	    include 'errorparam.php';
	}
	
    } else {
	include 'error.php';
    };
    
    include 'footer.php';
?>
