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.4
Committed: Sun Aug 1 10:40:28 2004 UTC (19 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.3: +1 -1 lines
Log Message:
Catch a lot of old URL's and update them. Also remove a couple of old files
that aren't used.

File Contents

# User Rev Content
1 pjm2 1.1 <?php
2    
3 tdb 1.2 #
4     # i-scream central monitoring system
5 tdb 1.4 # http://www.i-scream.org
6 tdb 1.2 # 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 pjm2 1.1 # Navigation for the i-scream login timeline reports.
24     # pjm2@ukc.ac.uk
25     #
26     # CONFIGURABLE CONSTANTS: -
27    
28     include("logins_config.inc.php");
29    
30     #
31     # END CONFIGURATION
32    
33    
34    
35    
36     include("iutils.inc.php");
37    
38     ?>
39    
40     <? include($titleHTML); ?>
41    
42    
43     <hr weight="1" color="<? echo $lineColor ?>">
44    
45     <b>Most recent login timelines available</b>
46     <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
47     <?
48    
49     $file_array = getdirArray($reportDirectory,'rsort');
50     print "<select size=\"1\" name=\"date\">";
51     if ($date) { ?>
52     <option selected value="<? echo $date ?>"><? echo $date ?></option>
53     <option value="">----------------</option>
54     <? }
55     foreach($file_array as $file_name) {
56     #if (is_dir($file_name)) {
57     if (preg_match("/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/", $file_name)) {
58     $i++;
59     print "<option value=\"$file_name\">$file_name</option>";
60     }
61     }
62     print "</select>";
63    
64     ?>
65     <input type="submit" name="submit" value="Go">
66     </form>
67    
68     <hr weight="1" color="<? echo $lineColor ?>">
69    
70     <? if ($date) { ?>
71    
72     <b>Available timelines for <? echo $date ?></b>
73    
74     <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
75     <select size="1" name="machine">
76     <? if ($machine) { ?>
77     <option selected value="<? echo $machine ?>"><? echo $machine ?></option>
78     <option value="">----------------</option>
79     <? } else { ?>
80     <option selected value="">[select machine]</option>
81     <? } ?>
82     <? include("$reportDirectory/$date/$machineNameHTML"); ?>
83     </select>
84    
85     <input type="hidden" name="date" value="<? echo $date ?>">
86     <input type="submit" name="submit" value="Show">
87     </form>
88    
89     <hr weight="1" color="<? echo $lineColor ?>">
90    
91     <? } ?>
92    
93     </p>
94    
95     <? if ($date && $machine) { ?>
96    
97     <table border="0" cellpadding="0" cellspacing="0">
98     <tr>
99     <td>&nbsp;</td>
100     <td><img src="<?echo $scaleImage;?>" width="800" height="17" border="0"></td>
101     <td>&nbsp;</td>
102     </tr>
103    
104     <?
105    
106     $flip = 0;
107     $file_array = getdirArray("$reportDirectory/$date/$machine/login24",'asort');
108     if ($file_array == FALSE) {
109     print<<<EOT
110    
111     <tr>
112     <td>&nbsp;</td>
113     <td align="center" background="$backImage"><p>&nbsp;</p><p><b>No users were logged in during this period</b></p><p>&nbsp;</p></td>
114     <td>&nbsp;</td>
115     </tr>
116    
117     EOT;
118     }
119     else {
120     foreach($file_array as $file_name) {
121     if (preg_match("/\.gif$/", $file_name)) {
122     preg_match("/^(.*)\.gif$/", $file_name, $matches);
123     $login = $matches[1];
124    
125     if ($flip == 1) {
126     $flip = 0;
127     $bg = " background=\"$backImage\"";
128     }
129     else {
130     $flip = 1;
131     $bg = " background=\"$backImage2\"";
132     }
133    
134     print<<<EOT
135    
136     <tr>
137     <td><font size="2">$login</font></td>
138     <td$bg><img src="$webRoot/$date/$machine/login24/$file_name" border="0" width="800" height="5"></td>
139     <td><font size="2">$login</font></td>
140     </tr>
141    
142     EOT;
143     }
144     }
145     }
146    
147    
148     ?>
149    
150     <tr>
151     <td>&nbsp;</td>
152     <td><img src="<?echo $scaleImage;?>" width="800" height="17" border="0"></td>
153     <td>&nbsp;</td>
154     </tr>
155     </table>
156    
157     <hr weight="1" color="<? echo $lineColor ?>">
158    
159     <? } ?>
160    
161     <? include($bottomHTML); ?>