#!/usr/bin/perl -w

use strict;

print "Content-type: text/html\n\n";

my $hostname = `cat /etc/hostname`;
my $user = $ENV{REMOTE_USER};
my $freespace = `df -h /home`;
my $fortune = `/usr/games/fortune`;
my $date = `date`;
my $dp = "dc=worf,dc=jtheuer,dc=de";

my $directlogin = <<EOF;
<form action="/phpldapadmin/login.php" method="post" name="login_form" target="phpldapadmin">
<input type="hidden" name="server_id" value="0" />
<input type="hidden" name="login_dn" size="40" value="$user" /></td>
<small>Password</small><input type="password" size="12" value="" name="login_pass" />
<input type="submit" name="submit" value="Authenticate" />
</form>
EOF

print <<EOF;
<HTML><BODY bgcolor=black text=#CCCCCC link=#00FF00 alink=#00FF00 vlink=#00FF00>
<HEAD>
<TITLE>
$hostname
</TITLE>
<STYLE  type="text/css">
pre {
	color: #00CC00;
	margin-left: 3em;
}
</STYLE>
</HEAD>
<p align='right'>server time: $date</p>
<H1>Access to console <a href="/">$hostname</a> for starfleet user id $user</H1>
<hr>
<h3>Free space</h3>
<pre>
$freespace
</pre>
<h3>MOTD</h3>
<pre>
$fortune
</pre>
<hr>
<h3>turbolift</h3>
<DL>
	<DT>deck 1 bridge: <A href="/phpldapadmin" target="_blank">phpldapadmin</A></DT>
	<DD>update your personal information or change your password</DD>
	<DT>deck 2 communication: <A href="/squirrelmail" target="_blank">Squirrelmail</A></DT>
	<DD>read your daily news!</DD>
	<DT>deck 3: engineering: <A href="/phpmyadmin" target="_blank">phpMyAdmin</A></DT>
	<DD>edit your MySQL Database</DD>
	<DT>deck 4: <A href="/phpsysinfo" target="_blank">phpSysInfo</a></DT>
	<DD>gather some information about the server</DD>
	<dt>deck 5: <a href="awstats-index.html" target="_blank">awstats</a></dt>
	<dd>view your website statistics</dd>
</DL>
<hr>
<h3>starfleet communication protocols</h3>
<DL>
	<DT>SSL certificates</DT>
	<DD>Please install <a href="worf.jtheuer.de-certificate.pem">this</a> certificate and trust it!</DD>
	<DT>E-Mail</DT>
	<DD>sending and recieving mails is only possible with secure connections! (SSL or TLS)</DD>
	<DT>webspace</DT>
	<DD>download files only via sftp (secure ftp)</DD>

</DL>
</BODY></HTML>
EOF


