Skip to content

Commit 3ee67a9

Browse files
author
Till Brehm
committed
Added additional username check in form files.
1 parent 94b44c6 commit 3ee67a9

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

interface/web/sites/form/shell_user.tform.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@
9393
1 => array ( 'type' => 'REGEX',
9494
'regex' => '/^[\w\.\-]{0,32}$/',
9595
'errmsg'=> 'username_error_regex'),
96+
2 => array(
97+
'type' => 'CUSTOM',
98+
'class' => 'validate_systemuser',
99+
'function' => 'check_sysuser',
100+
'check_names' => true,
101+
'errmsg' => 'invalid_username_txt'
102+
),
96103
),
97104
'default' => '',
98105
'value' => '',

interface/web/sites/form/web_domain.tform.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,13 @@
582582
'formtype' => 'TEXT',
583583
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
584584
'errmsg'=> 'sysuser_error_empty'),
585+
1 => array(
586+
'type' => 'CUSTOM',
587+
'class' => 'validate_systemuser',
588+
'function' => 'check_sysuser',
589+
'check_names' => true,
590+
'errmsg' => 'invalid_system_user_or_group_txt'
591+
),
585592
),
586593
'default' => '',
587594
'value' => '',
@@ -593,6 +600,13 @@
593600
'formtype' => 'TEXT',
594601
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
595602
'errmsg'=> 'sysgroup_error_empty'),
603+
1 => array(
604+
'type' => 'CUSTOM',
605+
'class' => 'validate_systemuser',
606+
'function' => 'check_sysuser',
607+
'check_names' => true,
608+
'errmsg' => 'invalid_system_user_or_group_txt'
609+
),
596610
),
597611
'default' => '',
598612
'value' => '',

interface/web/sites/lib/lang/en_shell_user.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ $wb['username_not_allowed_txt'] = 'The username is not allowed.';
3131
$wb['invalid_system_user_or_group_txt'] = 'Invalid system user or group';
3232
$wb['directory_error_regex'] = 'Invalid directory';
3333
$wb['shell_error_regex'] = 'Invalid shell';
34+
$wb['invalid_username_txt'] = 'Invalid Username';
3435
?>

interface/web/sites/lib/lang/en_web_domain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,5 @@ $wb['backup_excludes_txt'] = 'Excluded Directories';
127127
$wb['backup_excludes_note_txt'] = '(Separate multiple directories with commas. Example: web/cache/*,web/backup)';
128128
$wb['backup_excludes_error_regex'] = 'The excluded directories contain invalid characters.';
129129
$wb['invalid_custom_php_ini_settings_txt'] = 'Invalid php.ini settings';
130+
$wb['invalid_system_user_or_group_txt'] = 'Invalid system user or group';
130131
?>

0 commit comments

Comments
 (0)