diff --git a/install/tpl/nginx_apps.vhost.master b/install/tpl/nginx_apps.vhost.master index 57a78bca2a54c184624d3463a25480b4a64fa2ce..c2d2aa0b4ed919057dff3458197f40b9143bfbc5 100644 --- a/install/tpl/nginx_apps.vhost.master +++ b/install/tpl/nginx_apps.vhost.master @@ -1,5 +1,12 @@ server { listen {apps_vhost_ip}{apps_vhost_port}; + ssl {ssl_on}; + {ssl_comment}ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + {ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt; + {ssl_comment}ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key; + + # redirect to https if accessed with http + {ssl_comment}error_page 497 https://$host:{vhost_port}$request_uri; server_name {apps_vhost_servername}; @@ -199,4 +206,4 @@ server { alias /var/lib/mailman/archives/public; autoindex on; } -} \ No newline at end of file +} diff --git a/interface/lib/classes/validate_database.inc.php b/interface/lib/classes/validate_database.inc.php index e348afe62c2dd1021ed4f318213dd6b24ab67e1a..b12405f2b26053abcc16b877916e4d94f8cf6eb1 100644 --- a/interface/lib/classes/validate_database.inc.php +++ b/interface/lib/classes/validate_database.inc.php @@ -42,19 +42,19 @@ class validate_database { $values = explode(",", $field_value); foreach($values as $cur_value) { $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("/^((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) - $valid=false; + if(function_exists('filter_var')) { + if(!filter_var($field_value, FILTER_VALIDATE_IP)) { + $valid = false; } } else { - $valid = false; + if( + !preg_match("/^[0-9a-f]{1,4}:([0-9a-f]{0,4}:){1,6}[0-9a-f]{1,4}$/", $cur_value) + && + !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)) { + $valid = false; + } } - if($valid == false) { $errmsg = $validator['errmsg']; if(isset($app->tform->wordbook[$errmsg])) { diff --git a/server/scripts/update_from_dev.sh b/server/scripts/update_from_dev.sh index 12f62aac77cdda36e5c52cc701c43d5cdfc59be9..98adb170834110ba8d3e07fa8343c4db22c97967 100644 --- a/server/scripts/update_from_dev.sh +++ b/server/scripts/update_from_dev.sh @@ -1,15 +1,17 @@ #!/bin/bash cd /tmp +rm -f ispconfig3-dev.tar.gz wget -O ispconfig3-dev.tar.gz "http://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=master" +rm -rf ispconfig3-master* tar xzf ispconfig3-dev.tar.gz -cd ispconfig3.git/install +cd ispconfig3-master*/install php -q \ -d disable_classes= \ -d disable_functions= \ -d open_basedir= \ update.php cd /tmp -rm -rf /tmp/ispconfig3.git /tmp/ispconfig3-dev.tar.gz +rm -rf /tmp/ispconfig3-master* /tmp/ispconfig3-dev.tar.gz -exit 0 \ No newline at end of file +exit 0