Update of /cvsroot/netpass/NetPass/www/htdocs/Admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7108/www/htdocs/Admin
Modified Files:
audit.mhtml user.mhtml
Log Message:
bug fixes, bug#1451624 bug#1451626 bug#1451625
Index: user.mhtml
===================================================================
RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/user.mhtml,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- user.mhtml 23 Jun 2005 20:21:09 -0000 1.24
+++ user.mhtml 16 Mar 2006 21:27:51 -0000 1.25
@@ -42,7 +42,7 @@
# these are reserved group names.
my %groups = ( 'Admin' => 1, 'ScanAdmin' => 1, 'Editor' => 1, 'Reports' => 1,
- 'UserEditor' => 1, 'QuarAdmin' => 1 ); #, 'NetAdmin' => 1 );
+ 'UserEditor' => 1, 'QuarAdmin' => 1 );
my @groups = (keys %groups);
my $error = "";
my $whoami = $m->session->{'username'};
@@ -148,7 +148,7 @@
foreach $user (keys %$uh) {
print "PASS1($user): examine group membership from webdata..\n" if $D;
foreach my $bdgrp (keys %{$uh->{$user}}) {
- print "\texamining group $bdgrp ..\n";
+ print "\texamining group $bdgrp ..\n" if $D;
if ($bdgrp !~ /$mygrpRE/) {
print "\t\twe found a group $bdgrp that we arent allowed to edit\n" if $D;
Index: audit.mhtml
===================================================================
RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/audit.mhtml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- audit.mhtml 7 Feb 2006 19:54:33 -0000 1.11
+++ audit.mhtml 16 Mar 2006 21:27:51 -0000 1.12
@@ -177,7 +177,7 @@
print $q->h4("Showing Results $result_set");
-if($count==0 && $start==0) {
+if($count == 0 && $start == 0) {
print $q->p("You may want to re-define your search to be less strict.<br>I would suggest removing one or more fields and modifying the Search Type.");
return;
}
@@ -187,10 +187,13 @@
print $q->a({ -href=>$next_link }, "Next Page -->") if($next_link ne '');
print $q->br;
+my $unameprompt = $np->cfg->policy(-key => 'USERNAME_PROMPT') || "Username";
+$unameprompt =~ s/:$//;
+
my @rows = (
$q->TR(
$q->th("Date/Time") .
- $q->th("UBIT Name") .
+ $q->th($unameprompt) .
$q->th("IP Address") .
$q->th("Mac Address") .
#$q->th("Severity") .
@@ -327,10 +330,11 @@
my $lres = $dbh->selectall_arrayref($query);
if(!defined($lres)) {
- return ("failed to retrieve local results: ". $dbh->errstr, -1);
+ print $q->p({-class => 'error'}, "Failed to retrieve local results: ". $dbh->errstr);
+ return ([], 0, "failed to retrieve local results: ". $dbh->errstr, -1);
}
- my $count = $#{$lres};
+ my $count = $#{$lres} > -1 ? $#{$lres} : 0;
my $link = "audit.mhtml?ip=$ip&mac=$mac&uid=$uid&type=$type&message=$message&search=Search&start=";
my $prev_link = $link . ($start-$limit);
@@ -347,6 +351,7 @@
}
my @results = @$lres;
+ my $rcount = 0;
use Sys::Hostname;
foreach my $npserv (keys %hosts) {
@@ -356,6 +361,7 @@
$np->cfg->dbUsername, $np->cfg->dbPassword);
if ($rdbh) {
my $rres = $rdbh->selectall_arrayref($query);
+ $rcount += ($#{$rres}+1);
if (ref($rres) eq "ARRAY") {
push @results, @$rres;
} else {
@@ -366,8 +372,7 @@
print $q->p({-class => 'error'}, "Failed to connect to database on $npserv");
}
}
-
- return (\@results, $count, $result_set, $next_link, $prev_link);
+ return (\@results, $count || $rcount, $result_set, $next_link, $prev_link);
}
</%perl>
|