From 37b29231e47a0c4458dc1c15d98588f16f07e1e2 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 06 Aug 2015 03:18:44 -0400
Subject: [PATCH] - don't set password via remoting if field is empty

---
 interface/web/admin/form/server_config.tform.php |  532 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 423 insertions(+), 109 deletions(-)

diff --git a/interface/web/admin/form/server_config.tform.php b/interface/web/admin/form/server_config.tform.php
index 5b270c6..6b00e18 100644
--- a/interface/web/admin/form/server_config.tform.php
+++ b/interface/web/admin/form/server_config.tform.php
@@ -128,8 +128,11 @@
 				2 => array( 'event' => 'SAVE',
 					'type' => 'TOLOWER')
 			),
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'hostname_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+												'errmsg' => 'hostname_error_empty'),
+									1 => array ('type' => 'REGEX',
+												'regex' => '/^[\w\.\-]{2,255}\.[a-zA-Z0-9\-]{2,30}$/',
+												'errmsg'=> 'hostname_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -166,8 +169,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '/var/backup',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'backup_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'backup_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'backup_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -176,16 +182,8 @@
 		'backup_dir_is_mount' => array(
 			'datatype' => 'VARCHAR',
 			'formtype' => 'CHECKBOX',
-			'default' => 'n',
+			'default' => 'y',
 			'value' => array(0 => 'n', 1 => 'y')
-		),
-		'backup_dir_mount_cmd' => array(
-			'datatype' => 'VARCHAR',
-			'formtype' => 'TEXT',
-			'default' => '',
-			'value' => '',
-			'width' => '40',
-			'maxlength' => '255'
 		),
 		'backup_mode' => array(
 			'datatype' => 'VARCHAR',
@@ -257,6 +255,12 @@
 			'width' => '40',
 			'maxlength' => '255'
 		),
+		'monitor_system_updates' => array(
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default' => 'y',
+			'value' => array(0 => 'n', 1 => 'y')
+		),
 		//#################################
 		// ENDE Datatable fields
 		//#################################
@@ -281,19 +285,31 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '/home/vmail/[domain]/[localpart]/',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'maildir_path_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'maildir_path_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]]{5,128}$/',
+										'errmsg'=> 'maildir_path_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
 			'maxlength' => '255'
 		),
+		'maildir_format' => array(
+			'datatype' => 'VARCHAR',
+			'formtype' => 'SELECT',
+			'default' => '20',
+			'value' => array('maildir' => 'Maildir', 'mdbox' => 'mdbox')
+		),
 		'homedir_path' => array(
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '/home/vmail/',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'homedir_path_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'homedir_path_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'homedir_path_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -306,6 +322,12 @@
 			'value' => '',
 			'width' => '40',
 			'maxlength' => '255'
+		),
+		'dkim_strength' => array(
+			'datatype' => 'INTEGER',
+			'formtype' => 'SELECT',
+			'default' => '2048',
+			'value' => array('1024' => 'weak (1024)', '2048' => 'normal (2048)', '4096' => 'strong (4096)')
 		),
         'relayhost_password' => array(
             'datatype' => 'VARCHAR',
@@ -332,8 +354,11 @@
 			'datatype' => 'INTEGER',
 			'formtype' => 'TEXT',
 			'default' => '5000',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'mailuser_uid_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'mailuser_uid_error_empty'),
+									1 => array('type' => 'RANGE',
+										'range' => '1999:',
+										'errmsg' => 'mailuser_uid_error_range'),
 			),
 			'value' => '',
 			'width' => '10',
@@ -343,8 +368,11 @@
 			'datatype' => 'INTEGER',
 			'formtype' => 'TEXT',
 			'default' => '5000',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'mailuser_gid_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'mailuser_gid_error_empty'),
+									1 => array('type' => 'RANGE',
+										'range' => '1999:',
+										'errmsg' => 'mailuser_gid_error_range'),
 			),
 			'value' => '',
 			'width' => '10',
