IDEMPIERE-4844 Cross tenant issue on Forgot My Password (#737)
This commit is contained in:
parent
9ad3f5ce46
commit
594c7bb437
|
@ -56,6 +56,7 @@ import org.compiere.model.MSession;
|
|||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.model.MSystem;
|
||||
import org.compiere.model.MUser;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
|
@ -687,10 +688,16 @@ public class LoginPanel extends Window implements EventListener<Event>
|
|||
.append(" AND AD_User.SecurityQuestion IS NOT NULL")
|
||||
.append(" AND AD_User.Answer IS NOT NULL");
|
||||
|
||||
List<MUser> users = new Query(ctx, MUser.Table_Name, whereClause.toString(), null)
|
||||
.setParameters(userId)
|
||||
.setOrderBy(MUser.COLUMNNAME_AD_User_ID)
|
||||
.list();
|
||||
List<MUser> users;
|
||||
try {
|
||||
PO.setCrossTenantSafe();
|
||||
users = new Query(ctx, MUser.Table_Name, whereClause.toString(), null)
|
||||
.setParameters(userId)
|
||||
.setOrderBy(MUser.COLUMNNAME_AD_User_ID)
|
||||
.list();
|
||||
} finally {
|
||||
PO.clearCrossTenantSafe();
|
||||
}
|
||||
|
||||
wndLogin.resetPassword(userId, users.size() == 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue