[Netpass-devel] NetPass/www/htdocs/Admin auth.mhtml,1.4,1.5 netgroups.mhtml,1.6,1.7 network.mhtml,1.
Brought to you by:
jeffmurphy
From: jeff m. <jef...@us...> - 2005-06-08 16:35:51
|
Update of /cvsroot/netpass/NetPass/www/htdocs/Admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4634/www/htdocs/Admin Modified Files: auth.mhtml netgroups.mhtml network.mhtml Log Message: bug fixes to editor, auth methods UI feature Index: network.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/network.mhtml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- network.mhtml 2 Jun 2005 19:04:54 -0000 1.9 +++ network.mhtml 8 Jun 2005 16:35:42 -0000 1.10 @@ -37,10 +37,10 @@ $garpNumber => 3; $switches => []; $BSW => ''; + $delNetwork => ''; </%args> <%perl> use Data::Dumper; - #print "<PRE>", Dumper(\%ARGS), "</PRE>"; my ($isRoot, $junk) = $m->comp('/Admin/MemberOf', 'acl' => [ 'Admin' ], 'group' => 'default'); if (!$isRoot) { @@ -54,15 +54,31 @@ use Sys::Hostname; my $ng; +my $WH = "--Select a Network--"; +my $WH2 = "----------------------"; my @setResults = (); -if ( ($submitButton eq "Commit Changes") && $network ) { +# XX is cfg locked? +# XX audit + +my $rv; + +if ( ($delNetwork eq "Delete Network") && $network && ($network ne $WH) ) { + _log("DEBUG", $whoami. " is deleting $network"); + $rv = $np->cfg->delNetwork(-network => $network); + if ($rv) { + push @setResults, "Failed to delete network $network - $rv"; + } else { + $np->cfg->save(-user => $whoami); + } +} + +if ( ($submitButton eq "Commit Changes") && $network && ($network ne $WH) ) { _log("DEBUG", $m->session->{'username'}. " is updating $network $secondaryRedirector\n"); - my $rv; $rv = $np->cfg->setNetwork(-network => $network, -comment => $comment, -interface => $interface, @@ -97,12 +113,12 @@ $garpDelay ||= 5; $garpNumber ||= 3; -if ($network && $np->cfg->garp($network)) { +if ($network && ($network ne $WH) && $np->cfg->garp($network)) { $garpDelay = $np->cfg->garp($network, 'delay'); $garpNumber = $np->cfg->garp($network, 'number'); } -if ($network) { +if ($network && ($network ne $WH)) { $qvid = $np->cfg->quarantineVlan($network); $uqvid = $np->cfg->nonquarantineVlan($network); $interface = $np->cfg->getInterface($network); @@ -112,7 +128,7 @@ $switches = $np->cfg->getSwitches($network); $BSW = $np->cfg->getBSW($network); } -if ($network && $np->cfg->ha($network)) { +if ($network && ($network ne $WH) && $np->cfg->ha($network)) { $primaryRedirector = $np->cfg->primary_redirector($network); $secondaryRedirector = $np->cfg->secondary_redirector($network); $haNPServers = $np->cfg->ha_servers($network); @@ -132,9 +148,7 @@ my $_ng = $np->cfg->getNetgroup(-network => $nw); push @$allNetgroups, $_ng if ($_ng ne "") && (!grep(/^$_ng$/, @$allNetgroups)); } -$m->comp('/Admin/LockConfig', 'enableWhenLocked' => [ 'addNetwork', 'submitButton' ], 'init' => 0); -my $WH = "--Select a Network--"; -my $WH2 = "----------------------"; +$m->comp('/Admin/LockConfig', 'enableWhenLocked' => [ 'addNetwork', 'submitButton', 'delNetwork' ], 'init' => 0); </%perl> @@ -175,6 +189,7 @@ <td class='selector'> <input id='addNetwork' name='addNetwork' size=20 value='Add Network...' disabled onblur='network_onblur_addNetwork(this);' onfocus='network_onfocus_addNetwork(this);'> + <input id='delNetwork' name='delNetwork' value='Delete Network' type='submit' disabled> </td> <td class='selector'> <input type='submit' onclick='network_onclick_submitButton();' Index: auth.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/auth.mhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- auth.mhtml 3 Jun 2005 19:41:22 -0000 1.4 +++ auth.mhtml 8 Jun 2005 16:35:42 -0000 1.5 @@ -63,11 +63,8 @@ )%> </TD></TR> <TR><TD colspan=2 align='right'> -% if ($ca eq "NetPass::Auth::Radius") { % $m->comp('/Admin/FormAuthRadius', %ARGS); -% } elsif ($ca eq "NetPass::Auth::LDAP") { % $m->comp('/Admin/FormAuthLDAP', %ARGS); -% } </tD></TR> <TR> <TD CLASS='left'>Admin Auth Method</TD> Index: netgroups.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/netgroups.mhtml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- netgroups.mhtml 17 May 2005 20:34:28 -0000 1.6 +++ netgroups.mhtml 8 Jun 2005 16:35:42 -0000 1.7 @@ -91,6 +91,11 @@ my $WH = "-" x 20; if ($submitButton eq 'Commit Changes') { + if ($netgroups =~ /;/) { + print "<P class='error'>Netgroup name can not contain semi-colons</P>"; + goto show_form; + } + if (! grep(/^$netgroups$/, @$allNetgroups) ) { # add the netgroup because we don't already know about it @@ -190,6 +195,7 @@ print "<P class='error'>Netgroup Configuration Saved.</P>"; } } +show_form:; </%perl> <form method="post"> |