[Netpass-devel] NetPass/www/components/Client Remediate,1.10,1.11 ShowResults,1.6,1.7
Brought to you by:
jeffmurphy
|
From: jeff m. <jef...@us...> - 2005-05-18 15:24:00
|
Update of /cvsroot/netpass/NetPass/www/components/Client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13900/www/components/Client Modified Files: Remediate ShowResults Log Message: bugs in client remediation web page, strikes over-ride feature Index: ShowResults =================================================================== RCS file: /cvsroot/netpass/NetPass/www/components/Client/ShowResults,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ShowResults 17 May 2005 20:34:28 -0000 1.6 +++ ShowResults 18 May 2005 15:23:43 -0000 1.7 @@ -48,11 +48,11 @@ my $struckOut = {}; my $maxStrikes = $np->cfg->policy(-key => 'STRIKES', -network => $ip); -my $noStrikesForSnort = $np->cfg->policy(-key => 'NO_STRIKES_FOR_SNORT', -network => $ip); -my $noStrikesForNessus = $np->cfg->policy(-key => 'NO_STRIKES_FOR_NESSUS', -network => $ip); -my $noStrikesForManual = $np->cfg->policy(-key => 'NO_STRIKES_FOR_MANUAL', -network => $ip); if ($np->db->macIsRegistered($mac) && $maxStrikes) { + my $noStrikesForSnort = $np->cfg->policy(-key => 'NO_STRIKES_FOR_SNORT', -network => $ip); + my $noStrikesForNessus = $np->cfg->policy(-key => 'NO_STRIKES_FOR_NESSUS', -network => $ip); + my $noStrikesForManual = $np->cfg->policy(-key => 'NO_STRIKES_FOR_MANUAL', -network => $ip); for(my $rn = 0 ; $rn <= $nres ; $rn++) { my $uf = $np->db->getResults(-mac => $mac, @@ -60,7 +60,7 @@ -type => $results->{'type'}->[$rn], -id => $results->{'id'}->[$rn]); _log("DEBUG", "$mac $ip history on ".$results->{'type'}->[$rn].":". - $results->{'id'}->[$rn]. " is ". $#{$uf->{'type'}}); + $results->{'id'}->[$rn]. " is ". $#{$uf->{'type'}}. "\n"); # +1 bc $# is zero relative, +1 again because it's prev result + cur result if ( (ref($uf) eq "HASH") && ($#{$uf->{'type'}}+2 > $maxStrikes) ) { next if ( ($uf->{'type'}->[0] =~ /^snort$/i) && $noStrikesForSnort ); @@ -72,7 +72,6 @@ } if ($nres > -1) { - # if there's only one result pending, we forgo the javascript -/+ thing and suppress # the title. if they are pquar, we also suppress the 'fixed' button. @@ -100,7 +99,7 @@ } print qq{<tr><td colspan=3 align="right"> }; - print $q->submit(-name=>"fixed:$type:$sid:$rid", -value=>'Fixed') + print $q->submit(-name=>"fixed;$type;$sid;$rid", -value=>'Fixed') unless ($pquar || ($struckOut->{$type}->{$sid} == 1)); print qq{</td>}; print qq{</tr><tr><td colspan=3>}; @@ -156,7 +155,7 @@ } print qq{</td><td>$shortName</td>}; print qq{<td width="1%" align="right"> }; - print $q->submit(-name=>"fixed:$type:$sid:$rid", -value=>'Fixed') + print $q->submit(-name=>"fixed;$type;$sid;$rid", -value=>'Fixed') unless ($pquar || ($struckOut->{$type}->{$sid} == 1)); print qq{</td>}; print qq{</tr><tr><td colspan=3 class="gray">}; Index: Remediate =================================================================== RCS file: /cvsroot/netpass/NetPass/www/components/Client/Remediate,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Remediate 1 May 2005 05:44:11 -0000 1.10 +++ Remediate 18 May 2005 15:23:43 -0000 1.11 @@ -44,7 +44,7 @@ foreach my $sid (keys %ARGS) { if($ARGS{$sid} eq 'Fixed') { - my ($type, $id, $rid) = (split(':', $sid))[1,2,3]; + my ($type, $id, $rid) = (split(';', $sid))[1,2,3]; _log ("INFO", "$mac $ip user claims $type:$id:$rid is fixed.\n"); my $rv = $np->db->updateResult(-mac => $mac, -ip => $ip, -rowid => $rid, -status => 'user-fixed'); |