IDEMPIERE-2379 Problem encrypting AD_Client.RequestUserPw

This commit is contained in:
Carlos Ruiz 2014-12-29 19:51:55 -05:00
parent 58fdf77dd8
commit 8eb5a01501
2 changed files with 17 additions and 2 deletions

View File

@ -3232,7 +3232,7 @@ public class GridTable extends AbstractTableModel
{ {
String str = rs.getString(j+1); String str = rs.getString(j+1);
if (field.isEncryptedColumn()) if (field.isEncryptedColumn())
str = (String)decrypt(str, getAD_Client_ID()); str = (String)decrypt(str, getAD_Client_ID(rs));
rowData[j] = new Boolean ("Y".equals(str)); // Boolean rowData[j] = new Boolean ("Y".equals(str)); // Boolean
} }
// LOB // LOB
@ -3263,7 +3263,7 @@ public class GridTable extends AbstractTableModel
rowData[j] = rs.getString(j+1); // String rowData[j] = rs.getString(j+1); // String
// Encrypted // Encrypted
if (field.isEncryptedColumn() && displayType != DisplayType.YesNo) if (field.isEncryptedColumn() && displayType != DisplayType.YesNo)
rowData[j] = decrypt(rowData[j], getAD_Client_ID()); rowData[j] = decrypt(rowData[j], getAD_Client_ID(rs));
} }
} }
catch (SQLException e) catch (SQLException e)
@ -3297,6 +3297,20 @@ public class GridTable extends AbstractTableModel
return SecureEngine.decrypt(yy, AD_Client_ID); return SecureEngine.decrypt(yy, AD_Client_ID);
} // decrypt } // decrypt
private int getAD_Client_ID(ResultSet rs) {
int AD_Client_ID = -1;
try {
AD_Client_ID = rs.getInt("AD_Client_ID");
if (rs.wasNull())
AD_Client_ID = -1;
} catch (SQLException e) {
AD_Client_ID = -1;
}
if (AD_Client_ID == -1)
AD_Client_ID = getAD_Client_ID();
return AD_Client_ID;
}
private int getAD_Client_ID() private int getAD_Client_ID()
{ {
int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx());

View File

@ -165,6 +165,7 @@ public class POInfo implements Serializable
+ " AND c.IsActive='Y'"); + " AND c.IsActive='Y'");
if (!baseLanguage) if (!baseLanguage)
sql.append(" AND e.AD_Language='").append(Env.getAD_Language(m_ctx)).append("'"); sql.append(" AND e.AD_Language='").append(Env.getAD_Language(m_ctx)).append("'");
sql.append(" ORDER BY c.AD_Column_ID");
// //
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;