Revision: 6699 http://ipcop.svn.sourceforge.net/ipcop/?rev=6699&view=rev Author: dotzball Date: 2012-07-09 14:58:02 +0000 (Mon, 09 Jul 2012) Log Message: ----------- Fix OVPN save config validation(s).
Modified Paths: -------------- ipcop/trunk/html/cgi-bin/proxy.cgi Modified: ipcop/trunk/html/cgi-bin/proxy.cgi =================================================================== --- ipcop/trunk/html/cgi-bin/proxy.cgi 2012-07-09 14:38:20 UTC (rev 6698) +++ ipcop/trunk/html/cgi-bin/proxy.cgi 2012-07-09 14:58:02 UTC (rev 6699) @@ -393,7 +393,9 @@ if ($proxysettings{'ENABLED_GREEN_1'} !~ /^(on|off)$/ || $proxysettings{'TRANSPARENT_GREEN_1'} !~ /^(on|off)$/ || $proxysettings{'ENABLED_BLUE_1'} !~ /^(on|off)$/ || - $proxysettings{'TRANSPARENT_BLUE_1'} !~ /^(on|off)$/ ) { + $proxysettings{'TRANSPARENT_BLUE_1'} !~ /^(on|off)$/ || + $proxysettings{'ENABLED_OVPN'} !~ /^(on|off)$/ || + $proxysettings{'TRANSPARENT_OVPN'} !~ /^(on|off)$/ ) { $errormessage = $Lang::tr{'invalid input'}; goto ERROR; } @@ -483,22 +485,32 @@ ($proxysettings{'IDENT_REQUIRED'} eq 'off') && ($proxysettings{'IDENT_ENABLE_ACL'} eq 'off')) { + my $transparent = 0; + if ($netsettings{'BLUE_COUNT'} >= 1) { - if ((($proxysettings{'ENABLED_GREEN_1'} eq 'off') || ($proxysettings{'TRANSPARENT_GREEN_1'} eq 'on')) && - (($proxysettings{'ENABLED_BLUE_1'} eq 'off') || ($proxysettings{'TRANSPARENT_BLUE_1'} eq 'on'))) + if (($proxysettings{'ENABLED_BLUE_1'} eq 'on') && ($proxysettings{'TRANSPARENT_BLUE_1'} eq 'on')) { - $errormessage = $Lang::tr{'errmsg non-transparent proxy required'}; - goto ERROR; + $transparent++; } } - else { - if (($proxysettings{'ENABLED_GREEN_1'} eq 'off') || ($proxysettings{'TRANSPARENT_GREEN_1'} eq 'on')) + if ($ovpnactive) + { + if (($proxysettings{'ENABLED_OVPN'} eq 'on') && ($proxysettings{'TRANSPARENT_OVPN'} eq 'on')) { - $errormessage = $Lang::tr{'errmsg non-transparent proxy required'}; - goto ERROR; + $transparent++; } } + if (($proxysettings{'ENABLED_GREEN_1'} eq 'on') && ($proxysettings{'TRANSPARENT_GREEN_1'} eq 'on')) + { + $transparent++; + } + + if($transparent > 0) + { + $errormessage = $Lang::tr{'errmsg non-transparent proxy required'}; + goto ERROR; + } } if ((!($proxysettings{'AUTH_MAX_USERIP'} eq '')) && ((!($proxysettings{'AUTH_MAX_USERIP'} =~ /^\d+/)) || ($proxysettings{'AUTH_MAX_USERIP'} < 1) || ($proxysettings{'AUTH_MAX_USERIP'} > 255))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn