IDEMPIERE-5857 Cross tenant on Reset Password (#2015)

* IDEMPIERE-5857 Cross tenant on Reset Password

* - Change logic following suggestion from Heng Sin
This commit is contained in:
Carlos Ruiz 2023-09-20 05:24:00 +02:00 committed by GitHub
parent 7c486df524
commit 93c275722c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -42,6 +42,7 @@ import org.compiere.model.MPasswordHistory;
import org.compiere.model.MPasswordRule;
import org.compiere.model.MSysConfig;
import org.compiere.model.MUser;
import org.compiere.model.PO;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
@ -392,10 +393,11 @@ public class WResetPassword implements IFormController, EventListener<Event>, Va
user.setIsExpired(true);
try {
user.saveEx();
}
catch(AdempiereException e)
{
if (user.getAD_Client_ID() == 0 && Env.getAD_Client_ID(Env.getCtx()) != 0)
user.saveCrossTenantSafeEx();
else
user.saveEx();
} catch(AdempiereException e) {
throw e;
}
clearForm();