File tree Expand file tree Collapse file tree 6 files changed +17
-11
lines changed
Expand file tree Collapse file tree 6 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 8383 'username ' => array (
8484 'datatype ' => 'VARCHAR ' ,
8585 'formtype ' => 'TEXT ' ,
86- 'validators ' => array ( 0 => array ( 'type ' => 'NOTEMPTY ' ,
87- 'errmsg ' => 'username_error_empty ' ),
88- 1 => array ( 'type ' => 'UNIQUE ' ,
86+ 'validators ' => array ( 0 => array ( 'type ' => 'UNIQUE ' ,
8987 'errmsg ' => 'username_error_unique ' ),
90- 2 => array ( 'type ' => 'REGEX ' ,
91- 'regex ' => '/^[\w\.\-]{1 ,64}$/ ' ,
88+ 1 => array ( 'type ' => 'REGEX ' ,
89+ 'regex ' => '/^[\w\.\-]{0 ,64}$/ ' ,
9290 'errmsg ' => 'username_error_regex ' ),
9391 ),
9492 'default ' => '' ,
Original file line number Diff line number Diff line change 8383 'username ' => array (
8484 'datatype ' => 'VARCHAR ' ,
8585 'formtype ' => 'TEXT ' ,
86- 'validators ' => array ( 0 => array ( 'type ' => 'NOTEMPTY ' ,
87- 'errmsg ' => 'username_error_empty ' ),
88- 1 => array ( 'type ' => 'UNIQUE ' ,
86+ 'validators ' => array ( 0 => array ( 'type ' => 'UNIQUE ' ,
8987 'errmsg ' => 'username_error_unique ' ),
90- 2 => array ( 'type ' => 'REGEX ' ,
91- 'regex ' => '/^[\w\.\-]{1 ,64}$/ ' ,
88+ 1 => array ( 'type ' => 'REGEX ' ,
89+ 'regex ' => '/^[\w\.\-]{0 ,64}$/ ' ,
9290 'errmsg ' => 'username_error_regex ' ),
9391 ),
9492 'default ' => '' ,
Original file line number Diff line number Diff line change @@ -108,6 +108,11 @@ function onSubmit() {
108108 // Set a few fixed values
109109 $ this ->dataRecord ["server_id " ] = $ parent_domain ["server_id " ];
110110
111+ //die(print_r($this->dataRecord));
112+
113+ if (isset ($ this ->dataRecord ['username ' ]) && trim ($ this ->dataRecord ['username ' ]) == '' ) $ app ->tform ->errorMessage .= $ app ->tform ->lng ('username_error_empty ' ).'<br /> ' ;
114+ if (isset ($ this ->dataRecord ['username ' ]) && empty ($ this ->dataRecord ['parent_domain_id ' ])) $ app ->tform ->errorMessage .= $ app ->tform ->lng ('parent_domain_id_error_empty ' ).'<br /> ' ;
115+
111116 parent ::onSubmit ();
112117 }
113118
Original file line number Diff line number Diff line change @@ -24,4 +24,5 @@ $wb["uid_error_empty"] = 'UID empty.';
2424$wb["uid_error_empty"] = 'GID empty.';
2525$wb["directory_error_empty"] = 'Directory empty.';
2626$wb['directory_error_notinweb'] = 'Directory not inside of web root directory.';
27+ $wb["parent_domain_id_error_empty"] = 'No website selected.';
2728?>
Original file line number Diff line number Diff line change @@ -19,4 +19,5 @@ $wb["uid_error_empty"] = 'UID empty.';
1919$wb["uid_error_empty"] = 'GID empty.';
2020$wb["directory_error_empty"] = 'Directory empty.';
2121$wb["limit_shell_user_txt"] = 'The max number of shell users is reached.';
22+ $wb["parent_domain_id_error_empty"] = 'No website selected.';
2223?>
Original file line number Diff line number Diff line change @@ -115,6 +115,9 @@ function onSubmit() {
115115 // Set a few fixed values
116116 $ this ->dataRecord ["server_id " ] = $ parent_domain ["server_id " ];
117117
118+ if (isset ($ this ->dataRecord ['username ' ]) && trim ($ this ->dataRecord ['username ' ]) == '' ) $ app ->tform ->errorMessage .= $ app ->tform ->lng ('username_error_empty ' ).'<br /> ' ;
119+ if (isset ($ this ->dataRecord ['username ' ]) && empty ($ this ->dataRecord ['parent_domain_id ' ])) $ app ->tform ->errorMessage .= $ app ->tform ->lng ('parent_domain_id_error_empty ' ).'<br /> ' ;
120+
118121 parent ::onSubmit ();
119122 }
120123
@@ -129,7 +132,7 @@ function onBeforeInsert() {
129132 }
130133 }
131134 unset($ blacklist );
132-
135+
133136 /*
134137 * If the names should be restricted -> do it!
135138 */
You can’t perform that action at this time.
0 commit comments