[Netpass-devel] NetPass/www/htdocs/Admin qc.mhtml,1.17,1.18 user.mhtml,1.19,1.20
Brought to you by:
jeffmurphy
From: jeff m. <jef...@us...> - 2005-04-29 00:30:18
|
Update of /cvsroot/netpass/NetPass/www/htdocs/Admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4093/www/htdocs/Admin Modified Files: qc.mhtml user.mhtml Log Message: user/group work Index: qc.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/qc.mhtml,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- qc.mhtml 27 Apr 2005 03:54:08 -0000 1.17 +++ qc.mhtml 29 Apr 2005 00:30:07 -0000 1.18 @@ -25,6 +25,8 @@ <%perl> +return unless $m->comp('/Admin/Login', %ARGS); + my @rwGroups = ('Admin', 'QuarAdmin'); my @roGroups = ('Reports'); my $readOnly = "disabled"; @@ -43,7 +45,7 @@ else { print $q->p({-class=>'error'}, "Sorry, you don't have permission to access this form.<P>"); - return; + return; } my $statuses = ['QUAR','PQUAR','UNQUAR','PUNQUAR']; # love the grammer! @@ -176,7 +178,7 @@ ) ); -return if(!$submit && !$search); +goto end_of_page if(!$submit && !$search); if($submit) { if ($readOnly eq "") { @@ -186,9 +188,9 @@ } } else { # this really shouldnt happen. we dont give them a submit button - $np->db->audit( -user => $m->session->{'username'}, + $np->db->audit( -user => $m->session->{'username'}, -severity => "ALERT", - -msg => [ "tried to change QuarControl but is ReadOnly" ]); + -msg => [ "tried to change QuarControl but is ReadOnly" ]); } } @@ -225,7 +227,7 @@ $q->th("Unquar<BR>When?") . $q->th("Status") . $q->th("History") . - $q->th("Message") + $q->th("Add Result") ) ); @@ -298,6 +300,8 @@ print $q->table({-width=>'80%'}, @rows); +end_of_page:; + print $q->p(); print $q->end_form(); @@ -326,10 +330,14 @@ my @params = (); if($mac) { - my @macList = split("\n", $mac); + $mac =~ s/\n/ /g; + $mac =~ s/\r/ /g; + $mac =~ s/\s+/ /g; + my @macList = split(/\s/, $mac); if ($#macList > 0) { my @_clause; for(my $ml = 0; $ml <= $#macList ; $ml++) { + next unless $macList[$ml] ne ""; $macList[$ml] =~ s/://g; $macList[$ml] = lc($macList[$ml]); push @_clause, "macAddress=?"; @@ -404,7 +412,7 @@ my @msgs = (''); while(my $m = $sth->fetchrow_arrayref) { - push(@msgs, $m->[0]); + push(@msgs, $m->[0]); } $sth->finish; Index: user.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/user.mhtml,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- user.mhtml 25 Apr 2005 02:52:48 -0000 1.19 +++ user.mhtml 29 Apr 2005 00:30:08 -0000 1.20 @@ -231,7 +231,7 @@ } - $np->db->setUsersAndGroups(-userhash => $uh, -whoami => $m->{'session'}->{'username'}, + $np->db->setUsersAndGroups(-userhash => $uh, -whoami => $m->session->{'username'}, -ip => $ENV{'REMOTE_ADDR'}); # because some of the above might have altered this hash, we reload it from the |