ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/logins/logins.php
Revision: 1.2
Committed: Sat May 18 18:15:57 2002 UTC (22 years, 4 months ago) by tdb
Branch: MAIN
Changes since 1.1: +19 -0 lines
Log Message:
i-scream is now licensed under the GPL. I've added the GPL headers to every
source file, and put a full copy of the license in the appropriate places.
I think I've covered everything. This is going to be a mad commit ;)

File Contents

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