From 1ed92e187ae2dfb51f5f2d62c290a85f93b6dc21 Mon Sep 17 00:00:00 2001 From: Till Brehm <tbrehm@ispconfig.org> Date: Thu, 14 Aug 2014 13:54:00 -0400 Subject: [PATCH] - Added security check script. - Create md5 sums of all files at install and update. --- interface/web/admin/form/server_config.tform.php | 749 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 594 insertions(+), 155 deletions(-) diff --git a/interface/web/admin/form/server_config.tform.php b/interface/web/admin/form/server_config.tform.php index dbd8521..01ac568 100644 --- a/interface/web/admin/form/server_config.tform.php +++ b/interface/web/admin/form/server_config.tform.php @@ -55,9 +55,9 @@ 'width' => 70, 'template' => "templates/server_config_server_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'auto_network_configuration' => array( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', @@ -86,6 +86,16 @@ 'width' => '15', 'maxlength' => '255' ), + /* + 'v6_prefix' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array(0 => array('type' => 'ISV6PREFIX', + 'errmsg' => 'v6_prefix_wrong'), + ), + 'default' => '' + ), + */ 'gateway' => array( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', @@ -97,12 +107,30 @@ 'width' => '15', 'maxlength' => '255' ), + 'firewall' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'bastille', + 'value' => array('bastille' => 'bastille', 'ufw' => 'ufw'), + 'width' => '40', + 'maxlength' => '255' + ), 'hostname' => array( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', 'default' => 'server1.domain.tld', - 'validators' => array(0 => array('type' => 'NOTEMPTY', - 'errmsg' => 'hostname_error_empty'), + 'filters' => array( 0 => array( 'event' => 'SAVE', + 'type' => 'IDNTOASCII'), + 1 => array( 'event' => 'SHOW', + 'type' => 'IDNTOUTF8'), + 2 => array( 'event' => 'SAVE', + 'type' => 'TOLOWER') + ), + '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', @@ -127,26 +155,107 @@ 'width' => '40', 'maxlength' => '255' ), + 'admin_notify_events' => array( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'value' => array('3' => 'no_notifications_txt', '0' => 'Debug', '1' => 'Warnings', '2' => 'Errors'), + 'width' => '40', + 'maxlength' => '255' + ), 'backup_dir' => array( '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', 'maxlength' => '255' ), - 'backup_dir_ftpread' => array( + 'backup_dir_is_mount' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'backup_mode' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'userzip', + 'value' => array('userzip' => 'backup_mode_userzip', 'rootgz' => 'backup_mode_rootgz'), + 'width' => '40', + 'maxlength' => '255' + ), + 'monit_url' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[0-9a-zA-Z\:\/\-\.\[\]]{0,255}$/', + 'errmsg'=> 'monit_url_error_regex'), + ), + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'monit_user' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'monit_password' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'munin_url' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[0-9a-zA-Z\:\/\-\.\[\]]{0,255}$/', + 'errmsg'=> 'munin_url_error_regex'), + ), + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'munin_user' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'munin_password' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'monitor_system_updates' => array( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', 'default' => 'y', 'value' => array(0 => 'n', 1 => 'y') ), - ################################## - # ENDE Datatable fields - ################################## + //################################# + // ENDE Datatable fields + //################################# ) ); @@ -155,9 +264,9 @@ 'width' => 60, 'template' => "templates/server_config_mail_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'module' => array( 'datatype' => 'VARCHAR', 'formtype' => 'SELECT', @@ -168,8 +277,11 @@ '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', @@ -179,8 +291,11 @@ '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', @@ -202,8 +317,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', @@ -213,8 +331,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', @@ -224,8 +345,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', @@ -235,8 +359,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', @@ -282,9 +409,53 @@ 'width' => '10', 'maxlength' => '15' ), - ################################## - # ENDE Datatable fields - ################################## + 'mailbox_quota_stats' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'realtime_blackhole_list' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^((([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])(,\s*(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]))*)?$/', + 'errmsg'=> 'rbl_error_regex'), + ), + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'overquota_notify_admin' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'overquota_notify_client' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'overquota_notify_freq' => array( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'default' => '7', + 'value' => '', + 'width' => '20', + 'maxlength' => '255' + ), + 'overquota_notify_onok' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n', 1 => 'y') + ), + //################################# + // ENDE Datatable fields + //################################# ) ); @@ -293,23 +464,26 @@ 'width' => 80, 'template' => "templates/server_config_getmail_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'getmail_config_dir' => array( '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', 'maxlength' => '255' ), - ################################## - # ENDE Datatable fields - ################################## + //################################# + // ENDE Datatable fields + //################################# ) ); @@ -318,9 +492,9 @@ 'width' => 60, 'template' => "templates/server_config_web_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'server_type' => array( 'datatype' => 'VARCHAR', 'formtype' => 'SELECT', @@ -331,8 +505,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', @@ -342,8 +519,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', @@ -353,8 +533,11 @@ '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', @@ -364,14 +547,33 @@ 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', 'default' => 'n', - 'value' => array(0 => 'n',1 => 'y') + 'value' => array(0 => 'n', 1 => 'y') ), + 'website_autoalias' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + /* +'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', @@ -381,8 +583,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', @@ -392,8 +597,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', @@ -403,8 +611,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', @@ -413,6 +624,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', @@ -432,10 +647,78 @@ 'default' => '20', 'value' => array('10' => 'Medium', '20' => 'High') ), + 'set_folder_permissions_on_update' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'web_folder_protection' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'add_web_users_to_sshusers_group' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), 'check_apache_config' => array( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'enable_sni' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'enable_ip_wildcard' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'overtraffic_notify_admin' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'overtraffic_notify_client' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'overquota_notify_admin' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'overquota_notify_client' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'overquota_notify_freq' => array( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'default' => '7', + 'value' => '', + 'width' => '20', + 'maxlength' => '255' + ), + 'overquota_notify_onok' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', 'value' => array(0 => 'n', 1 => 'y') ), 'user' => array( @@ -444,6 +727,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', @@ -455,6 +745,30 @@ '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', + 'maxlength' => '255' + ), + 'connect_userid_to_webid' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'connect_userid_to_webid_start' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '10000', + 'validators' => array(0 => array('type' => 'ISINT', + 'errmsg' => 'connect_userid_to_webid_startid_isint'), ), 'value' => '', 'width' => '40', @@ -464,8 +778,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', @@ -475,8 +796,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', @@ -486,8 +814,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', @@ -497,8 +828,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', @@ -508,8 +842,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', @@ -519,8 +856,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', @@ -530,8 +870,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', @@ -541,8 +884,22 @@ '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' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'php_fpm_socket_dir' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + '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', @@ -552,8 +909,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', @@ -563,8 +923,11 @@ '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', @@ -574,8 +937,8 @@ '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', @@ -622,6 +985,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', @@ -630,6 +999,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', @@ -638,14 +1013,20 @@ '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', 'maxlength' => '255' ), - ################################## - # ENDE Datatable fields - ################################## + //################################# + // ENDE Datatable fields + //################################# ) ); @@ -654,15 +1035,18 @@ 'width' => 60, 'template' => "templates/server_config_dns_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'bind_user' => array( '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', @@ -672,8 +1056,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', @@ -683,8 +1070,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', @@ -694,8 +1084,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', @@ -705,16 +1098,19 @@ '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' ), - ################################## - # ENDE Datatable fields - ################################## + //################################# + // ENDE Datatable fields + //################################# ) ); @@ -723,15 +1119,18 @@ 'width' => 80, 'template' => "templates/server_config_fastcgi_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'fastcgi_starter_path' => array( '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', @@ -741,8 +1140,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', @@ -752,8 +1154,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', @@ -763,8 +1168,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', @@ -774,7 +1182,7 @@ 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', 'default' => '', - 'validators' => array(0 => array('type' => 'NOTEMPTY', + 'validators' => array(0 => array('type' => 'ISPOSITIVE', 'errmsg' => 'fastcgi_children_error_empty'), ), 'value' => '', @@ -785,7 +1193,10 @@ 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', 'default' => '', - 'validators' => array(0 => array('type' => 'NOTEMPTY', + 'validators' => array( 0 => array( 'type' => 'ISINT', + 'errmsg' => 'fastcgi_max_requests_error_empty'), + 1 => array( 'type' => 'RANGE', + 'range' => '0:', 'errmsg' => 'fastcgi_max_requests_error_empty'), ), 'value' => '', @@ -796,8 +1207,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', @@ -811,9 +1225,9 @@ 'width' => '40', 'maxlength' => '255' ), - ################################## - # ENDE Datatable fields - ################################## + //################################# + // ENDE Datatable fields + //################################# ) ); @@ -823,15 +1237,18 @@ 'width' => 80, 'template' => "templates/server_config_jailkit_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'jailkit_chroot_home' => array( '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', @@ -841,8 +1258,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', @@ -852,8 +1272,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', @@ -863,19 +1286,23 @@ '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', 'maxlength' => '1000' ), - ################################## - # ENDE Datatable fields - ################################## + //################################# + // ENDE Datatable fields + //################################# ) ); +/* $form["tabs"]['ufw_firewall'] = array ( 'title' => "UFW Firewall", 'width' => 80, @@ -937,30 +1364,33 @@ ################################## ) ); - +*/ $form["tabs"]['vlogger'] = array( 'title' => "vlogger", 'width' => 80, 'template' => "templates/server_config_vlogger_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'config_dir' => array( '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', 'maxlength' => '255' ), - ################################## - # ENDE Datatable fields - ################################## + //################################# + // ENDE Datatable fields + //################################# ) ); @@ -971,15 +1401,18 @@ 'width' => 80, 'template' => "templates/server_config_cron_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'init_script' => array( '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', @@ -989,8 +1422,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', @@ -1000,16 +1436,19 @@ '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', 'maxlength' => '255' ), - ################################## - # ENDE Datatable fields - ################################## + //################################# + // ENDE Datatable fields + //################################# ) ); @@ -1018,16 +1457,16 @@ 'width' => 80, 'template' => "templates/server_config_rescue_edit.htm", 'fields' => array( - ################################## - # Begin Datatable fields - ################################## + //################################# + // Begin Datatable fields + //################################# 'try_rescue' => array( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', 'default' => 'n', 'value' => array(0 => 'n', 1 => 'y') ), - 'do_not_try_rescue_apache' => array( + 'do_not_try_rescue_httpd' => array( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', 'default' => 'n', @@ -1045,9 +1484,9 @@ 'default' => 'n', 'value' => array(0 => 'n', 1 => 'y') ), - ################################## - # ENDE Datatable fields - ################################## + //################################# + // ENDE Datatable fields + //################################# ) ); ?> -- Gitblit v1.9.1