@@ -354,8 +382,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => 'vmail',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'mailuser_name_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'mailuser_name_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^(?!ispconfig|root)([a-zA-Z0-9]{1,20})$/',
+										'errmsg'=> 'mailuser_name_error_regex'),
 			),
 			'value' => '',
 			'width' => '10',
@@ -365,8 +396,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => 'vmail',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'mailuser_group_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'mailuser_group_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^(?!ispconfig|root)([a-zA-Z0-9]{1,20})$/',
+										'errmsg'=> 'mailuser_group_name_error_regex'),
 			),
 			'value' => '',
 			'width' => '10',
@@ -375,6 +409,10 @@
 		'mailbox_virtual_uidgid_maps' => array(
 			'datatype' => 'VARCHAR',
 			'formtype' => 'CHECKBOX',
+			'validators' => array (0 => array ( 'type' => 'CUSTOM',
+					'class' => 'validate_server_mail_config',
+					'function' => 'mailbox_virtual_uidgid_maps'),
+			),
 			'default' => 'n',
 			'value' => array(0 => 'n', 1 => 'y')
 		),
@@ -401,6 +439,12 @@
 			'value' => '',
 			'width' => '40',
 			'maxlength' => '255'
+		),
+		'reject_sender_login_mismatch' => array (
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default' => 'n',
+			'value' => array(0 => 'n', 1 => 'y')
 		),
 		'mailbox_size_limit' => array(
 			'datatype' => 'INTEGER',
@@ -480,8 +524,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'getmail_config_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'getmail_config_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'getmail_config_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -511,8 +558,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'website_basedir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'website_basedir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'website_basedir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -522,8 +572,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'website_path_error_empty'),
+			'validators' => array(	0 => array(	'type' => 'NOTEMPTY',
+										'errmsg' => 'website_path_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]]{5,128}$/',
+										'errmsg'=> 'website_path_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -533,14 +586,23 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'website_symlinks_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'website_symlinks_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]\:]{5,128}$/',
+										'errmsg'=> 'website_symlinks_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
 			'maxlength' => '255'
 		),
 		'website_symlinks_rel' => array (
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default' => 'n',
+			'value' => array(0 => 'n', 1 => 'y')
+		),
+		'network_filesystem' => array (
 			'datatype' => 'VARCHAR',
 			'formtype' => 'CHECKBOX',
 			'default' => 'n',
@@ -554,20 +616,21 @@
 			'width' => '40',
 			'maxlength' => '255'
 		),
-		/*
-'vhost_rewrite_v6' => array (
-'datatype' => 'VARCHAR',
-'formtype' => 'CHECKBOX',
-'default' => 'n',
-'value' => array(0 => 'n',1 => 'y')
-),
-*/
+		'vhost_rewrite_v6' => array (
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default' => 'n',
+			'value' => array(0 => 'n',1 => 'y')
+		),
 		'vhost_conf_dir' => array(
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'vhost_conf_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'vhost_conf_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'vhost_conf_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -577,8 +640,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'vhost_conf_enabled_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'vhost_conf_enabled_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'vhost_conf_enabled_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -588,8 +654,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'nginx_vhost_conf_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'nginx_vhost_conf_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'nginx_vhost_conf_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -599,8 +668,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'nginx_vhost_conf_enabled_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'nginx_vhost_conf_enabled_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'nginx_vhost_conf_enabled_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -609,6 +681,10 @@
 		'CA_path' => array(
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
+			'validators' => array(	0 => array ( 	'type' => 'REGEX',
+										'regex' => '/^[a-zA-Z0-9\.\-\_\/]{0,128}$/',
+										'errmsg'=> 'ca_path_error_regex'),
+			),
 			'default' => '',
 			'value' => '',
 			'width' => '40',
@@ -688,6 +764,18 @@
 			'default' => 'y',
 			'value' => array(0 => 'n', 1 => 'y')
 		),
+		'overquota_db_notify_admin' => array(
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default' => 'y',
+			'value' => array(0 => 'n', 1 => 'y')
+		),
+		'overquota_db_notify_client' => array(
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default' => 'y',
+			'value' => array(0 => 'n', 1 => 'y')
+		),
 		'overquota_notify_freq' => array(
 			'datatype' => 'INTEGER',
 			'formtype' => 'TEXT',
@@ -708,6 +796,13 @@
 			'default' => '',
 			'validators' => array(0 => array('type' => 'NOTEMPTY',
 					'errmsg' => 'apache_user_error_empty'),
+					1 => array(
+							'type' => 'CUSTOM',
+							'class' => 'validate_systemuser',
+							'function' => 'check_sysuser',
+							'check_names' => false,
+							'errmsg' => 'invalid_apache_user_txt'
+						),
 			),
 			'value' => '',
 			'width' => '40',
@@ -719,6 +814,13 @@
 			'default' => '',
 			'validators' => array(0 => array('type' => 'NOTEMPTY',
 					'errmsg' => 'apache_group_error_empty'),
+					1 => array(
+							'type' => 'CUSTOM',
+							'class' => 'validate_systemuser',
+							'function' => 'check_sysgroup',
+							'check_names' => false,
+							'errmsg' => 'invalid_apache_group_txt'
+						),
 			),
 			'value' => '',
 			'width' => '40',
@@ -745,8 +847,15 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'nginx_user_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'nginx_user_error_empty'),
+									1 => array(
+							'type' => 'CUSTOM',
+							'class' => 'validate_systemuser',
+							'function' => 'check_sysuser',
+							'check_names' => false,
+							'errmsg' => 'invalid_nginx_user_txt'
+						),
 			),
 			'value' => '',
 			'width' => '40',
@@ -756,8 +865,15 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'nginx_group_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'nginx_group_error_empty'),
+									1 => array(
+							'type' => 'CUSTOM',
+							'class' => 'validate_systemuser',
+							'function' => 'check_sysgroup',
+							'check_names' => false,
+							'errmsg' => 'invalid_nginx_group_txt'
+						),
 			),
 			'value' => '',
 			'width' => '40',
@@ -767,8 +883,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'php_ini_path_apache_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'php_ini_path_apache_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'php_ini_path_apache_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -778,8 +897,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'php_ini_path_cgi_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'php_ini_path_cgi_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'php_ini_path_cgi_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -789,8 +911,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'php_fpm_init_script_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'php_fpm_init_script_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^[a-zA-Z0-9\.\-\_]{1,128}$/',
+										'errmsg'=> 'php_fpm_init_script_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -800,8 +925,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'php_fpm_ini_path_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'php_fpm_ini_path_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'php_fpm_ini_path_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -811,8 +939,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'php_fpm_pool_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'php_fpm_pool_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'php_fpm_pool_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -822,7 +953,7 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
+			'validators' => array(0 => array('type' => 'ISPOSITIVE',
 					'errmsg' => 'php_fpm_start_port_error_empty'),
 			),
 			'value' => '',
@@ -833,8 +964,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'php_fpm_socket_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'php_fpm_socket_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'errmsg'=> 'php_fpm_socket_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -844,8 +978,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'php_open_basedir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'php_open_basedir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^[a-zA-Z0-9\.\-\_\/\]\[\:]{1,}$/',
+										'errmsg'=> 'php_open_basedir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -862,12 +999,22 @@
 			'width' => '10',
 			'maxlength' => '255'
 		),
+		'php_handler' => array(
+			'datatype' => 'VARCHAR',
+			'formtype' => 'SELECT',
+			'default' => 'fast-cgi',
+			'value' => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM', 'hhvm' => 'HHVM'),
+			'searchable' => 2
+		),
 		'nginx_cgi_socket' => array(
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'nginx_cgi_socket_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'nginx_cgi_socket_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'nginx_cgi_socket_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -877,12 +1024,21 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'htaccess_allow_override_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'htaccess_allow_override_error_empty'),
 			),
 			'value' => '',
 			'width' => '40',
 			'maxlength' => '255'
+		),
+		'enable_spdy' => array (
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default'  => 'y',
+			'value' => array (
+				0 => 'n',
+				1 => 'y'
+			)
 		),
 		'apps_vhost_port' => array(
 			'datatype' => 'VARCHAR',
@@ -925,6 +1081,12 @@
 		'awstats_data_dir' => array(
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'awstats_data_dir_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'awstats_data_dir_error_regex'),
+			),
 			'default' => '',
 			'value' => '',
 			'width' => '40',
@@ -933,6 +1095,12 @@
 		'awstats_pl' => array(
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'awstats_pl_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'awstats_pl_error_regex'),
+			),
 			'default' => '',
 			'value' => '',
 			'width' => '40',
@@ -941,6 +1109,12 @@
 		'awstats_buildstaticpages_pl' => array(
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'awstats_buildstaticpages_pl_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'awstats_buildstaticpages_pl_error_regex'),
+			),
 			'default' => '',
 			'value' => '',
 			'width' => '40',
@@ -964,8 +1138,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'bind_user_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'bind_user_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^(?!ispconfig)([a-zA-Z0-9]{1,20})$/',
+										'errmsg'=> 'invalid_bind_user_txt'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -975,8 +1152,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'bind_group_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'bind_group_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^(?!ispconfig)([a-zA-Z0-9]{1,20})$/',
+										'errmsg'=> 'invalid_bind_group_txt'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -986,8 +1166,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'bind_zonefiles_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'bind_zonefiles_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'bind_zonefiles_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -997,8 +1180,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'named_conf_path_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'named_conf_path_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'named_conf_path_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1008,12 +1194,21 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'named_conf_local_path_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'named_conf_local_path_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'named_conf_local_path_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
 			'maxlength' => '255'
+		),
+		'disable_bind_log' => array (
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default' => 'n',
+			'value' => array(0 => 'n', 1 => 'y')
 		),
 		//#################################
 		// ENDE Datatable fields
