Till Brehm
2014-08-01 e98a15838d8aed330ac7b1bb373b54524ea2a269
Improved input validation for settings that are acessible by the admin user.
1 files added
7 files modified
336 ■■■■■ changed files
interface/lib/classes/validate_systemuser.inc.php 64 ●●●●● patch | view | raw | blame | history
interface/web/admin/form/server_config.tform.php 177 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_server_config.lng 50 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/ftp_user.tform.php 14 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/shell_user.tform.php 14 ●●●●● patch | view | raw | blame | history
interface/web/sites/ftp_user_edit.php 8 ●●●●● patch | view | raw | blame | history
interface/web/sites/shell_user_edit.php 7 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_vhost_subdomain_edit.php 2 ●●●●● patch | view | raw | blame | history
interface/lib/classes/validate_systemuser.inc.php
New file
@@ -0,0 +1,64 @@
<?php
/*
Copyright (c) 2014, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of ISPConfig nor the names of its contributors
      may be used to endorse or promote products derived from this software without
      specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class validate_systemuser {
    /*
        Validator function to check if a given user is ok.
    */
    function check_sysuser($field_name, $field_value, $validator) {
        global $app;
        $errmsg = $validator['errmsg'];
        $check_names = (isset($validator['check_names']) && $validator['check_names'] == true)?true:false;
        if($app->functions->is_allowed_user(trim(strtolower($field_value)),$check_names) == false) {
            return $app->tform->wordbook[$errmsg]."<br>\r\n";
        }
    }
    /*
        Validator function to check if a given group is ok.
    */
    function check_sysgroup($field_name, $field_value, $validator) {
        global $app;
        $errmsg = $validator['errmsg'];
        $check_names = (isset($validator['check_names']) && $validator['check_names'] == true)?true:false;
        if($app->functions->is_allowed_group(trim(strtolower($field_value)),$check_names) == false) {
            return $app->tform->wordbook[$errmsg]."<br>\r\n";
        }
    }
}
interface/web/admin/form/server_config.tform.php
@@ -169,6 +169,9 @@
            'default' => '/var/backup',
            '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',
@@ -276,6 +279,9 @@
            'default' => '/home/vmail/[domain]/[localpart]/',
            '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',
@@ -287,6 +293,9 @@
            'default' => '/home/vmail/',
            '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',
@@ -310,6 +319,9 @@
            'default' => '5000',
            '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',
@@ -321,6 +333,9 @@
            'default' => '5000',
            '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',
@@ -332,6 +347,9 @@
            'default' => 'vmail',
            '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',
@@ -343,6 +361,9 @@
            'default' => 'vmail',
            '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',
@@ -452,6 +473,9 @@
            'default' => '',
            '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',
@@ -483,6 +507,9 @@
            'default' => '',
            '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',
@@ -494,6 +521,9 @@
            'default' => '',
            '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',
@@ -505,6 +535,9 @@
            'default' => '',
            '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',
@@ -538,6 +571,9 @@
            'default' => '',
            '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',
@@ -549,6 +585,9 @@
            'default' => '',
            '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',
@@ -560,6 +599,9 @@
            'default' => '',
            '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',
@@ -571,6 +613,9 @@
            'default' => '',
            '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',
@@ -579,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',
@@ -678,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',
@@ -689,6 +745,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',
@@ -717,6 +780,13 @@
            'default' => '',
            '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',
@@ -728,6 +798,13 @@
            'default' => '',
            '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',
@@ -739,6 +816,9 @@
            'default' => '',
            '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',
@@ -750,6 +830,9 @@
            'default' => '',
            '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',
@@ -761,6 +844,9 @@
            'default' => '',
            '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',
@@ -772,6 +858,9 @@
            'default' => '',
            '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',
@@ -783,6 +872,9 @@
            'default' => '',
            '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',
@@ -792,7 +884,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' => '',
@@ -805,6 +897,9 @@
            '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',
@@ -816,6 +911,9 @@
            'default' => '',
            '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',
@@ -827,6 +925,9 @@
            'default' => '',
            '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',
@@ -884,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',
@@ -892,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',
@@ -900,6 +1013,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',
@@ -925,6 +1044,9 @@
            'default' => '',
            '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',
@@ -936,6 +1058,9 @@
            'default' => '',
            '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',
@@ -947,6 +1072,9 @@
            'default' => '',
            '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',
@@ -958,6 +1086,9 @@
            'default' => '',
            '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',
@@ -969,6 +1100,9 @@
            'default' => '',
            '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',
@@ -994,6 +1128,9 @@
            'default' => '',
            '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',
@@ -1005,6 +1142,9 @@
            'default' => '',
            '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',
@@ -1016,6 +1156,9 @@
            'default' => '',
            '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',
@@ -1027,6 +1170,9 @@
            'default' => '',
            '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',
@@ -1036,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' => '',
@@ -1063,6 +1209,9 @@
            'default' => '',
            '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',
@@ -1097,6 +1246,9 @@
            'default' => '',
            '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',
@@ -1108,6 +1260,9 @@
            'default' => '',
            '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',
@@ -1119,6 +1274,9 @@
            'default' => '',
            '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',
@@ -1130,6 +1288,9 @@
            'default' => '',
            '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',
@@ -1219,6 +1380,9 @@
            'default' => '',
            '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',
@@ -1246,6 +1410,9 @@
            'default' => '',
            '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',
@@ -1257,6 +1424,9 @@
            'default' => '',
            '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',
@@ -1268,6 +1438,9 @@
            'default' => '',
            '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',
interface/web/admin/lib/lang/en_server_config.lng
@@ -191,4 +191,54 @@
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb['backup_dir_is_mount_txt'] = 'Backup directory is a mount?';
$wb['monitor_system_updates_txt'] = 'Check for Linux updates';
$wb['invalid_apache_user_txt'] = 'Invalid apache user.';
$wb['invalid_apache_group_txt'] = 'Invalid apache group.';
$wb['backup_dir_error_regex'] = 'Invalid backup directory.';
$wb['maildir_path_error_regex'] = 'Invalid maildir path.';
$wb['homedir_path_error_regex'] = 'Invalid homedir path.';
$wb['mailuser_name_error_regex'] = 'Invalid mailuser name.';
$wb['mailuser_group_name_error_regex'] = 'Invalid mailuser group name.';
$wb['mailuser_uid_error_range'] = 'Mailuser uid must be >= 2000';
$wb['mailuser_gid_error_range'] = 'Mailuser gid must be >= 2000';
$wb['getmail_config_dir_error_regex'] = 'Invalid getmail config directory.';
$wb['website_basedir_error_regex'] = 'Invalid website basedir.';
$wb['website_symlinks_error_regex'] = 'Invalid website symlinks.';
$wb['vhost_conf_dir_error_regex'] = 'Invalid vhost config directory.';
$wb['vhost_conf_enabled_dir_error_regex'] = 'Invalid vhost conf enabled directory.';
$wb['nginx_vhost_conf_dir_error_regex'] = 'Invalid nginx config directory.';
$wb['nginx_vhost_conf_enabled_dir_error_regex'] = 'Invalid nginx conf enabled directory.';
$wb['ca_path_error_regex'] = 'Invalid CA path.';
$wb['invalid_nginx_user_txt'] = 'Invalid nginx user.';
$wb['invalid_nginx_group_txt'] = 'Invalid nginx group.';
$wb['php_ini_path_apache_error_regex'] = 'Invalid apache php.ini path.';
$wb['php_ini_path_cgi_error_regex'] = 'Invalid cgi php.ini path.';
$wb['php_fpm_init_script_error_regex'] = 'Invalid php-fpm init script.';
$wb['php_fpm_ini_path_error_regex'] = 'Invalid php-fpm ini path.';
$wb['php_fpm_pool_dir_error_regex'] = 'Invalid php-fpm pool directory.';
$wb['php_fpm_socket_dir_error_regex'] = 'Invalid php-fpm socket directory.';
$wb['php_open_basedir_error_regex'] = 'Invalid php open_basedir.';
$wb['awstats_data_dir_empty'] = 'awstats data directory is empty';
$wb['awstats_data_dir_error_regex'] = 'Invalid awstats data directory.';
$wb['awstats_pl_empty'] = 'awstats.pl setting is empty.';
$wb['awstats_pl_error_regex'] = 'Invalid awstats.pl path.';
$wb['awstats_buildstaticpages_pl_empty'] = 'awstats_buildstaticpages.pl is empty';
$wb['awstats_buildstaticpages_pl_error_regex'] = 'Invalid awstats_buildstaticpages.pl path.';
$wb['invalid_bind_user_txt'] = 'Invalid BIND user.';
$wb['invalid_bind_group_txt'] = 'Invalid BIND group.';
$wb['bind_zonefiles_dir_error_regex'] = 'Invalid BIND zonefiles directory.';
$wb['named_conf_path_error_regex'] = 'Invalid named.conf path.';
$wb['named_conf_local_path_error_regex'] = 'Invalid named.conf.local path.';
$wb['fastcgi_starter_path_error_regex'] = 'Invalid fastcgi starter path.';
$wb['fastcgi_starter_script_error_regex'] = 'Invalid fastcgi starter script.';
$wb['fastcgi_alias_error_regex'] = 'Invalid fastcgi alias.';
$wb['fastcgi_phpini_path_error_regex'] = 'Invalid fastcgi path.';
$wb['fastcgi_bin_error_regex'] = 'Invalid fastcgi bin.';
$wb['jailkit_chroot_home_error_regex'] = 'Invalid jaikit chroot home.';
$wb['jailkit_chroot_app_sections_error_regex'] = 'Invalid jaikit chroot sections.';
$wb['jailkit_chroot_app_programs_error_regex'] = 'Invalid jaikit chroot app programs.';
$wb['jailkit_chroot_cron_programs_error_regex'] = 'Invalid jaikit chroot cron programs.';
$wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
?>
interface/web/sites/form/ftp_user.tform.php
@@ -166,6 +166,13 @@
                'formtype'  => 'TEXT',
                'validators'    => array (  0 => array (    'type'  => 'NOTEMPTY',
                        'errmsg'=> 'uid_error_empty'),
                        1 => array(
                            'type' => 'CUSTOM',
                            'class' => 'validate_systemuser',
                            'function' => 'check_sysuser',
                            'check_names' => true,
                            'errmsg' => 'invalid_system_user_or_group_txt'
                        ),
                ),
                'default'   => '0',
                'value'     => '',
