From c90afc094851d7b3ef872f614279f202275f9fe3 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 8 Feb 2022 13:10:33 +0100 Subject: [PATCH] IDEMPIERE-5174 Disable System User (#1172) * IDEMPIERE-5174 Disable System User - change approach to replace System user instead of removing it * restore login-info.zul --- .../oracle/202202072157_IDEMPIERE-5174.sql | 98 +++++++++++++++---- .../202202072157_IDEMPIERE-5174.sql | 98 +++++++++++++++---- .../theme/default/zul/login/login-info.zul | 6 ++ 3 files changed, 164 insertions(+), 38 deletions(-) diff --git a/migration/iD10/oracle/202202072157_IDEMPIERE-5174.sql b/migration/iD10/oracle/202202072157_IDEMPIERE-5174.sql index e5161c571d..d5219fae56 100644 --- a/migration/iD10/oracle/202202072157_IDEMPIERE-5174.sql +++ b/migration/iD10/oracle/202202072157_IDEMPIERE-5174.sql @@ -2,33 +2,93 @@ SET SQLBLANKLINES ON SET DEFINE OFF -- IDEMPIERE-5174 Deactivate System user + +insert into ad_user (ad_user_id,ad_client_id,ad_org_id,isactive,created,createdby,updated,updatedby,name,description,password,email,supervisor_id,c_bpartner_id,processing,emailuser,emailuserpw,c_bpartner_location_id,c_greeting_id,title,comments,phone,phone2,fax,lastcontact,lastresult,birthday,ad_orgtrx_id,emailverify,emailverifydate,notificationtype,isfullbpaccess,c_job_id,ldapuser,connectionprofile,value,userpin,isinpayroll,ad_user_uu,ismenuautoexpand,salt,islocked,dateaccountlocked,failedlogincount,datepasswordchanged,datelastlogin,isnopasswordreset,isexpired,securityquestion,answer,issaleslead,c_location_id,leadsource,leadstatus,leadsourcedescription,leadstatusdescription,c_campaign_id,salesrep_id,bpname,bp_location_id,isaddmailtextautomatically,r_defaultmailtext_id,ad_image_id,isnoexpire,issupportuser,isbillto,isshipto,isvendorlead) +select +10,ad_client_id,ad_org_id,isactive,created,createdby,updated,updatedby,name,description,password,email,supervisor_id,c_bpartner_id,processing,emailuser,emailuserpw,c_bpartner_location_id,c_greeting_id,title,comments,phone,phone2,fax,lastcontact,lastresult,birthday,ad_orgtrx_id,emailverify,emailverifydate,notificationtype,isfullbpaccess,c_job_id,ldapuser,connectionprofile,value,userpin,isinpayroll,'98acf599-bd19-4439-a8b6-958ac247d680',ismenuautoexpand,salt,islocked,dateaccountlocked,failedlogincount,datepasswordchanged,datelastlogin,isnopasswordreset,isexpired,securityquestion,answer,issaleslead,c_location_id,leadsource,leadstatus,leadsourcedescription,leadstatusdescription,c_campaign_id,salesrep_id,bpname,bp_location_id,isaddmailtextautomatically,r_defaultmailtext_id,ad_image_id,isnoexpire,issupportuser,isbillto,isshipto,isvendorlead +from ad_user +where ad_user_id=0 +; + -- Feb 7, 2022, 9:52:47 PM CET -UPDATE AD_User SET IsActive='N',Password=NULL,Updated=TO_DATE('2022-02-07 21:52:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_User_ID=0 AND IsActive='Y' +UPDATE AD_User SET name='System (deprecated)',email='system deprecated @ idempiere.com',value='systemdeprecated',IsActive='N',password=NULL,Updated=TO_DATE('2022-02-07 21:52:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_User_ID=0 ; --- Feb 7, 2022, 9:52:55 PM CET -UPDATE AD_User_Roles SET IsActive='N',Updated=TO_DATE('2022-02-07 21:52:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Role_ID=0 AND AD_User_ID=0 AND IsActive='Y' -; +UPDATE AD_AlertProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; --- Feb 7, 2022, 10:49:09 PM CET -UPDATE AD_SchedulerRecipient SET AD_User_ID=100,Updated=TO_DATE('2022-02-07 22:49:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_User_ID=0 -; +UPDATE AD_AlertRecipient SET AD_User_ID=10 WHERE AD_User_ID=0; --- Feb 7, 2022, 10:59:05 PM CET -UPDATE AD_AlertProcessor SET Supervisor_ID=100,Updated=TO_DATE('2022-02-07 22:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE Supervisor_ID=0 -; +UPDATE AD_AttachmentNote SET AD_User_ID=10 WHERE AD_User_ID=0; --- Feb 7, 2022, 10:59:05 PM CET -UPDATE AD_LdapProcessor SET Supervisor_ID=100,Updated=TO_DATE('2022-02-07 22:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE Supervisor_ID=0 -; +UPDATE AD_AuthorizationAccount SET AD_User_ID=10 WHERE AD_User_ID=0; --- Feb 7, 2022, 10:59:05 PM CET -UPDATE AD_Scheduler SET Supervisor_ID=100,Updated=TO_DATE('2022-02-07 22:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE Supervisor_ID=0 -; +UPDATE AD_BroadcastMessage SET AD_User_ID=10 WHERE AD_User_ID=0; --- Feb 7, 2022, 10:59:05 PM CET -UPDATE AD_WorkflowProcessor SET Supervisor_ID=100,Updated=TO_DATE('2022-02-07 22:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE Supervisor_ID=0 -; +UPDATE AD_LdapProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_Note SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_OrgInfo SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_Password_History SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Preference SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Private_Access SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_RecentItem SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Role SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_Scheduler SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_SchedulerRecipient SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Tab_Customization SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Tree_Favorite SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_User SET SalesRep_ID=10 WHERE SalesRep_ID=0; + +UPDATE AD_User SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_User_Roles SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_User_Substitute SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_User_Substitute SET Substitute_ID=10 WHERE Substitute_ID=0; + +UPDATE AD_UserPreference SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_UserQuery SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Wlistbox_Customization SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_WorkflowProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE C_AcctProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE MFA_RegisteredDevice SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE MFA_Registration SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DashboardContent SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DashboardContent_Access SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DashboardPreference SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DocumentStatus SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DocumentStatusAccess SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE R_Request SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE R_Request SET SalesRep_ID=10 WHERE SalesRep_ID=0; + +UPDATE R_RequestProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE R_RequestProcessor_Route SET AD_User_ID=10 WHERE AD_User_ID=0; SELECT register_migration_script('202202072157_IDEMPIERE-5174.sql') FROM dual ; diff --git a/migration/iD10/postgresql/202202072157_IDEMPIERE-5174.sql b/migration/iD10/postgresql/202202072157_IDEMPIERE-5174.sql index 04b96f6762..1d4e909359 100644 --- a/migration/iD10/postgresql/202202072157_IDEMPIERE-5174.sql +++ b/migration/iD10/postgresql/202202072157_IDEMPIERE-5174.sql @@ -1,31 +1,91 @@ -- IDEMPIERE-5174 Deactivate System user + +insert into ad_user (ad_user_id,ad_client_id,ad_org_id,isactive,created,createdby,updated,updatedby,name,description,password,email,supervisor_id,c_bpartner_id,processing,emailuser,emailuserpw,c_bpartner_location_id,c_greeting_id,title,comments,phone,phone2,fax,lastcontact,lastresult,birthday,ad_orgtrx_id,emailverify,emailverifydate,notificationtype,isfullbpaccess,c_job_id,ldapuser,connectionprofile,value,userpin,isinpayroll,ad_user_uu,ismenuautoexpand,salt,islocked,dateaccountlocked,failedlogincount,datepasswordchanged,datelastlogin,isnopasswordreset,isexpired,securityquestion,answer,issaleslead,c_location_id,leadsource,leadstatus,leadsourcedescription,leadstatusdescription,c_campaign_id,salesrep_id,bpname,bp_location_id,isaddmailtextautomatically,r_defaultmailtext_id,ad_image_id,isnoexpire,issupportuser,isbillto,isshipto,isvendorlead) +select +10,ad_client_id,ad_org_id,isactive,created,createdby,updated,updatedby,name,description,password,email,supervisor_id,c_bpartner_id,processing,emailuser,emailuserpw,c_bpartner_location_id,c_greeting_id,title,comments,phone,phone2,fax,lastcontact,lastresult,birthday,ad_orgtrx_id,emailverify,emailverifydate,notificationtype,isfullbpaccess,c_job_id,ldapuser,connectionprofile,value,userpin,isinpayroll,'98acf599-bd19-4439-a8b6-958ac247d680',ismenuautoexpand,salt,islocked,dateaccountlocked,failedlogincount,datepasswordchanged,datelastlogin,isnopasswordreset,isexpired,securityquestion,answer,issaleslead,c_location_id,leadsource,leadstatus,leadsourcedescription,leadstatusdescription,c_campaign_id,salesrep_id,bpname,bp_location_id,isaddmailtextautomatically,r_defaultmailtext_id,ad_image_id,isnoexpire,issupportuser,isbillto,isshipto,isvendorlead +from ad_user +where ad_user_id=0 +; + -- Feb 7, 2022, 9:52:47 PM CET -UPDATE AD_User SET IsActive='N',Password=NULL,Updated=TO_TIMESTAMP('2022-02-07 21:52:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_User_ID=0 AND IsActive='Y' +UPDATE AD_User SET name='System (deprecated)',email='system deprecated @ idempiere.com',value='systemdeprecated',IsActive='N',password=NULL,Updated=TO_TIMESTAMP('2022-02-07 21:52:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_User_ID=0 ; --- Feb 7, 2022, 9:52:55 PM CET -UPDATE AD_User_Roles SET IsActive='N',Updated=TO_TIMESTAMP('2022-02-07 21:52:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Role_ID=0 AND AD_User_ID=0 AND IsActive='Y' -; +UPDATE AD_AlertProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; --- Feb 7, 2022, 10:49:09 PM CET -UPDATE AD_SchedulerRecipient SET AD_User_ID=100,Updated=TO_TIMESTAMP('2022-02-07 22:49:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_User_ID=0 -; +UPDATE AD_AlertRecipient SET AD_User_ID=10 WHERE AD_User_ID=0; --- Feb 7, 2022, 10:59:05 PM CET -UPDATE AD_AlertProcessor SET Supervisor_ID=100,Updated=TO_TIMESTAMP('2022-02-07 22:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE Supervisor_ID=0 -; +UPDATE AD_AttachmentNote SET AD_User_ID=10 WHERE AD_User_ID=0; --- Feb 7, 2022, 10:59:05 PM CET -UPDATE AD_LdapProcessor SET Supervisor_ID=100,Updated=TO_TIMESTAMP('2022-02-07 22:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE Supervisor_ID=0 -; +UPDATE AD_AuthorizationAccount SET AD_User_ID=10 WHERE AD_User_ID=0; --- Feb 7, 2022, 10:59:05 PM CET -UPDATE AD_Scheduler SET Supervisor_ID=100,Updated=TO_TIMESTAMP('2022-02-07 22:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE Supervisor_ID=0 -; +UPDATE AD_BroadcastMessage SET AD_User_ID=10 WHERE AD_User_ID=0; --- Feb 7, 2022, 10:59:05 PM CET -UPDATE AD_WorkflowProcessor SET Supervisor_ID=100,Updated=TO_TIMESTAMP('2022-02-07 22:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE Supervisor_ID=0 -; +UPDATE AD_LdapProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_Note SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_OrgInfo SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_Password_History SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Preference SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Private_Access SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_RecentItem SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Role SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_Scheduler SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_SchedulerRecipient SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Tab_Customization SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Tree_Favorite SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_User SET SalesRep_ID=10 WHERE SalesRep_ID=0; + +UPDATE AD_User SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE AD_User_Roles SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_User_Substitute SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_User_Substitute SET Substitute_ID=10 WHERE Substitute_ID=0; + +UPDATE AD_UserPreference SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_UserQuery SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_Wlistbox_Customization SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE AD_WorkflowProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE C_AcctProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE MFA_RegisteredDevice SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE MFA_Registration SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DashboardContent SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DashboardContent_Access SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DashboardPreference SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DocumentStatus SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE PA_DocumentStatusAccess SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE R_Request SET AD_User_ID=10 WHERE AD_User_ID=0; + +UPDATE R_Request SET SalesRep_ID=10 WHERE SalesRep_ID=0; + +UPDATE R_RequestProcessor SET Supervisor_ID=10 WHERE Supervisor_ID=0; + +UPDATE R_RequestProcessor_Route SET AD_User_ID=10 WHERE AD_User_ID=0; SELECT register_migration_script('202202072157_IDEMPIERE-5174.sql') FROM dual ; diff --git a/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/zul/login/login-info.zul b/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/zul/login/login-info.zul index ea19cf913d..927b26d144 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/zul/login/login-info.zul +++ b/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/zul/login/login-info.zul @@ -50,6 +50,12 @@ Copyright (C) 2009 Idalica Corporation System + +System +system @ idempiere.com +System + +