Commit eb1177f6 authored by Marius Cramer's avatar Marius Cramer
Browse files

Merge branch 'master' into 'master'

Master

See merge request !221
parents 8a77a74e 2df8c0b8
......@@ -186,7 +186,8 @@ class functions {
global $app;
if($type == 'IPv4'){
$regex = "/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/";
// $regex = "/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/";
$regex = "/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/";
} else {
// IPv6
$regex = "/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i";
......
......@@ -1058,11 +1058,10 @@ class tform_base {
}
break;
case 'ISIPV4':
$vip=1;
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
// if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
if(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $field_value)){
$groups=explode(".", $field_value);
foreach($groups as $group){
if($group<0 or $group>255)
......@@ -1078,6 +1077,7 @@ class tform_base {
}
}
break;
case 'ISIP':
if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n';
if($validator['allowempty'] == 'y' && $field_value == '') {
......@@ -1107,7 +1107,8 @@ class tform_base {
if(preg_match("/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i", $field_value)){
$ip_ok = 1;
}
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
// if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
if(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $field_value)){
$ip_ok = 1;
}
if($ip_ok == 0) {
......
......@@ -44,7 +44,8 @@ class validate_database {
$cur_value = trim($cur_value);
$valid = true;
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $cur_value)) {
// if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $cur_value)) {
if(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $cur_value)) {
$groups = explode(".", $cur_value);
foreach($groups as $group){
if($group<0 or $group>255)
......
......@@ -315,7 +315,8 @@ class validate_dns {
if(preg_match("/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i", $field_value)){
$ip_ok = 1;
}
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
// if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
if(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $field_value)){
$ip_ok = 1;
}
if($ip_ok == 0) {
......
......@@ -28,8 +28,8 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$form["title"] = "IP Addresse mapping";
$form["description"] = "";
$form["title"] = "IPv4 Address mapping";
$form["description"] = "Form to map IPv4-addresses for Web-Server";
$form["name"] = "server_ip_map";
$form["action"] = "server_ip_map_edit.php";
$form["db_table"] = "server_ip_map";
......
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Aktiv';
$wb["ip_error_wrong"] = 'Die neue IP ist ungueltig';
$wb["destination_ip_empty"] = 'Die neue IP ist leer.';
$wb["source_ip_empty"] = 'Die eigentliche IP ist leer.';
$wb["server_empty_error"] = 'Der Server ist leer.';
$wb["duplicate_mapping_error"] = "Mapping existiert bereits.";
$wb["duplicate_mapping_error"] = "Die eigentliche IP darf keine IP des Rewrite-Servers sein.";
$wb["ip_mapping_error"] = "Die eigentliche IP darf keine IP des Rewrite-Servers sein.";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment