File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed
Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ fastcgi_bin=/usr/bin/php-cgi
137137[jailkit]
138138jailkit_chroot_home=/home/[username]
139139jailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh
140- jailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico /usr/bin/mysql /usr/bin/mysqldump /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-upload-pack /usr/bin/unzip /usr/bin/zip /bin/tar /bin/rm /usr/bin/patch /usr/bin/which /usr/lib/x86_64-linux-gnu/libmemcached.so.11 /usr/lib/x86_64-linux-gnu/libmemcachedutil.so.2 /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so.2 /opt/php-5.6.8/bin/php /opt/php-5.6.8/include /opt/php-5.6.8/lib
140+ jailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico /usr/bin/mysql /usr/bin/mysqldump /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-upload-pack /usr/bin/unzip /usr/bin/zip /bin/tar /bin/rm /usr/bin/patch /usr/bin/which /usr/lib/x86_64-linux-gnu/libmemcached.so.11 /usr/lib/x86_64-linux-gnu/libmemcachedutil.so.2 /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so.2
141141jailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php
142142
143143[vlogger]
Original file line number Diff line number Diff line change 16911691 'maxlength ' => '1000 '
16921692 ),
16931693 'jailkit_chroot_app_programs ' => array (
1694- 'datatype ' => 'VARCHAR ' ,
1694+ 'datatype ' => 'TEXT ' ,
16951695 'formtype ' => 'TEXT ' ,
16961696 'default ' => '' ,
16971697 'validators ' => array ( 0 => array ('type ' => 'NOTEMPTY ' ,
16981698 'errmsg ' => 'jailkit_chroot_app_programs_error_empty ' ),
16991699 1 => array ( 'type ' => 'REGEX ' ,
1700- 'regex ' => '/^[a-zA-Z0-9\*\.\-\_\/\ ]{1,}$/ ' ,
1700+ 'regex ' => '/^[a-zA-Z0-9\*\.\-\_\/\ \r\n ]{1,}$/ ' ,
17011701 'errmsg ' => 'jailkit_chroot_app_programs_error_regex ' ),
17021702 ),
17031703 'value ' => '' ,
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ function onShowEdit() {
8080
8181 $ this ->dataRecord = $ app ->getconf ->get_server_config ($ server_id , $ section );
8282
83+ $ this ->dataRecord ['jailkit_chroot_app_programs ' ] = str_replace (' ' , "\r\n" , $ this ->dataRecord ['jailkit_chroot_app_programs ' ]);
84+
8385 if ($ section == 'mail ' ){
8486 $ server_config = $ app ->getconf ->get_server_config ($ server_id , 'server ' );
8587 $ rspamd_url = 'https:// ' .$ server_config ['hostname ' ].':8081/rspamd/ ' ;
@@ -122,6 +124,17 @@ function onUpdateSave($sql) {
122124 }
123125 }
124126
127+ if (isset ($ this ->dataRecord ['jailkit_chroot_app_programs ' ])) {
128+ $ jailkit_chroot_app_programs = explode ("\r\n" , $ this ->dataRecord ['jailkit_chroot_app_programs ' ]);
129+ $ jailkit_chroot_app_programs = array_unique ($ jailkit_chroot_app_programs );
130+ foreach ($ jailkit_chroot_app_programs as $ key => $ value ) {
131+ if (trim ($ value )=='' ) {
132+ unset($ jailkit_chroot_app_programs [$ key ]);
133+ }
134+ }
135+ $ this ->dataRecord ['jailkit_chroot_app_programs ' ] = implode (' ' , $ jailkit_chroot_app_programs );
136+ }
137+
125138 if ($ app ->tform ->errorMessage == '' ) {
126139 $ server_config_array [$ section ] = $ app ->tform ->encode ($ this ->dataRecord , $ section );
127140 $ server_config_str = $ app ->ini_parser ->get_ini_string ($ server_config_array );
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ <h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
1313 < div class ="col-sm-9 "> < input type ="text " name ="jailkit_chroot_app_sections " id ="jailkit_chroot_app_sections " value ="{tmpl_var name='jailkit_chroot_app_sections'} " class ="form-control " /> </ div > </ div >
1414 < div class ="form-group ">
1515 < label for ="jailkit_chroot_app_programs " class ="col-sm-3 control-label "> {tmpl_var name='jailkit_chroot_app_programs_txt'}</ label >
16- < div class ="col-sm-9 "> < input type =" text " name ="jailkit_chroot_app_programs " id ="jailkit_chroot_app_programs " value =" {tmpl_var name='jailkit_chroot_app_programs'} " class =" form-control " / ></ div > </ div >
16+ < div class ="col-sm-9 "> < textarea name ="jailkit_chroot_app_programs " id ="jailkit_chroot_app_programs " class =" form-control " rows =' 15 ' cols =' 50 ' > {tmpl_var name='jailkit_chroot_app_programs'}</ textarea > </ div > </ div >
1717 < div class ="form-group ">
1818 < label for ="jailkit_chroot_cron_programs " class ="col-sm-3 control-label "> {tmpl_var name='jailkit_chroot_cron_programs_txt'}</ label >
1919 < div class ="col-sm-9 "> < input type ="text " name ="jailkit_chroot_cron_programs " id ="jailkit_chroot_cron_programs " value ="{tmpl_var name='jailkit_chroot_cron_programs'} " class ="form-control " /> </ div > </ div >
@@ -24,4 +24,4 @@ <h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
2424 < div class ="clear "> < div class ="right ">
2525 < button class ="btn btn-default formbutton-success " type ="button " value ="{tmpl_var name='btn_save_txt'} " data-submit-form ="pageForm " data-form-action ="admin/server_config_edit.php "> {tmpl_var name='btn_save_txt'}</ button >
2626 < button class ="btn btn-default formbutton-default " type ="button " value ="{tmpl_var name='btn_cancel_txt'} " data-load-content ="admin/server_config_list.php "> {tmpl_var name='btn_cancel_txt'}</ button >
27- </ div > </ div >
27+ </ div > </ div >
You can’t perform that action at this time.
0 commit comments