From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 5068ac3822ac9afbee841ac417963b2c1343d809
Date: Mon, 26 Nov 2012 10:32:35 +0100 [thread overview]
Message-ID: <20121126093235.67A53202CA@argus.ipfire.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 4920 bytes --]
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 5068ac3822ac9afbee841ac417963b2c1343d809 (commit)
from b368a2f84d7a99c37cf19194ffa167d30363a63d (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 5068ac3822ac9afbee841ac417963b2c1343d809
Author: Alexander Marx <amarx(a)ipfire.org>
Date: Mon Nov 26 05:45:07 2012 +0100
OpenVPN ccd: try to adapt changes to latest next branch.
-----------------------------------------------------------------------
Summary of changes:
html/cgi-bin/ovpnmain.cgi | 40 +++++++++++++++++++++++++++++++---------
langs/de/cgi-bin/de.pl | 1 +
langs/en/cgi-bin/en.pl | 1 +
3 files changed, 33 insertions(+), 9 deletions(-)
Difference in files:
diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index 9dd9011..3c090b0 100755
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -2579,6 +2579,8 @@ END
if ($cgiparams{'ACTION'} eq 'editsave'){
my ($a,$b) =split (/\|/,$cgiparams{'ccdname'});
if ( $a ne $b){ &modccdnet($a,$b);}
+ $cgiparams{'ccdname'}='';
+ $cgiparams{'ccdsubnet'}='';
}
if ($cgiparams{'ACTION'} eq $Lang::tr{'ccd add'}) {
@@ -2633,6 +2635,11 @@ END
&Header::closebox();
}
&Header::openbox('100%', 'LEFT',$Lang::tr{'ccd net'} );
+ if ( -e "/var/run/openvpn.pid"){
+ print "<b>$Lang::tr{'attention'}:</b><br>";
+ print "$Lang::tr{'ccd noaddnet'}<br><hr>";
+ }
+
print <<END
<table width='100%' border='0' cellpadding='0' cellspacing='1'>
<tr>
@@ -3303,6 +3310,8 @@ if ($cgiparams{'TYPE'} eq 'host') {
my @temp=();
my %ccdroutehash=();
my $keypoint=0;
+ my $ip;
+ my $cidr;
if ($cgiparams{'IR'} ne ''){
@temp = split("\n",$cgiparams{'IR'});
&General::readhasharray("${General::swroot}/ovpn/ccdroute", \%ccdroutehash);
@@ -3321,19 +3330,32 @@ if ($cgiparams{'TYPE'} eq 'host') {
foreach $val (@temp){
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
+ #check if iroute exists in ccdroute or if new iroute is part of an existing one
foreach my $key (keys %ccdroutehash) {
foreach my $oldiroute ( 1 .. $#{$ccdroutehash{$key}}){
- if ($ccdroutehash{$key}[$oldiroute] eq "$ip/$cidr") {
- $errormessage=$Lang::tr{'ccd err irouteexist'};
- goto VPNCONF_ERROR;
- }
+ if ($ccdroutehash{$key}[$oldiroute] eq "$val") {
+ $errormessage=$errormessage.$Lang::tr{'ccd err irouteexist'};
+ goto VPNCONF_ERROR;
+ }
+ my ($ip1,$cidr1) = split (/\//, $val);
+ my ($ip2,$cidr2) = split (/\//, $ccdroutehash{$key}[$oldiroute]);
+ if (&General::IpInSubnet ($ip1,$ip2,$cidr2)){
+ $errormessage=$errormessage.$Lang::tr{'ccd err irouteexist'};
+ goto VPNCONF_ERROR;
+ }
+
}
}
+ if (!&General::validipandmask($val)){
+ $errormessage=$errormessage."Route ".$Lang::tr{'ccd invalid'}." ($val)";
+ goto VPNCONF_ERROR;
+ }else{
+ ($ip,$cidr) = split(/\//,$val);
+ $ip=&General::getnetworkip($ip,&General::iporsubtocidr($cidr));
+ $cidr=&General::iporsubtodec($cidr);
+ $ccdroutehash{$keypoint}[$i] = $ip."/".$cidr;
+
+ }
#check for existing network IP's
if (&General::IpInSubnet ($ip,$netsettings{GREEN_NETADDRESS},$netsettings{GREEN_NETMASK}) && $netsettings{GREEN_NETADDRESS} ne '0.0.0.0')
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl
index 7fe336c..1c32fb6 100644
--- a/langs/de/cgi-bin/de.pl
+++ b/langs/de/cgi-bin/de.pl
@@ -488,6 +488,7 @@
'ccd modify' => 'Netzwerk ändern',
'ccd name' => 'Name',
'ccd net' => 'Statische IP-Adressen-Pools',
+'ccd noaddnet' => 'Neue statische Netze können erst erstellt werden, wenn der openVPN Server gestoppt wurde.',
'ccd none' => 'Keine',
'ccd routes' => 'Routen:',
'ccd subnet' => 'Subnetz',
diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl
index 4a2f73e..0a38750 100644
--- a/langs/en/cgi-bin/en.pl
+++ b/langs/en/cgi-bin/en.pl
@@ -506,6 +506,7 @@
'ccd modify' => 'Change network',
'ccd name' => 'Name',
'ccd net' => 'Static IP address pools',
+'ccd noaddnet' => 'You can only add new static networks when OpenVPN server is stopped.',
'ccd none' => 'None',
'ccd routes' => 'Routing:',
'ccd subnet' => 'Subnet',
hooks/post-receive
--
IPFire 2.x development tree
reply other threads:[~2012-11-26 9:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121126093235.67A53202CA@argus.ipfire.org \
--to=git@ipfire.org \
--cc=ipfire-scm@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox