| 1 |
<?php |
| 2 |
|
| 3 |
# |
| 4 |
# i-scream central monitoring system |
| 5 |
# http://www.i-scream.org |
| 6 |
# Copyright (C) 2000-2002 i-scream |
| 7 |
# |
| 8 |
# This program is free software; you can redistribute it and/or |
| 9 |
# modify it under the terms of the GNU General Public License |
| 10 |
# as published by the Free Software Foundation; either version 2 |
| 11 |
# of the License, or (at your option) any later version. |
| 12 |
# |
| 13 |
# This program is distributed in the hope that it will be useful, |
| 14 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
# GNU General Public License for more details. |
| 17 |
# |
| 18 |
# You should have received a copy of the GNU General Public License |
| 19 |
# along with this program; if not, write to the Free Software |
| 20 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 |
# |
| 22 |
|
| 23 |
# CONFIGURABLE CONSTANTS: - |
| 24 |
|
| 25 |
include("logins_config.inc.php"); |
| 26 |
|
| 27 |
# |
| 28 |
# END CONFIGURATION |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
include("iutils.inc.php"); |
| 34 |
|
| 35 |
?> |
| 36 |
|
| 37 |
<? include($titleHTML); ?> |
| 38 |
|
| 39 |
|
| 40 |
<hr weight="1" color="<? echo $lineColor ?>"> |
| 41 |
|
| 42 |
<b>Most recent login timelines available</b> |
| 43 |
<form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>"> |
| 44 |
<? |
| 45 |
|
| 46 |
$file_array = getdirArray($reportDirectory,'rsort'); |
| 47 |
print "<select size=\"1\" name=\"date\">"; |
| 48 |
if ($date) { ?> |
| 49 |
<option selected value="<? echo $date ?>"><? echo $date ?></option> |
| 50 |
<option value="">----------------</option> |
| 51 |
<? } |
| 52 |
foreach($file_array as $file_name) { |
| 53 |
#if (is_dir($file_name)) { |
| 54 |
if (preg_match("/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/", $file_name)) { |
| 55 |
$i++; |
| 56 |
print "<option value=\"$file_name\">$file_name</option>"; |
| 57 |
} |
| 58 |
} |
| 59 |
print "</select>"; |
| 60 |
|
| 61 |
?> |
| 62 |
<input type="submit" name="submit" value="Go"> |
| 63 |
</form> |
| 64 |
|
| 65 |
<hr weight="1" color="<? echo $lineColor ?>"> |
| 66 |
|
| 67 |
<? if ($date) { ?> |
| 68 |
|
| 69 |
<b>Available timelines for <? echo $date ?></b> |
| 70 |
|
| 71 |
<form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>"> |
| 72 |
<select size="1" name="machine"> |
| 73 |
<? if ($machine) { ?> |
| 74 |
<option selected value="<? echo $machine ?>"><? echo $machine ?></option> |
| 75 |
<option value="">----------------</option> |
| 76 |
<? } else { ?> |
| 77 |
<option selected value="">[select machine]</option> |
| 78 |
<? } ?> |
| 79 |
<? include("$reportDirectory/$date/$machineNameHTML"); ?> |
| 80 |
</select> |
| 81 |
|
| 82 |
<input type="hidden" name="date" value="<? echo $date ?>"> |
| 83 |
<input type="submit" name="submit" value="Show"> |
| 84 |
</form> |
| 85 |
|
| 86 |
<hr weight="1" color="<? echo $lineColor ?>"> |
| 87 |
|
| 88 |
<? } ?> |
| 89 |
|
| 90 |
</p> |
| 91 |
|
| 92 |
<? if ($date && $machine) { ?> |
| 93 |
|
| 94 |
<table border="0" cellpadding="0" cellspacing="0"> |
| 95 |
<tr> |
| 96 |
<td> </td> |
| 97 |
<td><img src="<?echo $scaleImage;?>" width="800" height="17" border="0"></td> |
| 98 |
<td> </td> |
| 99 |
</tr> |
| 100 |
|
| 101 |
<? |
| 102 |
|
| 103 |
$flip = 0; |
| 104 |
$file_array = getdirArray("$reportDirectory/$date/$machine/login24",'asort'); |
| 105 |
if ($file_array == FALSE) { |
| 106 |
print<<<EOT |
| 107 |
|
| 108 |
<tr> |
| 109 |
<td> </td> |
| 110 |
<td align="center" background="$backImage"><p> </p><p><b>No users were logged in during this period</b></p><p> </p></td> |
| 111 |
<td> </td> |
| 112 |
</tr> |
| 113 |
|
| 114 |
EOT; |
| 115 |
} |
| 116 |
else { |
| 117 |
foreach($file_array as $file_name) { |
| 118 |
if (preg_match("/\.gif$/", $file_name)) { |
| 119 |
preg_match("/^(.*)\.gif$/", $file_name, $matches); |
| 120 |
$login = $matches[1]; |
| 121 |
|
| 122 |
if ($flip == 1) { |
| 123 |
$flip = 0; |
| 124 |
$bg = " background=\"$backImage\""; |
| 125 |
} |
| 126 |
else { |
| 127 |
$flip = 1; |
| 128 |
$bg = " background=\"$backImage2\""; |
| 129 |
} |
| 130 |
|
| 131 |
print<<<EOT |
| 132 |
|
| 133 |
<tr> |
| 134 |
<td><font size="2">$login</font></td> |
| 135 |
<td$bg><img src="$webRoot/$date/$machine/login24/$file_name" border="0" width="800" height="5"></td> |
| 136 |
<td><font size="2">$login</font></td> |
| 137 |
</tr> |
| 138 |
|
| 139 |
EOT; |
| 140 |
} |
| 141 |
} |
| 142 |
} |
| 143 |
|
| 144 |
|
| 145 |
?> |
| 146 |
|
| 147 |
<tr> |
| 148 |
<td> </td> |
| 149 |
<td><img src="<?echo $scaleImage;?>" width="800" height="17" border="0"></td> |
| 150 |
<td> </td> |
| 151 |
</tr> |
| 152 |
</table> |
| 153 |
|
| 154 |
<hr weight="1" color="<? echo $lineColor ?>"> |
| 155 |
|
| 156 |
<? } ?> |
| 157 |
|
| 158 |
<? include($bottomHTML); ?> |