[LON-CAPA-cvs] cvs: loncom /cgi userstatus.pl
bisitz
bisitz@source.lon-capa.org
Tue, 23 Mar 2010 12:01:49 -0000
bisitz Tue Mar 23 12:01:49 2010 EDT
Modified files:
/loncom/cgi userstatus.pl
Log:
- XHTML:
- Page header
- Replaced font tag and bgcolor attribute by corresponding style attribute
- Empty table header cell
- Corrected unbalanced tags
- Summary table (</tr> moved inside loop)
- Load average (</b> close, not open)
- Added missing white space in user data
Index: loncom/cgi/userstatus.pl
diff -u loncom/cgi/userstatus.pl:1.19 loncom/cgi/userstatus.pl:1.20
--- loncom/cgi/userstatus.pl:1.19 Fri Jan 9 07:06:27 2009
+++ loncom/cgi/userstatus.pl Tue Mar 23 12:01:49 2010
@@ -1,7 +1,7 @@
#!/usr/bin/perl
$|=1;
# User Status
-# $Id: userstatus.pl,v 1.19 2009/01/09 07:06:27 raeburn Exp $
+# $Id: userstatus.pl,v 1.20 2010/03/23 12:01:49 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -121,7 +121,13 @@
unless ($oneline) {
my $now = time();
- print '<html><body bgcolor="#FFFFFF">'."\n".
+ print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n".
+ '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n"."\n".
+ '<head>'."\n".
+ '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\n".
+ '<title>LON-CAPA '.$lt{'usrs'}.'</title>'."\n".
+ '</head>'."\n".
+ '<body style="background-color:#FFFFFF">'."\n".
"<h1>$lt{'usrs'} ".&Apache::lonlocal::locallocaltime($now).'</h1>';
}
@@ -154,18 +160,18 @@
}
if (!$justsummary) {
$users{$userclass}{$filename} .=
- '<font color="'.$color.'">'.
+ '<div style="color:'.$color.'">'.
'<h3>'.$userinfo{'environment.lastname'}.', '.
$userinfo{'environment.firstname'}.' '.
$userinfo{'environment.middlename'}.' '.
$userinfo{'environment.generation'}." (".
- $userinfo{'user.name'}."\@".$userinfo{'user.domain'}.
+ $userinfo{'user.name'}.":".$userinfo{'user.domain'}.
")</h3>\n".
"<p><tt>$filename</tt></p>".
"<b>$lt{'login'}:</b> ".
&Apache::lonlocal::locallocaltime($userinfo{'user.login.time'}).
" <b>$lt{'Browser'}</b>: ".$userinfo{'browser.type'}.
- " $lt{'on'} ".$userinfo{'browser.os'}."<b>$lt{'Client'}:</b>".
+ " $lt{'on'} ".$userinfo{'browser.os'}." <b>$lt{'Client'}:</b>".
$userinfo{'request.host'}."<br />\n<b>$lt{'role'}: </b>".
$userinfo{'request.role'}." ";
}
@@ -191,7 +197,7 @@
"<br /><b>$lt{'ltra'}:</b> ".&Apache::lonlocal::locallocaltime($mtime).
" (".$since." $lt{'secs'}) <br /><b>$lt{'lacc'}:</b> ".
&Apache::lonlocal::locallocaltime($atime)." (".$sinceacc." $lt{'secs'})".
- "</font>";
+ "</div>";
}
}
untie(%userinfo);
@@ -219,7 +225,7 @@
&show('OS',\%lt,%usercount);
# print "\n</pre>";
- print "<b>$lt{'load'}:<b> ".$loadavg;
+ print "<b>$lt{'load'}:</b> ".$loadavg;
print "</body></html>";
} else {
foreach my $l1 (sort keys %usercount) {
@@ -259,7 +265,7 @@
my ($cat,$ltref,%usercount)=@_;
print("<h3>$ltref->{$cat}</h3>\n");
- print("<table border='1'><tr><th></th><th>");
+ print("<table border='1'><tr><th> </th><th>");
print(join("</th><th>",('Any',@actl)));
print("</th></tr>");
foreach my $type (sort(keys(%{$usercount{$cat}}))) {
@@ -272,7 +278,8 @@
}
print("<td>$count</td>");
print($temp);
+ print('</tr>');
}
- print("</tr></table>\n");
+ print("</table>\n");
}