@@ -1033,8 +1228,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'fastcgi_starter_path_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'fastcgi_starter_path_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]]{1,128}$/',
+										'errmsg'=> 'fastcgi_starter_path_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1044,8 +1242,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'fastcgi_starter_script_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'fastcgi_starter_script_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'fastcgi_starter_script_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1055,8 +1256,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'fastcgi_alias_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'fastcgi_alias_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'fastcgi_alias_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1066,8 +1270,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'fastcgi_phpini_path_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'fastcgi_phpini_path_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]]{1,128}$/',
+										'errmsg'=> 'fastcgi_phpini_path_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1077,7 +1284,7 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
+			'validators' => array(0 => array('type' => 'ISPOSITIVE',
 					'errmsg' => 'fastcgi_children_error_empty'),
 			),
 			'value' => '',
@@ -1102,8 +1309,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'fastcgi_bin_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'fastcgi_bin_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]]{1,128}$/',
+										'errmsg'=> 'fastcgi_bin_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1124,6 +1334,86 @@
 );
 
 
+$form["tabs"]['xmpp'] = array(
+    'title' => "XMPP",
+    'width' => 80,
+    'template' => "templates/server_config_xmpp_edit.htm",
+    'fields' => array(
+        //#################################
+        // Begin Datatable fields
+        //#################################
+        'xmpp_use_ipv6' => array(
+            'datatype' => 'VARCHAR',
+            'formtype' => 'CHECKBOX',
+            'default' => 'n',
+            'value' => array(0 => 'n', 1 => 'y')
+        ),
+        'xmpp_bosh_max_inactivity' => array(
+            'datatype' => 'VARCHAR',
+            'formtype' => 'TEXT',
+            'default' => '30',
+            'validators' => array(0 => array('type' => 'ISINT',
+                'errmsg' => 'ip_address_error_wrong'),
+                array('type'=>'RANGE', 'range'=>'15:360', 'errmsg' => 'xmpp_bosh_timeout_range_wrong')
+            ),
+            'value' => '',
+            'width' => '15'
+        ),
+
+        'xmpp_server_admins' => array(
+            'datatype' => 'VARCHAR',
+            'formtype' => 'TEXT',
+            'default' => 'admin@service.com, superuser@service.com',
+            'value' => '',
+            'width' => '15'
+        ),
+
+        'xmpp_modules_enabled' => array(
+            'datatype' => 'TEXT',
+            'formtype' => 'TEXT',
+            'default' => "saslauth, tls, dialback, disco, discoitems, version, uptime, time, ping, admin_adhoc, admin_telnet, bosh, posix, announce, offline, webpresence, mam, stream_management, message_carbons",
+            'value' => '',
+            'separator' => ","
+        ),
+
+        'xmpp_port_http' => array(
+            'datatype' => 'VARCHAR',
+            'formtype' => 'TEXT',
+            'default' => '5290',
+            'validators' => array(0 => array('type' => 'ISINT')),
+            'value' => '5290',
+            'width' => '15'
+        ),
+        'xmpp_port_https' => array(
+            'datatype' => 'VARCHAR',
+            'formtype' => 'TEXT',
+            'default' => '5291',
+            'validators' => array(0 => array('type' => 'ISINT')),
+            'value' => '5291',
+            'width' => '15'
+        ),
+        'xmpp_port_pastebin' => array(
+            'datatype' => 'VARCHAR',
+            'formtype' => 'TEXT',
+            'default' => '5292',
+            'validators' => array(0 => array('type' => 'ISINT')),
+            'value' => '5292',
+            'width' => '15'
+        ),
+        'xmpp_port_bosh' => array(
+            'datatype' => 'VARCHAR',
+            'formtype' => 'TEXT',
+            'default' => '5280',
+            'validators' => array(0 => array('type' => 'ISINT')),
+            'value' => '5280',
+            'width' => '15'
+        ),
+        //#################################
+        // ENDE Datatable fields
+        //#################################
+    )
+);
+
 $form["tabs"]['jailkit'] = array(
 	'title' => "Jailkit",
 	'width' => 80,
@@ -1136,8 +1426,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'jailkit_chroot_home_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'jailkit_chroot_home_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]]{1,128}$/',
+										'errmsg'=> 'jailkit_chroot_home_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1147,8 +1440,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'jailkit_chroot_app_sections_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'jailkit_chroot_app_sections_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^[a-zA-Z0-9\-\_\ ]{1,128}$/',
+										'errmsg'=> 'jailkit_chroot_app_sections_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1158,8 +1454,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'jailkit_chroot_app_programs_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'jailkit_chroot_app_programs_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^[a-zA-Z0-9\.\-\_\/\ ]{1,}$/',
+										'errmsg'=> 'jailkit_chroot_app_programs_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1169,8 +1468,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'jailkit_chroot_cron_programs_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'jailkit_chroot_cron_programs_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^[a-zA-Z0-9\.\-\_\/\ ]{1,}$/',
+										'errmsg'=> 'jailkit_chroot_cron_programs_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1258,8 +1560,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'vlogger_config_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'vlogger_config_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'vlogger_config_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1285,8 +1590,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'cron_init_script_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'cron_init_script_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^[a-zA-Z0-9\-\_]{1,30}$/',
+										'errmsg'=> 'cron_init_script_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1296,8 +1604,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'crontab_dir_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'crontab_dir_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'crontab_dir_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',
@@ -1307,8 +1618,11 @@
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'default' => '',
-			'validators' => array(0 => array('type' => 'NOTEMPTY',
-					'errmsg' => 'cron_wget_error_empty'),
+			'validators' => array(	0 => array('type' => 'NOTEMPTY',
+										'errmsg' => 'cron_wget_error_empty'),
+									1 => array ( 	'type' => 'REGEX',
+										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{1,128}$/',
+										'errmsg'=> 'cron_wget_error_regex'),
 			),
 			'value' => '',
 			'width' => '40',

--
Gitblit v1.9.1