[Netpass-devel] NetPass/www/htdocs/Admin switch.mhtml,1.2,1.3
Brought to you by:
jeffmurphy
|
From: jeff m. <jef...@us...> - 2005-06-02 19:59:27
|
Update of /cvsroot/netpass/NetPass/www/htdocs/Admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18786/www/htdocs/Admin Modified Files: switch.mhtml Log Message: switch config Index: switch.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/switch.mhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- switch.mhtml 2 Jun 2005 19:04:54 -0000 1.2 +++ switch.mhtml 2 Jun 2005 19:59:08 -0000 1.3 @@ -1,8 +1,9 @@ <%doc> </%doc> <%args> - $switch => ''; - $vlanmap => ''; + $submitButton => ''; + $switch => ''; + $vlanmap => ''; </%args> <%perl> $switch = pop @$switch if (ref($switch) eq "ARRAY"); @@ -20,16 +21,27 @@ $m->comp('/Admin/LockConfig', 'enableWhenLocked' => [ 'addSwitch', 'submitButton' ], 'init' => 0); my $lstat = $np->db->isConfigLocked(); -my @err; +my @err = (); +my $vm = ''; + +if ( $switch && ($switch ne $WH) && + ($submitButton eq "Commit Changes") && + (ref($lstat) eq "HASH") ) { -if ( $switch && ($switch ne $WH) && (ref($lstat) eq "HASH") ) { if ($lstat->{'user'} eq $whoami) { - + $vm = join(';', grep(!/^\-/, @$vlanmap)); + my $rv = $np->cfg->setVlanMap($switch, $vm); + push @err, $rv if ($rv); + $np->cfg->save(-user => $whoami) if ($#err == -1); } else { push @err, "The config is not locked."; } } +if ($#err > -1) { + print "<P class='error'>The following errors occurred:</P> "; + print "<OL><LI class='error'>", join("<LI class='error'>", @err), "</OL>"; +} </%perl> <h2> Switch Configuration </h2> @@ -52,7 +64,6 @@ <%perl> my $allSwitches = $np->cfg->getSwitches(); my $tlh; -my $vm; if ($switch) { $vm = $np->cfg->getVlanMap($switch); if (defined($vm)) { |