This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree".
The branch, next has been updated via 290007b3b07ef6bc69bc97d54825fcf96eeb9eb6 (commit) via 52d08bcbd2b5da9fbd3f002c6b686a0202e6fffe (commit) from 83920cfcd52b40f718170f524287dc42b41d10ed (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 290007b3b07ef6bc69bc97d54825fcf96eeb9eb6 Author: Alexander Marx amarx@ipfire.org Date: Wed Nov 21 11:49:53 2012 +0100
openvpn ccd: Fix subnet mask validation.
commit 52d08bcbd2b5da9fbd3f002c6b686a0202e6fffe Author: Alexander Marx amarx@ipfire.org Date: Wed Nov 21 10:31:12 2012 +0100
openvpn ccd: Minor fixes: iroute, delete route line.
Fixed several bugs:
1) iroute line not correctly printed in ccd file 2) route line was not deleted from server.conf when deleting a client 3) Routebox (client has access to these networks on ipfire site) did not show green,orange and blue when no static route was defined on ipfire 4) Green is no longer selected as default route in clientconfig.
Tested all Options with Windows 7 Client and Linux Mint 12
-----------------------------------------------------------------------
Summary of changes: config/cfgroot/general-functions.pl | 4 +- html/cgi-bin/ovpnmain.cgi | 286 +++++++++++++++++++++--------------- langs/de/cgi-bin/de.pl | 2 +- langs/en/cgi-bin/en.pl | 2 +- src/scripts/ovpn-ccd-convert | 9 +- 5 files changed, 178 insertions(+), 125 deletions(-)
Difference in files: diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 6026173..6055567 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -383,13 +383,13 @@ sub validipandmask if ($ccdip=~/^(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})$/ &&(($1>0 && $1<=255 && $2>=0 && $2<=255 && $3>=0 && $3<=255 && $4<=255 ))) { #Subnet in decimal and valid? if ($ccdsubnet=~/^(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})$/ &&(($1<=255 && $2<=$1 && $3<=$2 && $4<=$3 ))) { - for (my $i=8;$i<=30;$i++){ + for (my $i=8;$i<=32;$i++){ if (&General::cidrtosub($i) eq $ccdsubnet){ return 1; } } #Subnet already in binary format? - }elsif ($ccdsubnet=~/^(\d{1,2})$/ && (($1<=30 && $1>=8))){ + }elsif ($ccdsubnet=~/^(\d{1,2})$/ && (($1<=32 && $1>=8))){ return 1; }else{ return 0; diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 9ab06fe..ca43e7d 100755 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -321,7 +321,6 @@ sub disallowreserved return; }
- sub writeserverconf { my %sovpnsettings = (); my @temp = (); @@ -495,21 +494,36 @@ sub addccdnet my $checkup; my $ccdip; my $baseaddress; - if(!&General::validhostname($ccdname)){ + + + #check name + if ($ccdname eq '') + { + $errormessage=$errormessage.$Lang::tr{'ccd err name'}."<br>"; + return + } + + if(!&General::validhostname($ccdname)) + { $errormessage=$Lang::tr{'ccd err invalidname'}; return; } - #check ip - if (&General::validipandmask($ccdnet)){ - $ccdnet=&General::iporsubtocidr($ccdnet); - }else{ + + ($ccdip,$subcidr) = split (///,$ccdnet); + $subcidr=&General::iporsubtocidr($subcidr); + #check subnet + if ($subcidr > 30) + { $errormessage=$Lang::tr{'ccd err invalidnet'}; return; } - ($ccdip,$subcidr) = split (///,$ccdnet); - if ($ccdname eq '') { - $errormessage=$errormessage.$Lang::tr{'ccd err name'}."<br>"; + #check ip + if (!&General::validipandmask($ccdnet)){ + $errormessage=$Lang::tr{'ccd err invalidnet'}; + return; } + + #check if we try to use same network as ovpn server if (&General::iporsubtocidr($ccdnet) eq &General::iporsubtocidr($ovpnsubnet)) { $errormessage=$errormessage.$Lang::tr{'ccd err isovpnnet'}."<br>"; @@ -2221,7 +2235,7 @@ else } } &General::writehasharray("${General::swroot}/ovpn/ccdroute2", %ccdroute2hash); - + &writeserverconf; # CCD end @@ -2486,7 +2500,21 @@ if ( -e "/var/run/openvpn.pid"){ print" <br><b><font color='#990000'>$Lang::tr{'attention'}:</b></font><br> $Lang::tr{'server restart'}<br><br> <hr>"; -} + print<<END +<table width='100%'> +<tr> + <td> </td> + <td allign='center'><input type='submit' name='ACTION' value='$Lang::tr{'save-adv-options'}' disabled='disabled' /></td> + <td allign='center'><input type='submit' name='ACTION' value='$Lang::tr{'cancel-adv-options'}' /></td> + <td> </td> +</tr> +</table> +</form> +END +; + + +}else{
print<<END <table width='100%'> @@ -2500,7 +2528,7 @@ print<<END </form> END ; - +} &Header::closebox(); # print "<div align='center'><a href='/cgi-bin/ovpnmain.cgi'>$Lang::tr{'back'}</a></div>"; &Header::closebigbox(); @@ -3218,7 +3246,7 @@ if ($confighash{$cgiparams{'KEY'}}) { $cgiparams{'ENABLED'} = $confighash{$cgiparams{'KEY'}}[0]; $cgiparams{'NAME'} = $confighash{$cgiparams{'KEY'}}[1]; $cgiparams{'TYPE'} = $confighash{$cgiparams{'KEY'}}[3]; - $cgiparams{'AUTH'} = $confighash{$cgiparams{'KEY'}}[4]; + $cgiparams{'AUTH'} = $confighash{$cgiparams{'KEY'}}[4]; $cgiparams{'PSK'} = $confighash{$cgiparams{'KEY'}}[5]; $cgiparams{'SIDE'} = $confighash{$cgiparams{'KEY'}}[6]; $cgiparams{'LOCAL_SUBNET'} = $confighash{$cgiparams{'KEY'}}[8]; @@ -3226,27 +3254,27 @@ if ($confighash{$cgiparams{'KEY'}}) { $cgiparams{'REMOTE_SUBNET'} = $confighash{$cgiparams{'KEY'}}[11]; $cgiparams{'OVPN_MGMT'} = $confighash{$cgiparams{'KEY'}}[22]; $cgiparams{'MSSFIX'} = $confighash{$cgiparams{'KEY'}}[23]; - $cgiparams{'FRAGMENT'} = $confighash{$cgiparams{'KEY'}}[24]; + $cgiparams{'FRAGMENT'} = $confighash{$cgiparams{'KEY'}}[24]; $cgiparams{'REMARK'} = $confighash{$cgiparams{'KEY'}}[25]; - $cgiparams{'INTERFACE'} = $confighash{$cgiparams{'KEY'}}[26]; + $cgiparams{'INTERFACE'} = $confighash{$cgiparams{'KEY'}}[26]; $cgiparams{'OVPN_SUBNET'} = $confighash{$cgiparams{'KEY'}}[27]; $cgiparams{'PROTOCOL'} = $confighash{$cgiparams{'KEY'}}[28]; - $cgiparams{'DEST_PORT'} = $confighash{$cgiparams{'KEY'}}[29]; + $cgiparams{'DEST_PORT'} = $confighash{$cgiparams{'KEY'}}[29]; $cgiparams{'COMPLZO'} = $confighash{$cgiparams{'KEY'}}[30]; $cgiparams{'MTU'} = $confighash{$cgiparams{'KEY'}}[31]; - $cgiparams{'CHECK1'} = $confighash{$cgiparams{'KEY'}}[32]; + $cgiparams{'CHECK1'} = $confighash{$cgiparams{'KEY'}}[32]; my $name=$cgiparams{'CHECK1'} ; $cgiparams{$name} = $confighash{$cgiparams{'KEY'}}[33]; $cgiparams{'RG'} = $confighash{$cgiparams{'KEY'}}[34]; $cgiparams{'CCD_DNS1'} = $confighash{$cgiparams{'KEY'}}[35]; $cgiparams{'CCD_DNS2'} = $confighash{$cgiparams{'KEY'}}[36]; $cgiparams{'CCD_WINS'} = $confighash{$cgiparams{'KEY'}}[37]; - $cgiparams{'PMTU_DISCOVERY'} = $confighash{$cgiparams{'KEY'}}[38]; + $cgiparams{'PMTU_DISCOVERY'} = $confighash{$cgiparams{'KEY'}}[38]; } elsif ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) { $cgiparams{'REMARK'} = &Header::cleanhtml($cgiparams{'REMARK'}); #A.Marx CCD check iroute field and convert it to decimal - +if ($cgiparams{'TYPE'} eq 'host') { my @temp=(); my %ccdroutehash=(); my $keypoint=0; @@ -3269,6 +3297,7 @@ if ($confighash{$cgiparams{'KEY'}}) { chomp($val); $val=~s/\s*$//g; my($ip,$cidr) = split(///,$val); + $ip=&General::getnetworkip($ip,&General::iporsubtocidr($cidr)); $cidr=&General::iporsubtodec($cidr); #check if iroute exists in ccdroute @@ -3282,16 +3311,24 @@ if ($confighash{$cgiparams{'KEY'}}) { } #check for existing network IP's - if ((&General::IpInSubnet ($ip,$netsettings{GREEN_NETADDRESS},$netsettings{GREEN_NETMASK}) && $netsettings{GREEN_NETADDRESS} ne '0.0.0.0')|| - (&General::IpInSubnet ($ip,$netsettings{RED_NETADDRESS},$netsettings{RED_NETMASK}) && $netsettings{RED_NETADDRESS} ne '0.0.0.0')|| - (&General::IpInSubnet ($ip,$netsettings{BLUE_NETADDRESS},$netsettings{BLUE_NETMASK}) && $netsettings{BLUE_NETADDRESS} ne '0.0.0.0' && $netsettings{BLUE_NETADDRESS} gt '')|| - (&General::IpInSubnet ($ip,$netsettings{ORANGE_NETADDRESS},$netsettings{ORANGE_NETMASK}) && $netsettings{ORANGE_NETADDRESS} ne '0.0.0.0' && $netsettings{ORANGE_NETADDRESS} gt '' )){ - $errormessage="$ip USED FOR SYSTEM!"; + if (&General::IpInSubnet ($ip,$netsettings{GREEN_NETADDRESS},$netsettings{GREEN_NETMASK}) && $netsettings{GREEN_NETADDRESS} ne '0.0.0.0') + { + $errormessage=$Lang::tr{'ccd err green'}; + goto VPNCONF_ERROR; + }elsif(&General::IpInSubnet ($ip,$netsettings{RED_NETADDRESS},$netsettings{RED_NETMASK}) && $netsettings{RED_NETADDRESS} ne '0.0.0.0') + { + $errormessage=$Lang::tr{'ccd err red'}; + goto VPNCONF_ERROR; + }elsif(&General::IpInSubnet ($ip,$netsettings{BLUE_NETADDRESS},$netsettings{BLUE_NETMASK}) && $netsettings{BLUE_NETADDRESS} ne '0.0.0.0' && $netsettings{BLUE_NETADDRESS} gt '') + { + $errormessage=$Lang::tr{'ccd err blue'}; + goto VPNCONF_ERROR; + }elsif(&General::IpInSubnet ($ip,$netsettings{ORANGE_NETADDRESS},$netsettings{ORANGE_NETMASK}) && $netsettings{ORANGE_NETADDRESS} ne '0.0.0.0' && $netsettings{ORANGE_NETADDRESS} gt '' ) + { + $errormessage=$Lang::tr{'ccd err orange'}; goto VPNCONF_ERROR; } - - - + if (&General::validipandmask($val)){ $ccdroutehash{$keypoint}[$i] = $ip."/".$cidr; }else{ @@ -3314,51 +3351,44 @@ if ($confighash{$cgiparams{'KEY'}}) { } undef @temp; #check route field and convert it to decimal - my $val=0; my $i=1; - &General::readhasharray("${General::swroot}/ovpn/ccdroute2", %ccdroute2hash); - if($cgiparams{'IFROUTE'} eq $Lang::tr{'ccd none'} || $cgiparams{'IFROUTE'} eq '') { - undef $cgiparams{'IFROUTE'}; - foreach my $key (keys %ccdroute2hash){ - if ($ccdroute2hash{$key}[0] eq $cgiparams{'NAME'}) { - delete $ccdroute2hash{$key}; - } - } - &General::writehasharray("${General::swroot}/ovpn/ccdroute2", %ccdroute2hash); - }else{ - #find key to use - foreach my $key (keys %ccdroute2hash) { - if ($ccdroute2hash{$key}[0] eq $cgiparams{'NAME'}) { - $keypoint=$key; - delete $ccdroute2hash{$key}; - }else{ - $keypoint = &General::findhasharraykey (%ccdroute2hash); - &General::writehasharray("${General::swroot}/ovpn/ccdroute", %ccdroutehash); - &writeserverconf; - } + #find key to use + foreach my $key (keys %ccdroute2hash) { + if ($ccdroute2hash{$key}[0] eq $cgiparams{'NAME'}) { + $keypoint=$key; + delete $ccdroute2hash{$key}; + }else{ + $keypoint = &General::findhasharraykey (%ccdroute2hash); + &General::writehasharray("${General::swroot}/ovpn/ccdroute", %ccdroutehash); + &writeserverconf; } - $ccdroute2hash{$keypoint}[0]=$cgiparams{'NAME'}; - @temp = split(/|/,$cgiparams{'IFROUTE'}); - my %ownnet=(); - &General::readhash("${General::swroot}/ethernet/settings", %ownnet); - foreach $val (@temp){ - chomp($val); - $val=~s/\s*$//g; - if ($val eq $Lang::tr{'green'}) - { - $val=$ownnet{GREEN_NETADDRESS}."/".$ownnet{GREEN_NETMASK}; - } - if ($val eq $Lang::tr{'blue'}) - { - $val=$ownnet{BLUE_NETADDRESS}."/".$ownnet{BLUE_NETMASK}; - } - if ($val eq $Lang::tr{'orange'}) - { - $val=$ownnet{ORANGE_NETADDRESS}."/".$ownnet{ORANGE_NETMASK}; - } - my ($ip,$cidr) = split (///, $val); + } + $ccdroute2hash{$keypoint}[0]=$cgiparams{'NAME'}; + if ($cgiparams{'IFROUTE'} eq ''){$cgiparams{'IFROUTE'} = $Lang::tr{'ccd none'};} + @temp = split(/|/,$cgiparams{'IFROUTE'}); + my %ownnet=(); + &General::readhash("${General::swroot}/ethernet/settings", %ownnet); + foreach $val (@temp){ + chomp($val); + $val=~s/\s*$//g; + if ($val eq $Lang::tr{'green'}) + { + $val=$ownnet{GREEN_NETADDRESS}."/".$ownnet{GREEN_NETMASK}; + } + if ($val eq $Lang::tr{'blue'}) + { + $val=$ownnet{BLUE_NETADDRESS}."/".$ownnet{BLUE_NETMASK}; + } + if ($val eq $Lang::tr{'orange'}) + { + $val=$ownnet{ORANGE_NETADDRESS}."/".$ownnet{ORANGE_NETMASK}; + } + my ($ip,$cidr) = split (///, $val); + + if ($val ne $Lang::tr{'ccd none'}) + { if (! &check_routes_push($val)){$errormessage=$errormessage."Route $val ".$Lang::tr{'ccd err routeovpn2'}." ($val)";goto VPNCONF_ERROR;} if (! &check_ccdroute($val)){$errormessage=$errormessage."<br>Route $val ".$Lang::tr{'ccd err inuse'}." ($val)" ;goto VPNCONF_ERROR;} if (! &check_ccdconf($val)){$errormessage=$errormessage."<br>Route $val ".$Lang::tr{'ccd err routeovpn'}." ($val)";goto VPNCONF_ERROR;} @@ -3369,10 +3399,13 @@ if ($confighash{$cgiparams{'KEY'}}) { $errormessage=$errormessage."Route ".$Lang::tr{'ccd invalid'}." ($val)"; goto VPNCONF_ERROR; } - $i++; - } - &General::writehasharray("${General::swroot}/ovpn/ccdroute2", %ccdroute2hash); - } + }else{ + $ccdroute2hash{$keypoint}[$i]=''; + } + $i++; + } + &General::writehasharray("${General::swroot}/ovpn/ccdroute2", %ccdroute2hash); + #check dns1 ip if ($cgiparams{'CCD_DNS1'} ne '' && ! &General::validip($cgiparams{'CCD_DNS1'})) { $errormessage=$errormessage."<br>".$Lang::tr{'invalid input for dhcp dns'}." 1"; @@ -3388,10 +3421,10 @@ if ($confighash{$cgiparams{'KEY'}}) { $errormessage=$errormessage."<br>".$Lang::tr{'invalid input for dhcp wins'}; goto VPNCONF_ERROR; } - +}
#CCD End - + if ($cgiparams{'TYPE'} !~ /^(host|net)$/) { $errormessage = $Lang::tr{'connection type is invalid'}; @@ -3881,7 +3914,7 @@ if ($cgiparams{'TYPE'} eq 'net') { $confighash{$key}[6] = $cgiparams{'SIDE'}; $confighash{$key}[11] = $cgiparams{'REMOTE_SUBNET'}; } - $confighash{$key}[8] = $cgiparams{'LOCAL_SUBNET'}; + $confighash{$key}[8] = $cgiparams{'LOCAL_SUBNET'}; $confighash{$key}[10] = $cgiparams{'REMOTE'}; if ($cgiparams{'OVPN_MGMT'} eq '') { $confighash{$key}[22] = $confighash{$key}[29]; @@ -3905,7 +3938,7 @@ if ($cgiparams{'TYPE'} eq 'net') { $confighash{$key}[35] = $cgiparams{'CCD_DNS1'}; $confighash{$key}[36] = $cgiparams{'CCD_DNS2'}; $confighash{$key}[37] = $cgiparams{'CCD_WINS'}; - $confighash{$key}[38] = $cgiparams{'PMTU_DISCOVERY'}; + $confighash{$key}[38] = $cgiparams{'PMTU_DISCOVERY'};
&General::writehasharray("${General::swroot}/ovpn/ovpnconfig", %confighash); @@ -3927,6 +3960,7 @@ if ($cgiparams{'TYPE'} eq 'net') { print CCDRWCONF "\n#Redirect Gateway: \n#All IP traffic is redirected through the vpn \n"; print CCDRWCONF "push redirect-gateway\n"; } + &General::readhasharray("${General::swroot}/ovpn/ccdroute", %ccdroutehash); if ($cgiparams{'IR'} ne ''){ print CCDRWCONF "\n#Client routes these Networks (behind Client)\n"; foreach my $key (keys %ccdroutehash){ @@ -3938,6 +3972,7 @@ if ($cgiparams{'TYPE'} eq 'net') { } } } + if ($cgiparams{'IFROUTE'} eq $Lang::tr{'ccd none'} ){$cgiparams{'IFROUTE'}='';} if ($cgiparams{'IFROUTE'} ne ''){ print CCDRWCONF "\n#Client gets routes to these Networks (behind IPFIRE)\n"; foreach my $key (keys %ccdroute2hash){ @@ -3946,7 +3981,7 @@ if ($cgiparams{'TYPE'} eq 'net') { if($ccdroute2hash{$key}[$i] eq $Lang::tr{'blue'}){ my %blue=(); &General::readhash("${General::swroot}/ethernet/settings", %blue); - print CCDRWCONF "push "route $blue{BLUE_ADDRESS} $blue{BLUE_NETMASK}\n"; + print CCDRWCONF "push "route $blue{BLUE_ADDRESS} $blue{BLUE_NETMASK}\n"; }elsif($ccdroute2hash{$key}[$i] eq $Lang::tr{'orange'}){ my %orange=(); &General::readhash("${General::swroot}/ethernet/settings", %orange); @@ -4376,51 +4411,66 @@ END <tr><td colspan='4'><br></td></tr> <tr><td valign='top' rowspan='3'>$Lang::tr{'ccd iroute2'}</td><td align='left' valign='top' rowspan='3'><select name='IFROUTE' style="width: 205px"; size='6' multiple> END - + + my $set=0; + my $selorange=0; + my $selblue=0; + my $selgreen=0; + my $helpblue=0; + my $helporange=0; + my $other=0; + my @temp=(); + our @current = (); - open(FILE, "${General::swroot}/main/routing") ; - @current = <FILE>; - close (FILE); - &General::readhasharray ("${General::swroot}/ovpn/ccdroute2", %ccdroute2hash); - my $set=0; - my $selorange=0; - my $selblue=0; - my $helpblue=0; - my $helporange=0; - print"<option>$Lang::tr{'ccd none'}</option>"; - print"<option selected>$Lang::tr{'green'}</option>"; - - foreach my $line (@current) { - chomp($line); # remove newline - my @temp=split(/,/,$line); - $temp[1] = '' unless defined $temp[1]; # not always populated - my ($a,$b) = split(///,$temp[1]); - $temp[1] = $a."/".&General::iporsubtocidr($b); - foreach my $key (keys %ccdroute2hash) { - if($ccdroute2hash{$key}[0] eq $cgiparams{'NAME'}){ - foreach my $i (1 .. $#{$ccdroute2hash{$key}}) { - - if($ccdroute2hash{$key}[$i] eq $a."/".&General::iporsubtodec($b)){ - $set=1; - } - if (&haveBlueNet()){ - if($netsettings{'BLUE_NETADDRESS'}."/".&General::iporsubtodec($netsettings{'BLUE_NETMASK'}) eq $ccdroute2hash{$key}[$i]) { - $selblue=1; - - } - } - if (&haveOrangeNet()){ - if($netsettings{'ORANGE_NETADDRESS'}."/".&General::iporsubtodec($netsettings{'ORANGE_NETMASK'}) eq $ccdroute2hash{$key}[$i]) { - $selorange=1; - } - } - } + open(FILE, "${General::swroot}/main/routing") ; + @current = <FILE>; + close (FILE); + &General::readhasharray ("${General::swroot}/ovpn/ccdroute2", %ccdroute2hash); + print"<option>$Lang::tr{'ccd none'}</option>"; + #check if static routes are defined for client + foreach my $line (@current) { + chomp($line); + $line=~s/\s*$//g; # remove newline + @temp=split(/,/,$line); + $temp[1] = '' unless defined $temp[1]; # not always populated + my ($a,$b) = split(///,$temp[1]); + $temp[1] = $a."/".&General::iporsubtocidr($b); + foreach my $key (keys %ccdroute2hash) { + if($ccdroute2hash{$key}[0] eq $cgiparams{'NAME'}){ + foreach my $i (1 .. $#{$ccdroute2hash{$key}}) { + if($ccdroute2hash{$key}[$i] eq $a."/".&General::iporsubtodec($b)){ + $set=1; + } + } + } + } + if ($set == '1' && $#temp != -1){ print"<option selected>$temp[1]</option>";$set=0;}elsif($set == '0' && $#temp != -1){print"<option>$temp[1]</option>";} + } + #check if green,blue,orange are defined for client + foreach my $key (keys %ccdroute2hash) { + if($ccdroute2hash{$key}[0] eq $cgiparams{'NAME'}){ + $other=1; + foreach my $i (1 .. $#{$ccdroute2hash{$key}}) { + if ($ccdroute2hash{$key}[$i] eq $netsettings{'GREEN_NETADDRESS'}."/".&General::iporsubtodec($netsettings{'GREEN_NETMASK'})){ + $selgreen=1; + } + if (&haveBlueNet()){ + if( $ccdroute2hash{$key}[$i] eq $netsettings{'BLUE_NETADDRESS'}."/".&General::iporsubtodec($netsettings{'BLUE_NETMASK'})) { + $selblue=1; + } + } + if (&haveOrangeNet()){ + if( $ccdroute2hash{$key}[$i] eq $netsettings{'ORANGE_NETADDRESS'}."/".&General::iporsubtodec($netsettings{'ORANGE_NETMASK'}) ) { + $selorange=1; } } - if ($set == '1'){ print"<option selected>$temp[1]</option>";$set=0;}else{print"<option>$temp[1]</option>";} - if (&haveBlueNet() && $selblue == '1'){ print"<option selected>$Lang::tr{'blue'}</option>";$selblue=0;}elsif(&haveBlueNet() && $selblue == '0'){print"<option>$Lang::tr{'blue'}</option>";} - if (&haveOrangeNet() && $selorange == '1'){ print"<option selected>$Lang::tr{'orange'}</option>";$selorange=0;}elsif(&haveOrangeNet() && $selorange == '0'){print"<option>$Lang::tr{'orange'}</option>";} } + } + } + if (&haveBlueNet() && $selblue == '1'){ print"<option selected>$Lang::tr{'blue'}</option>";$selblue=0;}elsif(&haveBlueNet() && $selblue == '0'){print"<option>$Lang::tr{'blue'}</option>";} + if (&haveOrangeNet() && $selorange == '1'){ print"<option selected>$Lang::tr{'orange'}</option>";$selorange=0;}elsif(&haveOrangeNet() && $selorange == '0'){print"<option>$Lang::tr{'orange'}</option>";} + if ($selgreen == '1' || $other == '0'){ print"<option selected>$Lang::tr{'green'}</option>";$set=0;}else{print"<option>$Lang::tr{'green'}</option>";}; + print<<END </select></td><td valign='top'>DNS1:</td><td valign='top'><input type='TEXT' name='CCD_DNS1' value='$cgiparams{'CCD_DNS1'}' size='30' /></td></tr> <tr valign='top'><td>DNS2:</td><td><input type='TEXT' name='CCD_DNS2' value='$cgiparams{'CCD_DNS2'}' size='30' /></td></tr> diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 186e99e..7fe336c 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1612,7 +1612,7 @@ 'september' => 'September', 'serial' => 'serielle', 'server reserved' => 'The connection name server is reserved and not allowed', -'server restart' => 'Wenn hier etwas geändert wird, muss der openVPN Server neu gestartet werden, damit die Einstellungen übernommen werden!', +'server restart' => 'Änderungen können nicht gespeichert werden, solange der OpenVPN-Server läuft.', 'server string' => 'Server String', 'service' => 'Dienst', 'service added' => 'Benutzerdefinierter Netzwerkdienst wurde hinzugefügt', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 739dffa..4a2f73e 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1641,7 +1641,7 @@ 'september' => 'September', 'serial' => 'Serial', 'server reserved' => 'The connection name server is reserved and not allowed', -'server restart' => 'If you change these settings you have to restart the OpenVPN server for the changes to take effect!', +'server restart' => 'You are not able to save any changes while the OpenVPN server is running.', 'server string' => 'Server String', 'service' => 'Service', 'service added' => 'Custom network service added', diff --git a/src/scripts/ovpn-ccd-convert b/src/scripts/ovpn-ccd-convert index a406211..86b7c94 100644 --- a/src/scripts/ovpn-ccd-convert +++ b/src/scripts/ovpn-ccd-convert @@ -5,10 +5,11 @@ my %ovpnconfig=(); my @serverconf=(); my $greennet; my $greensubnet; - +my $running='off'; require '/var/ipfire/general-functions.pl';
if ( -e "/var/run/openvpn.pid"){ + $running='on'; system('/usr/local/bin/openvpnctrl', '-k'); }
@@ -41,5 +42,7 @@ foreach my $key (keys %ovpnconfig){ $ovpnconfig{$key}[32] = 'dynamic'; } &General::writehasharray("/var/ipfire/ovpn/ovpnconfig", %ovpnconfig); -system('/usr/local/bin/openvpnctrl', '-s'); - +if ($running eq 'on') +{ + system('/usr/local/bin/openvpnctrl', '-s'); +}
hooks/post-receive -- IPFire 2.x development tree