Update of /cvsroot/netpass/NetPass/www/htdocs/Admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14183/www/htdocs/Admin
Modified Files:
index.mhtml qc.mhtml
Log Message:
bug #1409203
Index: qc.mhtml
===================================================================
RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/qc.mhtml,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- qc.mhtml 14 Sep 2005 19:33:31 -0000 1.29
+++ qc.mhtml 18 Jan 2006 17:01:30 -0000 1.30
@@ -532,9 +532,9 @@
}
sub saveQuarChanges {
- my $dbh = shift;
- my $args = shift;
- my $ids = shift;
+ my $dbh = shift;
+ my $args = shift;
+ my $ids = shift;
my $isRoot = shift;
my $rwGroups = shift;
my $roGroups = shift;
@@ -717,10 +717,6 @@
#print "sql=", $sql, "<P>";
#print "params=", join(", ", @params), "<P>";
- # if quarantine status has changed, then we need to instruct
- # the portmover to reset their port. if only the message is changed,
- # portmover doesnt need to know.
-
# 1. is the IP active?
# 2. does the mac match?
# 3. what sw/po is it on?
@@ -735,32 +731,38 @@
print qq{<P class='error'>Database update succeeded for mac address "$mac" ($ipAddr)</P>};
_log("DEBUG", "$mac $ipAddr record updated.\n");
- my ($sw, $po, $m2p, $p2m) = $np->findOurSwitchPort($mac, $ipAddr);
-
- if (!defined($sw) || !defined($po)) {
- $rv = "not found on network. Port reset failed.";
-
- _log("DEBUG", "$mac $ipAddr $rv\n");
- $np->db->audit(-mac => $mac, -ip => $args->{'ip'},
- -user => $m->session->{'username'},
- -msg => [ "QC: $rv " ]);
+ # if quarantine status has changed, then we need to instruct
+ # the portmover to reset their port.
- $rv = qq{MAC address "$mac" $rv};
- } else {
- _log("DEBUG", "$mac $ipAddr found. quarantining $sw $po\n");
- if (! $np->db->requestMovePort(-switch => $sw,
- -port => $po, -vlan => 'quarantine',
- -by => 'qc.mhtml')) {
+ if ($s_unc == 0) {
+ my ($sw, $po, $m2p, $p2m) = $np->findOurSwitchPort($mac, $ipAddr);
- $rv = "$mac requestMovePort($sw, $po) failed\n";
- _log("ERROR", "$rv\n");
+ if (!defined($sw) || !defined($po)) {
+ $rv = "not found on network. Port reset failed.";
+ _log("DEBUG", "$mac $ipAddr $rv\n");
$np->db->audit(-mac => $mac, -ip => $args->{'ip'},
-user => $m->session->{'username'},
- -msg => [ "QC: $rv " ]);
- }
+ -msg => [ "QC: $rv " ]);
+ $rv = qq{MAC address "$mac" $rv};
+ } else {
+ _log("DEBUG", "$mac $ipAddr found. quarantining $sw $po\n");
+ if (! $np->db->requestMovePort(-switch => $sw,
+ -port => $po, -vlan => 'quarantine',
+ -by => 'qc.mhtml')) {
+
+ $rv = "$mac requestMovePort($sw, $po) failed\n";
+ _log("ERROR", "$rv\n");
+
+ $np->db->audit(-mac => $mac, -ip => $args->{'ip'},
+ -user => $m->session->{'username'},
+ -msg => [ "QC: $rv " ]);
+ }
+ }
}
+ # else portmover doesnt need to know.
+
} else {
$rv = "$mac failed to update database: ".$sth->errstr;
_log("ERROR", "$rv\n");
Index: index.mhtml
===================================================================
RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/index.mhtml,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- index.mhtml 31 Aug 2005 20:09:17 -0000 1.13
+++ index.mhtml 18 Jan 2006 17:01:30 -0000 1.14
@@ -132,8 +132,9 @@
my $proxy = "tcp://$host:$port";
my $soap = SOAP::Lite->new(
- uri => 'tcp://netpass/NetPass/Snort',
- proxy => $proxy,
+ uri => 'tcp://netpass/NetPass/Snort',
+ proxy => $proxy,
+ timeout => 5
);
return undef unless defined $soap;
|