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

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