if (($mount == "") && ($username == "")) {
?>
Pick a report :
}
else {
if ($username != "") {
// Username Report
echo "
User Report for $username
";
echo "
Registered Mountpoints";
echo "
";
echo "Mountpoint | Time Restrictions |
";
$query = "select mountpoint, timeleft from ".$table_prefix."users where username = '".mysql_real_escape_string($username)."'";
$result = mysql_query($query, $db->link);
while ($row = mysql_fetch_assoc($result)) {
$mountpoint = $row['mountpoint'];
$timeleft = 0;
$timeleft = $row['timeleft'];
if ($timeleft != "-1") {
$timerestriction = "$timeleft seconds left";
}
else {
$timerestriction = "No time restrictions";
}
echo "$mountpoint | $timerestriction |
";
}
echo "
";
mysql_free_result($result);
echo "
";
echo "
Audit Entries (last 20) Click here for a full report";
$limit = "";
if ($showall == "") {
$limit = "limit 20";
}
$query = "select count(*) numentries from ".$table_prefix."audit where username = '".mysql_real_escape_string($username)."'";
$result = mysql_query($query, $db->link);
$row = mysql_fetch_assoc($result);
$entrycount = $row['numentries'];
mysql_free_result($result);
echo "
$entrycount total audit entries
";
echo "
";
echo "Date | Server/Mount | Action |
";
$query = "select datestamp, server, mountpoint, action from ".$table_prefix."audit where username = '".mysql_real_escape_string($username)."' order by datestamp desc $limit";
$result = mysql_query($query, $db->link);
while ($row = mysql_fetch_assoc($result)) {
$datestamp = $row['datestamp'];
$server = $row['server'];
$mountpoint = $row['mountpoint'];
$action = $row['action'];
echo "$datestamp | $server$mountpoint | $action |
";
}
echo "
";
mysql_free_result($result);
echo "";
}
if ($mount != "") {
// Mountpoint report
echo "
Mountpoint Report for $mount
";
$query = "select count(*) entrycount from ".$table_prefix."users where mountpoint = '".mysql_real_escape_string($mount)."' or mountpoint = 'ALL'";
$result = mysql_query($query, $db->link);
$row = mysql_fetch_assoc($result);
$entrycount = $row['entrycount'];
mysql_free_result($result);
echo "
Registered Listeners : $entrycount";
echo "
";
if ($showusers == "") {
$query = "select count(*) entrycount from ".$table_prefix."audit where username = '' and mountpoint = '".mysql_real_escape_string($mount)."'";
$result = mysql_query($query, $db->link);
$row = mysql_fetch_assoc($result);
$entrycount = $row['entrycount'];
mysql_free_result($result);
echo "Click
here for a listener audit report
";
echo "
Mount Connect/Disconnect Audit Entries (last 20) Click here for a full report";
$limit = "";
if ($showall == "") {
$limit = "limit 20";
}
echo "
$entrycount total audit entries
";
echo "
";
echo "Date | Server/Mount | Action |
";
$query = "select datestamp, server, mountpoint, action from ".$table_prefix."audit where username = '' and mountpoint = '".mysql_real_escape_string($mount)."' order by datestamp desc $limit";
$result = mysql_query($query, $db->link);
while ($row = mysql_fetch_assoc($result)) {
$datestamp = $row['datestamp'];
$server = $row['server'];
$mountpoint = $row['mountpoint'];
$action = $row['action'];
echo "$datestamp | $server$mountpoint | $action |
";
}
echo "
";
mysql_free_result($result);
}
else {
$query = "select count(*) entrycount from ".$table_prefix."audit where username != '' and mountpoint = '".mysql_real_escape_string($mount)."'";
$result = mysql_query($query, $db->link);
$row = mysql_fetch_assoc($result);
$entrycount = $row['entrycount'];
mysql_free_result($result);
echo "Click
here for a Mountpoint connect/disconnect audit report
";
echo "
Listener Audit Entries (last 20) Click here for a full report";
$limit = "";
if ($showall == "") {
$limit = "limit 20";
}
echo "
$entrycount total audit entries
";
echo "
";
echo "Date | Server/Mount | User | Action |
";
$query = "select datestamp, username, server, mountpoint, action from ".$table_prefix."audit where username != '' and mountpoint = '".mysql_real_escape_string($mount)."' order by datestamp desc $limit";
$result = mysql_query($query, $db->link);
while ($row = mysql_fetch_assoc($result)) {
$datestamp = $row['datestamp'];
$server = $row['server'];
$mountpoint = $row['mountpoint'];
$action = $row['action'];
$username = $row['username'];
echo "$datestamp | $server$mountpoint | $username | $action |
";
}
echo "
";
mysql_free_result($result);
}
echo "";
}
}
?>