[Netpass-devel] NetPass/www/htdocs/Admin auth.mhtml,1.2,1.3 autohandler,1.13,1.14 switch.mhtml,1.3,1
Brought to you by:
jeffmurphy
|
From: jeff m. <jef...@us...> - 2005-06-03 17:00:05
|
Update of /cvsroot/netpass/NetPass/www/htdocs/Admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16208/www/htdocs/Admin Modified Files: auth.mhtml autohandler switch.mhtml Log Message: switch config gui Index: switch.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/switch.mhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- switch.mhtml 2 Jun 2005 19:59:08 -0000 1.3 +++ switch.mhtml 3 Jun 2005 16:59:55 -0000 1.4 @@ -4,6 +4,8 @@ $submitButton => ''; $switch => ''; $vlanmap => ''; + $rocomm => ''; + $rwcomm => ''; </%args> <%perl> $switch = pop @$switch if (ref($switch) eq "ARRAY"); @@ -29,9 +31,14 @@ (ref($lstat) eq "HASH") ) { if ($lstat->{'user'} eq $whoami) { - $vm = join(';', grep(!/^\-/, @$vlanmap)); + $vm = $vlanmap; + $vm = join(';', grep(!/^\-/, @$vlanmap)) if (ref($vlanmap) eq "ARRAY"); my $rv = $np->cfg->setVlanMap($switch, $vm); push @err, $rv if ($rv); + $rv = $np->cfg->setCommunities(-switch => $switch, + -readonly => $rocomm, + -readwrite => $rwcomm); + push @err, $rv if ($rv); $np->cfg->save(-user => $whoami) if ($#err == -1); } else { push @err, "The config is not locked."; @@ -45,7 +52,12 @@ </%perl> <h2> Switch Configuration </h2> -Select a switch, or add a new one. Once selected, edit the port-to-vlan mappings. + +Select a switch, or add a new one. Once selected, edit the port-to-vlan mappings. To delete +a switch, remove all of its mappings. This will not delete the switch from any +<a href="network.mhtml">networks</a> it may be assigned to. It will only delete it from this +section of the config. + <P> <B>Warnings: <ul> <li>No error checking is performed, at present, to detect overlaps or malformed VLAN mappings. Double @@ -106,6 +118,11 @@ name='deleteVlan' id='deleteVlan' value='Delete Vlan'> </td> </tr> +<tr class='vlanmapRow' id='commnameRow' style='display:none;'> +<td style='text-align:right;'>Read Community:<BR>(Read/)Write Community:</td> +<td colspan=2><input size=16 name='rocomm' value='<%$rocomm%>'><BR> +<input size=16 name='rwcomm' value='<%$rwcomm%>'></td> +</tr> </table> </form> @@ -115,6 +132,7 @@ <script language='JavaScript'> % if ($switch && ($switch ne $WH)) { showHideObj2('vlanmapRow'); +showHideObj2('commnameRow'); % } </script> Index: autohandler =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/autohandler,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- autohandler 2 Jun 2005 19:04:54 -0000 1.13 +++ autohandler 3 Jun 2005 16:59:55 -0000 1.14 @@ -39,7 +39,7 @@ <a class="sbLinks" href="/Admin/gencfg.mhtml" title="">General</a><br> <a class="sbLinks" href="/Admin/network.mhtml" title="">Network</a><br> <a class="sbLinks" href="/Admin/netgroups.mhtml" title="">Netgroup</a><br> -<a class="sbLinks" href="/Admin/switch.mhtml" title="">VLAN Map</a><br> +<a class="sbLinks" href="/Admin/switch.mhtml" title="">Switches</a><br> <!--<a class="sbLinks" href="/Admin/urlfilter.mhtml" title="">URL Filter</a><br>--> <a class="sbLinks" href="/Admin/greset.mhtml" title="">Global Reset</a><br> <a class="sbLinks" href="/Admin/Scan/ids.mhtml" title="">IDS Config</a><br> Index: auth.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/auth.mhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- auth.mhtml 3 May 2005 16:13:29 -0000 1.2 +++ auth.mhtml 3 Jun 2005 16:59:55 -0000 1.3 @@ -1,7 +1,19 @@ <%doc> </%doc> <%args> + $auth_method => ''; + $admin_auth_method => ''; </%args> +<%perl> +my ($isRoot, $junk) = $m->comp('/Admin/MemberOf', 'acl' => [ 'Admin' ], 'group' => 'default'); +if (!$isRoot) { + print qq{<p class='error'>Sorry, you don't have access to this form.</P>}; + return; +} +my $WH = "----------------------"; +my $aa = $np->cfg->policy(-key => 'ADMIN_AUTH_METHOD'); +my $ca = $np->cfg->policy(-key => 'AUTH_METHOD'); +</%perl> <script language='JavaScript'><!-- var pageDirty = false; @@ -16,25 +28,35 @@ <TR> <TD CLASS='left'>Client Auth Method</TD> <TD CLASS='right'> - -<%perl> -print $q->popup_menu ( - -name => 'policy:AUTH_METHOD', - -default => $np->cfg->policy(-key => 'AUTH_METHOD'), +<%$q->popup_menu ( + -name => 'auth_method', + -default => $ca, -values => [ 'NetPass::Auth::DB' , 'NetPass::Auth::Radius', 'NetPass::Auth::LDAP', 'NetPass::Auth::Unix' ] - ); -print "</TD></TR>"; - -print "<TR>"; -print "<TD CLASS='left'>Admin Auth Method</TD>"; -print "<TD CLASS='right'>"; -print $q->popup_menu ( - -name => 'policy:ADMIN_AUTH_METHOD', - -default => $np->cfg->policy(-key => 'ADMIN_AUTH_METHOD'), + )%> +</TD></TR> +<TR><TD> +% 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> +<TD CLASS='right'> +<%$q->popup_menu ( + -name => 'admin_auth_method', + -default => $aa, -values => [ 'NetPass::Auth::DB' , 'NetPass::Auth::Radius', 'NetPass::Auth::LDAP', 'NetPass::Auth::Unix' ] - ); -print "</TD></TR>"; -</%perl> + )%> +</TD></TR> +<TR><TD> +% if ($aa eq "Netpass::Auth::Radius") { +% $m->comp('/Admin/FormAuthRadius', 'prefix' => 'admin_', %ARGS); +% elsif ($aa eq "Netpass::Auth::LDAP") { +% $m->comp('/Admin/FormAuthLDAP', 'prefix' => 'admin_', %ARGS); +% } +</tD></TR> </table> |