<?php
header( 'Cache-Control: max-age=604800' );
$userip = $_SERVER['REMOTE_ADDR'];
$vhost = $_SERVER['SERVER_NAME'];
$clientip = explode(".", $userip);
$usersubnet = $clientip[0].".".$clientip[1];
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title><? echo $vhost; ?></title>
  <link rel="stylesheet" href="/style.css" type="text/css">
</head>
<body>
  <div>
    <h1>world-mail.org</h1>
  </div>
  <hr class="main">
  <h3>User Links</h3>
  <table class="trans">
    <tr>
      <td>
        <div class="img-with-text">
          <a href=
          "https://mail.google.com/a/world-mail.org"><img alt=
          "world-mail webmail" src="/images/email.png" width="80"
          height="80"> Webmail</a>
        </div>
      </td>
<? 
/*      <td>
        <div class="img-with-text">
          <a href="https://gallery.world-mail.org/"><img alt=
          "world-mail gallery" src="/images/gallery.png" width="80"
          height="80">Pictures</a>
        </div>
	</td>
*/
?>
    </tr>
  </table>
<?
if ( $usersubnet == "192.168" ) {
?>
  <hr>
  <h3>Webapps</h3>
  <table class="trans">
    <tr>
      <td>
        <div class="img-with-text">
          <a href="http://limbo.xdug.org:30054"><img alt=
          "dashboard" src="/images/dashboard.png" width="80"
          height="80">Dashboard</a>
        </div>
      </td>
    </tr>
  </table>
  <hr>
  <h3>Statistics & Info</h3>
  <table class="trans">
    <tr>
      <td>
        <div class="img-with-text">
          <a href="/ntpgraphs"><img alt=
          "ntpgraphs" src="/images/clocktower128.png" height=
          "80">NTP</a>
        </div>
      </td>
      <td>
        <div class="img-with-text">
          <a href="/webcam"><img alt=
          "webcam" src="/images/webcam.png" height=
          "80">Webcam</a>
        </div>
      </td>
      <td>
        <div class="img-with-text">
          <a href="http://countdown.xdug.org/cgi-bin/nut/upsstats.cgi"><img alt=
          "webcam" src="/images/ups.png" height=
          "80">UPS Stats</a>
        </div>
      </td>
    </tr>
  </table>
<?}?>
  <br>
  <hr class="main">
  <div class="footer">
    <div class="floatleft">
      <em>all content copyright <? echo date("Y"); ?>
       - world-mail.org</em>
    </div>
    <div class="floatright">
      <em>Client IP - <?echo $userip;?>
      </em>
    </div>
  </div>
</body>
</html>
