Index: npl/syn3/webint/src/error.php
===================================================================
--- npl/syn3/webint/src/error.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/error.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -1,13 +1,13 @@
-<? 
+<?
 /** Functions to validate user input a generate apporiate messages.
  *
- * These functions will check the given parameters and return false 
+ * These functions will check the given parameters and return false
  * if everything is allright. If something is wrong it will return an
  * errorstring that explains whats wrong in the users own language.
  * @package forms
- */ 
+ */
 
 	require_once("common.php");
-	
+
 	/** Check if filename name is valid.
 	 * Returns false if its valid
@@ -27,7 +27,7 @@
 	}
 
-	
+
 	/** Check if the tcp/ip $port number is valid.
-	 * 
+	 *
 	 * Returns false if its valid.
 	 * Returns a descriptive error message if its invalid.
@@ -36,11 +36,11 @@
 	{
 		if (!$port)
-			return (_ErrorPortnumberIsRequired());	
+			return (_ErrorPortnumberIsRequired());
 		elseif (!ValidPort($port))
-			return (_ErrorPortnumberIsInvalid($port));	
-		else
-			return false;
-	}
-	
+			return (_ErrorPortnumberIsInvalid($port));
+		else
+			return false;
+	}
+
 	/** Check if the ip address $ip is valid.
 	 *
@@ -51,7 +51,7 @@
 	{
 		if (!$ip)
-			return (_ErrorIPAdressIsRequired());	
+			return (_ErrorIPAdressIsRequired());
 		elseif (!ValidIP($ip))
-			return (_ErrorIPAdressIsInvalid($ip));	
+			return (_ErrorIPAdressIsInvalid($ip));
 		else
 			return false;
@@ -66,11 +66,25 @@
 	{
 		if (!$netmask)
-			return (_ErrorNetmaskIsRequired());	
+			return (_ErrorNetmaskIsRequired());
 		elseif (!ValidNetmask($netmask))
-			return (_ErrorNetmaskIsInvalid($netmask));	
-		else
-			return false;
-	}
-
+			return (_ErrorNetmaskIsInvalid($netmask));
+		else
+			return false;
+	}
+
+    /** Check if CIDR subnet is valid. Format is 10.0.0.0/24
+	 *
+	 * Returns false if its valid.
+	 * Returns a descriptive error message if its invalid.
+	 */
+	function Error_ValidSubnet($subnet)
+	{
+		if (!$subnet)
+			return (_ErrorSubnetIsRequired());
+		elseif (!ValidSubnet($subnet))
+			return (_ErrorSubnetIsInvalid($subnet));
+		else
+			return false;
+	}
 
 	/** Check if mac is valid. Format is HEXHEX:HEXHEX:HEXHEX:HEXHEX:HEXHEX:HEXHEX
@@ -89,5 +103,5 @@
 	}
 
-		 
+
 	/** Check if hostname is valid. A hostname has a minimum of 1 field.
 	 *
@@ -98,7 +112,7 @@
 	{
 		if (!$hostname)
-			return (_ErrorHostnameIsRequired());	
+			return (_ErrorHostnameIsRequired());
 		elseif (!ValidHostname($hostname))
-			return (_ErrorHostnameIsInvalid($hostname));	
+			return (_ErrorHostnameIsInvalid($hostname));
 		else
 			return false;
@@ -113,12 +127,12 @@
 	{
 		if (!$hostname)
-			return (_ErrorFQDNIsRequired());	
+			return (_ErrorFQDNIsRequired());
 		elseif (!ValidFQDN($hostname))
-			return (_ErrorFQDNIsInvalid($hostname));	
-		else
-			return false;
-	}
-
-		 
+			return (_ErrorFQDNIsInvalid($hostname));
+		else
+			return false;
+	}
+
+
 	/** Check if $address is a valid hostname OR ip adress.
 	 *
@@ -131,5 +145,5 @@
 			return (_ErrorHostnameOrIpAddressIsRequired());
 		elseif (!ValidHostname($address) && !ValidIp($address))
-			return (_ErrorInvalidHostnameOrIpAddress($address));	
+			return (_ErrorInvalidHostnameOrIpAddress($address));
 		else
 			return false;
@@ -144,12 +158,12 @@
 	{
 		if (!$domain)
-			return (_ErrorDomainIsRequired());	
+			return (_ErrorDomainIsRequired());
 		elseif (!ValidDomain($domain))
-			return (_ErrorDomainIsInvalid($domain));	
-		else
-			return false;
-	}
-
-	
+			return (_ErrorDomainIsInvalid($domain));
+		else
+			return false;
+	}
+
+
 	/** Check if $address:$port is actually connectable.
 	 *
@@ -163,5 +177,5 @@
 		if ($err)
 			return $err;
-	
+
 		$err=TestConnect($address,$port,$timeout);
 		if ($err)
@@ -170,5 +184,5 @@
 			return false;
 	}
-	
+
 	/** Check if email adress is valid.
 	 *
@@ -178,8 +192,8 @@
 	function Error_ValidEmail($address)
 	{
-		preg_match("/(.*)\@(.*)/",$address,$matches);	
+		preg_match("/(.*)\@(.*)/",$address,$matches);
 		$name=$matches[1];
 		$domain=$matches[2];
-		
+
 		if (!$domain)
 			return (_ErrorEmailAddressIsRequired());
@@ -187,5 +201,5 @@
 			return (_ErrorInvalidMailDomain($domain));
 		elseif (!ValidEmail($address))
-			return (_ErrorInvalidEmailAddress($address));	
+			return (_ErrorInvalidEmailAddress($address));
 		else
 			return false;
@@ -200,11 +214,11 @@
 	{
 		if (!$share)
-			return (_ErrorSharenameIsRequired());	
+			return (_ErrorSharenameIsRequired());
 		elseif (!ValidSmbShareName($share))
-			return (_ErrorSharenameIsInvalid($share));	
-		else
-			return false;
-	}
-	
+			return (_ErrorSharenameIsInvalid($share));
+		else
+			return false;
+	}
+
 	/** Check if $integer is a valid number between $min and $max inclusive
 	 *
@@ -222,9 +236,9 @@
 		elseif(is_numeric($max) && $integer>$max)
 			return(_ErrorIntToHigh($max));
-		else 
-			return false;
-		
-	}
-	
+		else
+			return false;
+
+	}
+
 	/** Check if $choice exists in the $choices hash array
 	 *
@@ -236,6 +250,5 @@
 		if(! isset($choices[$choice]))
 			return (_ErrorValidChoiceIsRequired());
-		else 
-			return false;
-	}
-	
+		else
+			return false;
+	}
Index: npl/syn3/webint/src/lang_de.php
===================================================================
--- npl/syn3/webint/src/lang_de.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_de.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -125,9 +125,9 @@
 
 function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { return (
-	"_ErrorFilenameIsInvalid($a,$b,$c,$d)"
+	"Filename has invalid characters"
 );}
 
 function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { return (
-	"_ErrorFilenameIsRequired($a,$b,$c,$d)"
+	"Enter filename"
 );}
 
@@ -244,4 +244,12 @@
 );}
 
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { return (
+	"Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { return (
+	"Subnet is required (in CIRD form)"
+);}
+
 function _ErrorValidChoiceIsRequired($a="",$b="",$c="",$d="") { return (
 	"You need to make a valid choice!"
Index: npl/syn3/webint/src/lang_deD.php
===================================================================
--- npl/syn3/webint/src/lang_deD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_deD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -124,10 +124,10 @@
 );}
 
-function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { LangDebug("_ErrorFilenameIsInvalid($a,$b,$c,$d)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_ErrorFilenameIsInvalid");return (
-	"_ErrorFilenameIsInvalid($a,$b,$c,$d)"
-);}
-
-function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("_ErrorFilenameIsRequired($a,$b,$c,$d)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_ErrorFilenameIsRequired");return (
-	"_ErrorFilenameIsRequired($a,$b,$c,$d)"
+function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { LangDebug("Filename has invalid characters", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_ErrorFilenameIsInvalid");return (
+	"Filename has invalid characters"
+);}
+
+function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("Enter filename", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_ErrorFilenameIsRequired");return (
+	"Enter filename"
 );}
 
@@ -244,4 +244,12 @@
 );}
 
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { LangDebug("Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_ErrorSubnetIsInvalid");return (
+	"Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { LangDebug("Subnet is required (in CIRD form)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_ErrorSubnetIsRequired");return (
+	"Subnet is required (in CIRD form)"
+);}
+
 function _ErrorValidChoiceIsRequired($a="",$b="",$c="",$d="") { LangDebug("You need to make a valid choice!", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_ErrorValidChoiceIsRequired");return (
 	"You need to make a valid choice!"
Index: npl/syn3/webint/src/lang_en.php
===================================================================
--- npl/syn3/webint/src/lang_en.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_en.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -125,9 +125,9 @@
 
 function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { return (
-	"_ErrorFilenameIsInvalid($a,$b,$c,$d)"
+	"Filename has invalid characters"
 );}
 
 function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { return (
-	"_ErrorFilenameIsRequired($a,$b,$c,$d)"
+	"Enter filename"
 );}
 
@@ -242,4 +242,12 @@
 function _ErrorSharenameIsRequired($a="",$b="",$c="",$d="") { return (
 	"Enter a share name."
+);}
+
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { return (
+	"Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { return (
+	"Subnet is required (in CIRD form)"
 );}
 
Index: npl/syn3/webint/src/lang_enD.php
===================================================================
--- npl/syn3/webint/src/lang_enD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_enD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -124,10 +124,10 @@
 );}
 
-function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { LangDebug("_ErrorFilenameIsInvalid($a,$b,$c,$d)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=en&add_labelID=_ErrorFilenameIsInvalid");return (
-	"_ErrorFilenameIsInvalid($a,$b,$c,$d)"
-);}
-
-function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("_ErrorFilenameIsRequired($a,$b,$c,$d)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=en&add_labelID=_ErrorFilenameIsRequired");return (
-	"_ErrorFilenameIsRequired($a,$b,$c,$d)"
+function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { LangDebug("Filename has invalid characters", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8319");return (
+	"Filename has invalid characters"
+);}
+
+function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("Enter filename", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8320");return (
+	"Enter filename"
 );}
 
@@ -242,4 +242,12 @@
 function _ErrorSharenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("Enter a share name.", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=1082");return (
 	"Enter a share name."
+);}
+
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { LangDebug("Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8322");return (
+	"Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { LangDebug("Subnet is required (in CIRD form)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8321");return (
+	"Subnet is required (in CIRD form)"
 );}
 
Index: npl/syn3/webint/src/lang_nl.php
===================================================================
--- npl/syn3/webint/src/lang_nl.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_nl.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -244,4 +244,12 @@
 );}
 
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { return (
+	"Subnet is ongeldig (gebruik CIDR vorm, bijv. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { return (
+	"Subnet is vereist. (in CIDR vorm)"
+);}
+
 function _ErrorValidChoiceIsRequired($a="",$b="",$c="",$d="") { return (
 	"U moet een geldig keus maken!"
Index: npl/syn3/webint/src/lang_nlD.php
===================================================================
--- npl/syn3/webint/src/lang_nlD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_nlD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -244,4 +244,12 @@
 );}
 
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { LangDebug("Subnet is ongeldig (gebruik CIDR vorm, bijv. 10.0.0.0/24)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8307");return (
+	"Subnet is ongeldig (gebruik CIDR vorm, bijv. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { LangDebug("Subnet is vereist. (in CIDR vorm)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8308");return (
+	"Subnet is vereist. (in CIDR vorm)"
+);}
+
 function _ErrorValidChoiceIsRequired($a="",$b="",$c="",$d="") { LangDebug("U moet een geldig keus maken!", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=5426");return (
 	"U moet een geldig keus maken!"
Index: npl/syn3/webint/src/lang_pl.php
===================================================================
--- npl/syn3/webint/src/lang_pl.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_pl.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -126,9 +126,9 @@
 
 function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { return (
-	"_ErrorFilenameIsInvalid($a,$b,$c,$d)"
+	"Filename has invalid characters"
 );}
 
 function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { return (
-	"_ErrorFilenameIsRequired($a,$b,$c,$d)"
+	"Enter filename"
 );}
 
@@ -245,4 +245,12 @@
 );}
 
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { return (
+	"Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { return (
+	"Subnet is required (in CIRD form)"
+);}
+
 function _ErrorValidChoiceIsRequired($a="",$b="",$c="",$d="") { return (
 	"You need to make a valid choice!"
Index: npl/syn3/webint/src/lang_plD.php
===================================================================
--- npl/syn3/webint/src/lang_plD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_plD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -126,10 +126,10 @@
 );}
 
-function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { LangDebug("_ErrorFilenameIsInvalid($a,$b,$c,$d)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_ErrorFilenameIsInvalid");return (
-	"_ErrorFilenameIsInvalid($a,$b,$c,$d)"
-);}
-
-function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("_ErrorFilenameIsRequired($a,$b,$c,$d)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_ErrorFilenameIsRequired");return (
-	"_ErrorFilenameIsRequired($a,$b,$c,$d)"
+function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { LangDebug("Filename has invalid characters", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_ErrorFilenameIsInvalid");return (
+	"Filename has invalid characters"
+);}
+
+function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("Enter filename", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_ErrorFilenameIsRequired");return (
+	"Enter filename"
 );}
 
@@ -246,4 +246,12 @@
 );}
 
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { LangDebug("Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_ErrorSubnetIsInvalid");return (
+	"Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { LangDebug("Subnet is required (in CIRD form)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_ErrorSubnetIsRequired");return (
+	"Subnet is required (in CIRD form)"
+);}
+
 function _ErrorValidChoiceIsRequired($a="",$b="",$c="",$d="") { LangDebug("You need to make a valid choice!", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_ErrorValidChoiceIsRequired");return (
 	"You need to make a valid choice!"
Index: npl/syn3/webint/src/lang_pt.php
===================================================================
--- npl/syn3/webint/src/lang_pt.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_pt.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -125,9 +125,9 @@
 
 function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { return (
-	"_ErrorFilenameIsInvalid($a,$b,$c,$d)"
+	"Filename has invalid characters"
 );}
 
 function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { return (
-	"_ErrorFilenameIsRequired($a,$b,$c,$d)"
+	"Enter filename"
 );}
 
@@ -242,4 +242,12 @@
 function _ErrorSharenameIsRequired($a="",$b="",$c="",$d="") { return (
 	"Enter a share name."
+);}
+
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { return (
+	"Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { return (
+	"Subnet is required (in CIRD form)"
 );}
 
Index: npl/syn3/webint/src/lang_ptD.php
===================================================================
--- npl/syn3/webint/src/lang_ptD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/lang_ptD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -124,10 +124,10 @@
 );}
 
-function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { LangDebug("_ErrorFilenameIsInvalid($a,$b,$c,$d)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_ErrorFilenameIsInvalid");return (
-	"_ErrorFilenameIsInvalid($a,$b,$c,$d)"
-);}
-
-function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("_ErrorFilenameIsRequired($a,$b,$c,$d)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_ErrorFilenameIsRequired");return (
-	"_ErrorFilenameIsRequired($a,$b,$c,$d)"
+function _ErrorFilenameIsInvalid($a="",$b="",$c="",$d="") { LangDebug("Filename has invalid characters", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_ErrorFilenameIsInvalid");return (
+	"Filename has invalid characters"
+);}
+
+function _ErrorFilenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("Enter filename", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_ErrorFilenameIsRequired");return (
+	"Enter filename"
 );}
 
@@ -242,4 +242,12 @@
 function _ErrorSharenameIsRequired($a="",$b="",$c="",$d="") { LangDebug("Enter a share name.", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_ErrorSharenameIsRequired");return (
 	"Enter a share name."
+);}
+
+function _ErrorSubnetIsInvalid($a="",$b="",$c="",$d="") { LangDebug("Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_ErrorSubnetIsInvalid");return (
+	"Invalid subnet (use CIDR format, e.g. 10.0.0.0/24)"
+);}
+
+function _ErrorSubnetIsRequired($a="",$b="",$c="",$d="") { LangDebug("Subnet is required (in CIRD form)", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_ErrorSubnetIsRequired");return (
+	"Subnet is required (in CIRD form)"
 );}
 
Index: npl/syn3/webint/src/openvpn/editsettings.php
===================================================================
--- npl/syn3/webint/src/openvpn/editsettings.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/editsettings.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -74,4 +74,58 @@
 
 
+echo "<tr><td>";
+echo _OpenVPNRouteMode();
+echo "<td>";
+
+form_FieldRadio(array(
+	"name"		=>"ROUTE_MODE",
+	"value"		=>$fields["ROUTE_MODE"],
+	"errors"	=>$errors,
+	"radiovalue"=>"all",
+	"autosubmit"=>"1"
+));
+echo _OpenVPNRouteModeAll();
+echo "<br>";
+
+form_FieldRadio(array(
+	"name"		=>"ROUTE_MODE",
+	"value"		=>$fields["ROUTE_MODE"],
+	"errors"	=>$errors,
+	"radiovalue"=>"subnet",
+	"autosubmit"=>"1"
+));
+echo _OpenVPNRouteModeSubnet();
+
+echo "</tr>";
+
+
+if ($fields['ROUTE_MODE']=="subnet")
+{
+    echo "<tr><td>";
+    echo _OpenVPNSubnetToRoute();
+    echo "<td>";
+    form_FieldText(array(
+    	"name"		=>"SUBNET",
+    	"value"		=>$fields[SUBNET],
+    	"errors"	=>$errors,
+    	"error"		=>"",
+    	"disabled"	=>0,
+    	"length"	=>30
+    ));
+    echo "</tr>";
+}
+
+echo "<tr><td>";
+echo _OpenVPNPushDNS();
+echo "<td>";
+form_FieldText(array(
+    "name"		=>"PUSH_DNS",
+    "value"		=>$fields[PUSH_DNS],
+    "errors"	=>$errors,
+    "error"		=>"",
+    "disabled"	=>0,
+    "length"	=>30
+));
+echo "</tr>";
 
 echo "</table>";
Index: npl/syn3/webint/src/openvpn/lang_de.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_de.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_de.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { return (
+	"DNS server for clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { return (
+	"Routing mode"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { return (
+	"Route all internet traffic via server"
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { return (
+	"Route a specific subnet"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { return (
+	"Routing subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/lang_deD.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_deD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_deD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { LangDebug("DNS server for clients", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_OpenVPNPushDNS");return (
+	"DNS server for clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { LangDebug("Routing mode", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_OpenVPNRouteMode");return (
+	"Routing mode"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { LangDebug("Route all internet traffic via server", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_OpenVPNRouteModeAll");return (
+	"Route all internet traffic via server"
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { LangDebug("Route a specific subnet", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_OpenVPNRouteModeSubnet");return (
+	"Route a specific subnet"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { LangDebug("OpenVPN server host", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_OpenVPNServerHost");return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { LangDebug("Routing subnet", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_OpenVPNSubnetToRoute");return (
+	"Routing subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { LangDebug("Client IP", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=de&add_labelID=_RemoteIP");return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/lang_en.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_en.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_en.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { return (
+	"DNS server for clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { return (
+	"Routing mode"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { return (
+	"Route all internet traffic via server"
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { return (
+	"Route a specific subnet"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { return (
+	"Routing subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/lang_enD.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_enD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_enD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { LangDebug("DNS server for clients", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8314");return (
+	"DNS server for clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { LangDebug("Routing mode", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8315");return (
+	"Routing mode"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { LangDebug("Route all internet traffic via server", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8318");return (
+	"Route all internet traffic via server"
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { LangDebug("Route a specific subnet", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8317");return (
+	"Route a specific subnet"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { LangDebug("OpenVPN server host", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8290");return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { LangDebug("Routing subnet", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8316");return (
+	"Routing subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { LangDebug("Client IP", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8294");return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/lang_nl.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_nl.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_nl.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { return (
+	"DNS server voor clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { return (
+	"Routing modus"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { return (
+	"Routeer al het internet verkeer via de server."
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { return (
+	"Routeer alleen een bepaald subnet naar de server"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { return (
+	"Routering subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/lang_nlD.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_nlD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_nlD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { LangDebug("DNS server voor clients", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8309");return (
+	"DNS server voor clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { LangDebug("Routing modus", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8310");return (
+	"Routing modus"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { LangDebug("Routeer al het internet verkeer via de server.", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8311");return (
+	"Routeer al het internet verkeer via de server."
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { LangDebug("Routeer alleen een bepaald subnet naar de server", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8312");return (
+	"Routeer alleen een bepaald subnet naar de server"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { LangDebug("OpenVPN server host", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8274");return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { LangDebug("Routering subnet", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8313");return (
+	"Routering subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { LangDebug("Client IP", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?edit_ID=8278");return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/lang_pl.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_pl.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_pl.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { return (
+	"DNS server for clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { return (
+	"Routing mode"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { return (
+	"Route all internet traffic via server"
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { return (
+	"Route a specific subnet"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { return (
+	"Routing subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/lang_plD.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_plD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_plD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { LangDebug("DNS server for clients", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_OpenVPNPushDNS");return (
+	"DNS server for clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { LangDebug("Routing mode", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_OpenVPNRouteMode");return (
+	"Routing mode"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { LangDebug("Route all internet traffic via server", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_OpenVPNRouteModeAll");return (
+	"Route all internet traffic via server"
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { LangDebug("Route a specific subnet", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_OpenVPNRouteModeSubnet");return (
+	"Route a specific subnet"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { LangDebug("OpenVPN server host", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_OpenVPNServerHost");return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { LangDebug("Routing subnet", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_OpenVPNSubnetToRoute");return (
+	"Routing subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { LangDebug("Client IP", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pl&add_labelID=_RemoteIP");return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/lang_pt.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_pt.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_pt.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { return (
+	"DNS server for clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { return (
+	"Routing mode"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { return (
+	"Route all internet traffic via server"
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { return (
+	"Route a specific subnet"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { return (
+	"Routing subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/lang_ptD.php
===================================================================
--- npl/syn3/webint/src/openvpn/lang_ptD.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/lang_ptD.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -64,4 +64,20 @@
 );}
 
+function _OpenVPNPushDNS($a="",$b="",$c="",$d="") { LangDebug("DNS server for clients", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_OpenVPNPushDNS");return (
+	"DNS server for clients"
+);}
+
+function _OpenVPNRouteMode($a="",$b="",$c="",$d="") { LangDebug("Routing mode", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_OpenVPNRouteMode");return (
+	"Routing mode"
+);}
+
+function _OpenVPNRouteModeAll($a="",$b="",$c="",$d="") { LangDebug("Route all internet traffic via server", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_OpenVPNRouteModeAll");return (
+	"Route all internet traffic via server"
+);}
+
+function _OpenVPNRouteModeSubnet($a="",$b="",$c="",$d="") { LangDebug("Route a specific subnet", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_OpenVPNRouteModeSubnet");return (
+	"Route a specific subnet"
+);}
+
 function _OpenVPNServerHost($a="",$b="",$c="",$d="") { LangDebug("OpenVPN server host", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_OpenVPNServerHost");return (
 	"OpenVPN server host"
@@ -80,4 +96,8 @@
 );}
 
+function _OpenVPNSubnetToRoute($a="",$b="",$c="",$d="") { LangDebug("Routing subnet", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_OpenVPNSubnetToRoute");return (
+	"Routing subnet"
+);}
+
 function _RemoteIP($a="",$b="",$c="",$d="") { LangDebug("Client IP", "http://www.syn-3.nl/mosaddphp/translate/editlang.php?src_lang=en&add_langID=pt&add_labelID=_RemoteIP");return (
 	"Client IP"
Index: npl/syn3/webint/src/openvpn/model.php
===================================================================
--- npl/syn3/webint/src/openvpn/model.php	(revision 55d876df6802f2ce82ec17867c9215ef710b2cbc)
+++ npl/syn3/webint/src/openvpn/model.php	(revision 577e6d3b0bac3a6dd223d5825716b89ed624cc2f)
@@ -54,6 +54,43 @@
 		return (array("SERVER"=>_InvalidHostname()));
 
+
 	FileWriteSettings("/etc/openvpn/syn3.conf", $data);
-	LogInfo(_OpenVPNSettingsChanged());
+
+    //generate additional config settings
+    $cfg=Array();
+    $cfg[]="### Additional SYN-3 OpenVPN settings";
+    $cfg[]="# will be overwritten when settings are saved in SCC";
+
+    if ($data['ROUTE_MODE']=="all")
+        $cfg[]="push 'redirect-gateway'";
+    else
+    {
+        if ($data['SUBNET'])
+        {
+            $err=Error_ValidSubnet($data['SUBNET']);
+            if ($err)
+                return (array("SUBNET"=>$err));
+
+            list($ip,$bits)=explode("/", $data['SUBNET']);
+            $netmask=CalcMask($bits);
+            $cfg[]="push 'route $ip $netmask'";
+        }
+    }
+
+    if ($data['PUSH_DNS']!="")
+    {
+        $err=Error_ValidIP($data['PUSH_DNS']);
+        if ($err)
+            return (array("PUSH_DNS"=>$err));
+
+        $cfg[]="push 'dhcp-option DNS ".$data['PUSH_DNS']."'";
+    }
+
+
+    FileWrite("/etc/openvpn/openvpn_syn3.conf",$cfg);
+    LogInfo(_OpenVPNSettingsChanged());
+
+    SvcRestart("openvpn");
+
 }
 
