BF [2956546] - Login from WEB should also use LDAPUser
https://sourceforge.net/tracker/?func=detail&aid=2956546&group_id=176962&atid=879332
This commit is contained in:
parent
bf14c33698
commit
b8f54de8f9
|
@ -171,10 +171,12 @@ public class MUser extends X_AD_User
|
||||||
int AD_Client_ID = Env.getAD_Client_ID(ctx);
|
int AD_Client_ID = Env.getAD_Client_ID(ctx);
|
||||||
|
|
||||||
MUser retValue = null;
|
MUser retValue = null;
|
||||||
/* TODO: Implement same validation as in Login.java -
|
|
||||||
* about (SELECT IsEncrypted FROM AD_Column WHERE AD_Column_ID=417)='N') */
|
|
||||||
String sql = "SELECT * FROM AD_User "
|
String sql = "SELECT * FROM AD_User "
|
||||||
+ "WHERE Name=? AND (Password=? OR Password=?) AND IsActive='Y' AND AD_Client_ID=?";
|
+ "WHERE COALESCE(LDAPUser, Name)=? " // #1
|
||||||
|
+ " AND ((Password=? AND (SELECT IsEncrypted FROM AD_Column WHERE AD_Column_ID=417)='N') " // #2
|
||||||
|
+ "OR (Password=? AND (SELECT IsEncrypted FROM AD_Column WHERE AD_Column_ID=417)='Y'))" // #3
|
||||||
|
+ " AND IsActive='Y' AND AD_Client_ID=?" // #4
|
||||||
|
;
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
|
@ -182,7 +184,7 @@ public class MUser extends X_AD_User
|
||||||
pstmt = DB.prepareStatement (sql, null);
|
pstmt = DB.prepareStatement (sql, null);
|
||||||
pstmt.setString (1, name);
|
pstmt.setString (1, name);
|
||||||
pstmt.setString (2, password);
|
pstmt.setString (2, password);
|
||||||
pstmt.setString(3, SecureEngine.encrypt(password));
|
pstmt.setString (3, SecureEngine.encrypt(password));
|
||||||
pstmt.setInt(4, AD_Client_ID);
|
pstmt.setInt(4, AD_Client_ID);
|
||||||
rs = pstmt.executeQuery ();
|
rs = pstmt.executeQuery ();
|
||||||
if (rs.next ())
|
if (rs.next ())
|
||||||
|
|
Loading…
Reference in New Issue