Peer review from a suggested patch from Hiep Lq -> IDEMPIERE-3408 Encrypted Field can explore by normal user
This commit is contained in:
parent
462f0e799f
commit
10be967c75
|
@ -89,6 +89,8 @@ public class Obscure extends Object
|
||||||
public static final String OBSCURETYPE_ObscureAlphaNumericButFirstLast4 = "A44";
|
public static final String OBSCURETYPE_ObscureAlphaNumericButFirstLast4 = "A44";
|
||||||
/** Obscure AlphaNumeric but last 4 = A04 */
|
/** Obscure AlphaNumeric but last 4 = A04 */
|
||||||
public static final String OBSCURETYPE_ObscureAlphaNumericButLast4 = "A04";
|
public static final String OBSCURETYPE_ObscureAlphaNumericButLast4 = "A04";
|
||||||
|
/** Obscure by asterisk character, use for EncryptedField */
|
||||||
|
public static final String OBSCURETYPE_ObscureAllAsterisk = "AA";
|
||||||
|
|
||||||
/** Obscure Type */
|
/** Obscure Type */
|
||||||
private String m_type = OBSCURETYPE_ObscureDigitsButLast4;
|
private String m_type = OBSCURETYPE_ObscureDigitsButLast4;
|
||||||
|
@ -103,7 +105,8 @@ public class Obscure extends Object
|
||||||
*/
|
*/
|
||||||
public void setType (String obscureType)
|
public void setType (String obscureType)
|
||||||
{
|
{
|
||||||
if (obscureType == null || obscureType.equals("904") || obscureType.equals("944") || obscureType.equals("A44") || obscureType.equals("A04"))
|
if (obscureType == null || obscureType.equals("904") || obscureType.equals("944") || obscureType.equals("A44") || obscureType.equals("A04") ||
|
||||||
|
OBSCURETYPE_ObscureAllAsterisk.equals(obscureType))
|
||||||
{
|
{
|
||||||
m_type = obscureType;
|
m_type = obscureType;
|
||||||
m_obscuredValue = null;
|
m_obscuredValue = null;
|
||||||
|
@ -161,6 +164,11 @@ public class Obscure extends Object
|
||||||
return m_obscuredValue;
|
return m_obscuredValue;
|
||||||
if (m_clearValue == null || m_clearValue.length() == 0)
|
if (m_clearValue == null || m_clearValue.length() == 0)
|
||||||
return m_clearValue;
|
return m_clearValue;
|
||||||
|
|
||||||
|
if (OBSCURETYPE_ObscureAllAsterisk.equals(m_type)){
|
||||||
|
return "**********";
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
boolean alpha = m_type.charAt(0) == 'A';
|
boolean alpha = m_type.charAt(0) == 'A';
|
||||||
int clearStart = Integer.parseInt(m_type.substring(1,2));
|
int clearStart = Integer.parseInt(m_type.substring(1,2));
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class Textbox extends org.zkoss.zul.Textbox implements EventListener<Even
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 2201466028538929955L;
|
private static final long serialVersionUID = -3919623360765045602L;
|
||||||
|
|
||||||
private Obscure m_obscure = null;
|
private Obscure m_obscure = null;
|
||||||
|
|
||||||
|
@ -118,4 +118,12 @@ public class Textbox extends org.zkoss.zul.Textbox implements EventListener<Even
|
||||||
setValue(getValue());
|
setValue(getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setType(String type) throws WrongValueException {
|
||||||
|
if ("password".equals(type))
|
||||||
|
setObscureType(Obscure.OBSCURETYPE_ObscureAllAsterisk);
|
||||||
|
super.setType(type);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -258,6 +258,7 @@ public class ResetPasswordPanel extends Window implements EventListener<Event>
|
||||||
txtSecurityQuestion.setVisible(false);
|
txtSecurityQuestion.setVisible(false);
|
||||||
|
|
||||||
txtAnswer = new Textbox();
|
txtAnswer = new Textbox();
|
||||||
|
txtAnswer.setType("password");
|
||||||
txtAnswer.setId("txtAnswer");
|
txtAnswer.setId("txtAnswer");
|
||||||
// txtAnswer.setType("password");
|
// txtAnswer.setType("password");
|
||||||
txtAnswer.setCols(25);
|
txtAnswer.setCols(25);
|
||||||
|
|
Loading…
Reference in New Issue