9898 <cv-accordion-item :open =" toggleAccordion[0]" >
9999 <template slot="title">{{ $t("settings.advanced") }}</template >
100100 <template slot="content">
101- <cv-text-input
101+ <cv-text-area
102102 :label =" $t('settings.plugins')"
103- :placeholder =" $t('settings.placeholder_plugins')"
104103 v-model.trim =" plugins"
105- class =" mg-bottom"
106- :invalid-message =" $t(error.plugins)"
104+ :invalid-message =" error.plugins"
105+ :helper-text =" $t('settings.plugins_list')"
106+ :value =" plugins"
107+ class =" maxwidth textarea mg-left"
108+ ref =" plugins"
109+ :placeholder =" $t('settings.plugins_list')"
107110 :disabled ="
108111 loading.getConfiguration || loading.configureModule
109112 "
110- ref =" plugins"
111113 >
112- </cv-text-input >
114+ </cv-text-area >
113115 <cv-text-input
114116 :label =" $t('settings.upload_max_filesize')"
115117 placeholder =" 5"
@@ -304,10 +306,14 @@ export default {
304306 });
305307
306308 this .mail_server_URL = config .mail_server_URL ;
307- this .plugins = config .plugins ;
309+ this .plugins = config .plugins . split ( " , " ). join ( " \n " ) ;
308310 this .loading .getConfiguration = false ;
309311 this .focusElement (" host" );
310312 },
313+ isValidPlugin (plugin ) {
314+ const re = / ^ [a-zA-Z0-9 -_] + $ / ;
315+ return re .test (plugin);
316+ },
311317 validateConfigureModule () {
312318 this .clearErrors (this );
313319
@@ -328,6 +334,24 @@ export default {
328334 }
329335 isValidationOk = false ;
330336 }
337+ if (this .plugins ) {
338+ // test if the plugins list is valid
339+ const plugins_list = this .plugins .split (" \n " );
340+ for (const plugin of plugins_list) {
341+ if (! this .isValidPlugin (plugin .trim ())){
342+ this .toggleAccordion [0 ] = true ;
343+ // set i18n error message and return plugin in object
344+ this .error .plugins = this .$t (" settings.invalid_plugin" , {
345+ plugin: plugin,
346+ });
347+ isValidationOk = false ;
348+ if (isValidationOk) {
349+ this .focusElement (" plugins" );
350+ }
351+ break ;
352+ }
353+ }
354+ }
331355 return isValidationOk;
332356 },
333357 configureModuleValidationFailed (validationErrors ) {
@@ -386,7 +410,7 @@ export default {
386410 http2https: this .isHttpToHttpsEnabled ,
387411 mail_server: mail_server_tmp,
388412 mail_domain: mail_domain_tmp,
389- plugins: this .plugins ,
413+ plugins: this .plugins . split ( " \n " ). join ( " , " ). trim (). toLowerCase () ,
390414 upload_max_filesize: parseInt (this .upload_max_filesize ),
391415 },
392416 extra: {
0 commit comments