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.7
Committed: Sat Jun 30 12:12:49 2007 UTC (16 years, 10 months ago) by tdb
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +2 -2 lines
Log Message:
More short tag fixes.

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 # 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 tdb 1.6 <?php include($titleHTML); ?>
38 pjm2 1.1
39    
40 tdb 1.6 <hr weight="1" color="<?php echo $lineColor ?>">
41 pjm2 1.1
42     <b>Most recent login timelines available</b>
43 tdb 1.6 <form method="<?php echo $formMethod ?>" action="<?php echo $thisPage ?>">
44     <?php
45 pjm2 1.1
46     $file_array = getdirArray($reportDirectory,'rsort');
47     print "<select size=\"1\" name=\"date\">";
48     if ($date) { ?>
49 tdb 1.6 <option selected value="<?php echo $date ?>"><?php echo $date ?></option>
50 pjm2 1.1 <option value="">----------------</option>
51 tdb 1.6 <?php }
52 pjm2 1.1 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 tdb 1.6 <hr weight="1" color="<?php echo $lineColor ?>">
66 pjm2 1.1
67 tdb 1.6 <?php if ($date) { ?>
68 pjm2 1.1
69 tdb 1.6 <b>Available timelines for <?php echo $date ?></b>
70 pjm2 1.1
71 tdb 1.6 <form method="<?php echo $formMethod ?>" action="<?php echo $thisPage ?>">
72 pjm2 1.1 <select size="1" name="machine">
73 tdb 1.6 <?php if ($machine) { ?>
74     <option selected value="<?php echo $machine ?>"><?php echo $machine ?></option>
75 pjm2 1.1 <option value="">----------------</option>
76 tdb 1.6 <?php } else { ?>
77 pjm2 1.1 <option selected value="">[select machine]</option>
78 tdb 1.6 <?php } ?>
79     <?php include("$reportDirectory/$date/$machineNameHTML"); ?>
80 pjm2 1.1 </select>
81    
82 tdb 1.6 <input type="hidden" name="date" value="<?php echo $date ?>">
83 pjm2 1.1 <input type="submit" name="submit" value="Show">
84     </form>
85    
86 tdb 1.6 <hr weight="1" color="<?php echo $lineColor ?>">
87 pjm2 1.1
88 tdb 1.6 <?php } ?>
89 pjm2 1.1
90     </p>
91    
92 tdb 1.6 <?php if ($date && $machine) { ?>
93 pjm2 1.1
94     <table border="0" cellpadding="0" cellspacing="0">
95     <tr>
96     <td>&nbsp;</td>
97 tdb 1.7 <td><img src="<?php echo $scaleImage;?>" width="800" height="17" border="0"></td>
98 pjm2 1.1 <td>&nbsp;</td>
99     </tr>
100    
101 tdb 1.6 <?php
102 pjm2 1.1
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>&nbsp;</td>
110     <td align="center" background="$backImage"><p>&nbsp;</p><p><b>No users were logged in during this period</b></p><p>&nbsp;</p></td>
111     <td>&nbsp;</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>&nbsp;</td>
149 tdb 1.7 <td><img src="<?php echo $scaleImage;?>" width="800" height="17" border="0"></td>
150 pjm2 1.1 <td>&nbsp;</td>
151     </tr>
152     </table>
153    
154 tdb 1.6 <hr weight="1" color="<?php echo $lineColor ?>">
155 pjm2 1.1
156 tdb 1.6 <?php } ?>
157 pjm2 1.1
158 tdb 1.6 <?php include($bottomHTML); ?>