From 45a1b4ba4d668722950b4791fb9757f0ba49da64 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Oct 2022 16:58:19 +0200 Subject: [PATCH] IDEMPIERE-5450 Improve misleading name of SysConfig (#1532) --- migration/i9/oracle/202210131724_IDEMPIERE-5450.sql | 2 +- migration/i9/postgresql/202210131724_IDEMPIERE-5450.sql | 2 +- org.adempiere.base/src/org/compiere/model/MSysConfig.java | 4 ++-- .../src/org/adempiere/webui/apps/form/WSQLProcess.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/i9/oracle/202210131724_IDEMPIERE-5450.sql b/migration/i9/oracle/202210131724_IDEMPIERE-5450.sql index 8a147bba0b..1318948927 100644 --- a/migration/i9/oracle/202210131724_IDEMPIERE-5450.sql +++ b/migration/i9/oracle/202210131724_IDEMPIERE-5450.sql @@ -5,6 +5,6 @@ SET SQLBLANKLINES ON SET DEFINE OFF -- Oct 13, 2022, 5:24:11 PM CEST -INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200209,0,0,TO_TIMESTAMP('2022-10-13 17:24:11','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2022-10-13 17:24:11','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ALLOWED_KEYWORDS_IN_SQL_FORM','ALTER,ANALYZE,COMMENT,CREATE,DELETE,DROP,GRANT,INSERT,REINDEX,REVOKE,SET,UPDATE,TRUNCATE,VACUUM','Comma separated list of commands allowed in the SQL Process form','D','S','52f9e30d-4a15-4a63-890c-c338e9f20f61') +INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200209,0,0,TO_TIMESTAMP('2022-10-13 17:24:11','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2022-10-13 17:24:11','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','FORM_SQL_PROCESS_ALLOWED_KEYWORDS','ALTER,ANALYZE,COMMENT,CREATE,DELETE,DROP,GRANT,INSERT,REINDEX,REVOKE,SET,UPDATE,TRUNCATE,VACUUM','Comma separated list of commands allowed in the SQL Process form','D','S','52f9e30d-4a15-4a63-890c-c338e9f20f61') ; diff --git a/migration/i9/postgresql/202210131724_IDEMPIERE-5450.sql b/migration/i9/postgresql/202210131724_IDEMPIERE-5450.sql index 6db41a39fb..52264d81ce 100644 --- a/migration/i9/postgresql/202210131724_IDEMPIERE-5450.sql +++ b/migration/i9/postgresql/202210131724_IDEMPIERE-5450.sql @@ -2,6 +2,6 @@ SELECT register_migration_script('202210131724_IDEMPIERE-5450.sql') FROM dual; -- Oct 13, 2022, 5:24:11 PM CEST -INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200209,0,0,TO_TIMESTAMP('2022-10-13 17:24:11','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2022-10-13 17:24:11','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ALLOWED_KEYWORDS_IN_SQL_FORM','ALTER,ANALYZE,COMMENT,CREATE,DELETE,DROP,GRANT,INSERT,REINDEX,REVOKE,SET,UPDATE,TRUNCATE,VACUUM','Comma separated list of commands allowed in the SQL Process form','D','S','52f9e30d-4a15-4a63-890c-c338e9f20f61') +INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200209,0,0,TO_TIMESTAMP('2022-10-13 17:24:11','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2022-10-13 17:24:11','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','FORM_SQL_PROCESS_ALLOWED_KEYWORDS','ALTER,ANALYZE,COMMENT,CREATE,DELETE,DROP,GRANT,INSERT,REINDEX,REVOKE,SET,UPDATE,TRUNCATE,VACUUM','Comma separated list of commands allowed in the SQL Process form','D','S','52f9e30d-4a15-4a63-890c-c338e9f20f61') ; diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 73ebe83154..89cf6acae5 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -44,13 +44,12 @@ public class MSysConfig extends X_AD_SysConfig /** * */ - private static final long serialVersionUID = -5465323173669763683L; + private static final long serialVersionUID = 9018760438155531804L; public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION"; public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS"; public static final String ALLOCATION_DESCRIPTION = "ALLOCATION_DESCRIPTION"; public static final String ALLOW_APPLY_PAYMENT_TO_CREDITMEMO = "ALLOW_APPLY_PAYMENT_TO_CREDITMEMO"; - public static final String ALLOWED_KEYWORDS_IN_SQL_FORM = "ALLOWED_KEYWORDS_IN_SQL_FORM"; public static final String ALLOW_OVER_APPLIED_PAYMENT = "ALLOW_OVER_APPLIED_PAYMENT"; public static final String ALLOW_REVERSAL_OF_RECONCILED_PAYMENT = "ALLOW_REVERSAL_OF_RECONCILED_PAYMENT"; public static final String ALogin_ShowDate = "ALogin_ShowDate"; @@ -103,6 +102,7 @@ public class MSysConfig extends X_AD_SysConfig public static final String ENABLE_PAYMENTBOX_BUTTON = "ENABLE_PAYMENTBOX_BUTTON"; public static final String FEEDBACK_EMAIL_CC = "FEEDBACK_EMAIL_CC"; public static final String FEEDBACK_EMAIL_TO = "FEEDBACK_EMAIL_TO"; + public static final String FORM_SQL_PROCESS_ALLOWED_KEYWORDS = "FORM_SQL_PROCESS_ALLOWED_KEYWORDS"; public static final String GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS = "GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS"; public static final String HTML_REPORT_MINIFY = "HTML_REPORT_MINIFY"; public static final String HTML_REPORT_THEME = "HTML_REPORT_THEME"; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WSQLProcess.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WSQLProcess.java index 648f420c0b..1c111dda7d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WSQLProcess.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WSQLProcess.java @@ -228,7 +228,7 @@ public class WSQLProcess extends ADForm implements EventListener .replaceAll(REGEX_REMOVE_QUOTED_STRINGS, "") .replaceFirst(REGEX_REMOVE_LEADING_SPACES, ""); - String[] allowedKeywords = MSysConfig.getValue(MSysConfig.ALLOWED_KEYWORDS_IN_SQL_FORM, "ALTER,ANALYZE,COMMENT,CREATE,DELETE,DROP,GRANT,INSERT,REINDEX,REVOKE,SET,UPDATE,TRUNCATE,VACUUM").split(","); + String[] allowedKeywords = MSysConfig.getValue(MSysConfig.FORM_SQL_PROCESS_ALLOWED_KEYWORDS, "ALTER,ANALYZE,COMMENT,CREATE,DELETE,DROP,GRANT,INSERT,REINDEX,REVOKE,SET,UPDATE,TRUNCATE,VACUUM").split(","); boolean error = true; for (int i = 0; i < allowedKeywords.length; i++) { if (cleanSQL.startsWith(allowedKeywords[i] + " ")) {