@@ -177,6 +184,13 @@
                'formtype'  => 'TEXT',
                'validators'    => array (  0 => array (    'type'  => 'NOTEMPTY',
                        'errmsg'=> 'gid_error_empty'),
                        1 => array(
                            'type' => 'CUSTOM',
                            'class' => 'validate_systemuser',
                            'function' => 'check_sysgroup',
                            'check_names' => true,
                            'errmsg' => 'invalid_system_user_or_group_txt'
                        ),
                ),
                'default'   => '0',
                'value'     => '',
interface/web/sites/form/shell_user.tform.php
@@ -177,6 +177,13 @@
                'formtype' => 'TEXT',
                'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
                        'errmsg'=> 'uid_error_empty'),
                        1 => array(
                            'type' => 'CUSTOM',
                            'class' => 'validate_systemuser',
                            'function' => 'check_sysuser',
                            'check_names' => true,
                            'errmsg' => 'invalid_system_user_or_group_txt'
                        ),
                ),
                'default' => '0',
                'value'  => '',
@@ -188,6 +195,13 @@
                'formtype' => 'TEXT',
                'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
                        'errmsg'=> 'uid_error_empty'),
                        1 => array(
                            'type' => 'CUSTOM',
                            'class' => 'validate_systemuser',
                            'function' => 'check_sysgroup',
                            'check_names' => true,
                            'errmsg' => 'invalid_system_user_or_group_txt'
                        ),
                ),
                'default' => '0',
                'value'  => '',
interface/web/sites/ftp_user_edit.php
@@ -154,14 +154,6 @@
    function onBeforeUpdate() {
        global $app, $conf, $interfaceConf;
        
        // Check system user and group
        if(isset($this->dataRecord['uid'])) {
            if($app->functions->is_allowed_user(strtolower($this->dataRecord['uid']),true) == false || $app->functions->is_allowed_group(strtolower($this->dataRecord['gid']),true) == false) {
                $app->tform->errorMessage .= $app->tform->lng('invalid_system_user_or_group_txt');
            }
        }
        /*
         * If the names should be restricted -> do it!
         */
interface/web/sites/shell_user_edit.php
@@ -190,13 +190,6 @@
            }
        }
        unset($blacklist);
        // Check system user and group
        if(isset($this->dataRecord['puser'])) {
            if($app->functions->is_allowed_user(strtolower($this->dataRecord['puser']),true) == false || $app->functions->is_allowed_group(strtolower($this->dataRecord['pgroup']),true) == false) {
                $app->tform->errorMessage .= $app->tform->lng('invalid_system_user_or_group_txt');
            }
        }
        /*
         * If the names should be restricted -> do it!
interface/web/sites/web_vhost_subdomain_edit.php
@@ -341,6 +341,8 @@
        $this->dataRecord["ipv6_address"] = $parent_domain["ipv6_address"];
        $this->dataRecord["client_group_id"] = $parent_domain["client_group_id"];
        $this->dataRecord["vhost_type"] = 'name';
        $this->dataRecord["system_user"] = $parent_domain["system_user"];
        $this->dataRecord["system_group"] = $parent_domain["system_group"];
        $this->parent_domain_record = $parent_domain;