diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java index 77eb6a8edc..2a582fe788 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java @@ -61,28 +61,28 @@ public class ChangePasswordPanel extends Window implements EventListener private static CLogger logger = CLogger.getCLogger(ChangePasswordPanel.class); - private LoginWindow wndLogin; + protected LoginWindow wndLogin; /** Context */ - private Properties m_ctx; + protected Properties m_ctx; /** Username */ - private String m_userName; + protected String m_userName; /** Password */ - private String m_userPassword; - private KeyNamePair[] m_clientKNPairs; + protected String m_userPassword; + protected KeyNamePair[] m_clientKNPairs; - private boolean m_show = true; + protected boolean m_show = true; - private Label lblOldPassword; - private Label lblNewPassword; - private Label lblRetypeNewPassword; - private Label lblSecurityQuestion; - private Label lblAnswer; - private Combobox lstSecurityQuestion; - private Textbox txtOldPassword; - private Textbox txtNewPassword; - private Textbox txtRetypeNewPassword; - private Textbox txtAnswer; + protected Label lblOldPassword; + protected Label lblNewPassword; + protected Label lblRetypeNewPassword; + protected Label lblSecurityQuestion; + protected Label lblAnswer; + protected Combobox lstSecurityQuestion; + protected Textbox txtOldPassword; + protected Textbox txtNewPassword; + protected Textbox txtRetypeNewPassword; + protected Textbox txtAnswer; public ChangePasswordPanel(Properties ctx, LoginWindow loginWindow, String userName, String userPassword, boolean show, KeyNamePair[] clientsKNPairs) { @@ -96,11 +96,16 @@ public class ChangePasswordPanel extends Window implements EventListener initComponents(); init(); this.setId("changePasswordPanel"); + this.setSclass("login-box"); } private void init() { - Div div = new Div(); + createUI(); + } + + protected void createUI() { + Div div = new Div(); div.setSclass(ITheme.LOGIN_BOX_HEADER_CLASS); Label label = new Label(Msg.getMsg(m_ctx, "ChangePassword")); label.setSclass(ITheme.LOGIN_BOX_HEADER_TXT_CLASS); @@ -195,7 +200,7 @@ public class ChangePasswordPanel extends Window implements EventListener pnlButtons.getButton(ConfirmPanel.A_CANCEL).setSclass(ITheme.LOGIN_BUTTON_CLASS); div.appendChild(pnlButtons); this.appendChild(div); - } + } private void initComponents() { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index 61e96cc1f2..2e505968de 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -69,32 +69,32 @@ public class ResetPasswordPanel extends Window implements EventListener private static CLogger logger = CLogger.getCLogger(ResetPasswordPanel.class); - private static final int MAX_RESET_PASSWORD_TRIES = 3; + protected static final int MAX_RESET_PASSWORD_TRIES = 3; protected static final int NO_OF_SECURITY_QUESTION = 5; protected static final String SECURITY_QUESTION_PREFIX = "SecurityQuestion_"; - private static final String RESET_PASSWORD_MAIL_TEXT_NAME = "Reset Password"; + protected static final String RESET_PASSWORD_MAIL_TEXT_NAME = "Reset Password"; - private LoginWindow wndLogin; + protected LoginWindow wndLogin; /** Context */ - private Properties m_ctx; + protected Properties m_ctx; /** Username */ - private String m_userName; + protected String m_userName; /** No Security Question */ - private boolean m_noSecurityQuestion; + protected boolean m_noSecurityQuestion; /** Tries Counter */ - private int counter; + protected int counter; /** EMail Login preference */ - boolean m_email_login = false; + protected boolean m_email_login = false; - private Label lblSecurityQuestion; - private Label lblAnswer; - private Label lblUserId; - private Label lblEmail; - private Textbox txtSecurityQuestion; - private Textbox txtAnswer; - private Textbox txtUserId; - private Textbox txtEmail; + protected Label lblSecurityQuestion; + protected Label lblAnswer; + protected Label lblUserId; + protected Label lblEmail; + protected Textbox txtSecurityQuestion; + protected Textbox txtAnswer; + protected Textbox txtUserId; + protected Textbox txtEmail; public ResetPasswordPanel(Properties ctx, LoginWindow loginWindow, String userName, boolean noSecurityQuestion) { @@ -107,13 +107,18 @@ public class ResetPasswordPanel extends Window implements EventListener initComponents(); init(); this.setId("resetPasswordPanel"); + this.setSclass("login-box"); loadData(); } private void init() { - Div div = new Div(); + createUI(); + } + + protected void createUI() { + Div div = new Div(); div.setSclass(ITheme.LOGIN_BOX_HEADER_CLASS); Label label = new Label(Msg.getMsg(m_ctx, "ForgotMyPassword")); label.setSclass(ITheme.LOGIN_BOX_HEADER_TXT_CLASS); @@ -207,7 +212,7 @@ public class ResetPasswordPanel extends Window implements EventListener pnlButtons.getButton(ConfirmPanel.A_CANCEL).setSclass(ITheme.LOGIN_BUTTON_CLASS); div.appendChild(pnlButtons); this.appendChild(div); - } + } private void initComponents() { @@ -270,7 +275,7 @@ public class ResetPasswordPanel extends Window implements EventListener } } - private void loadSecurityQuestion() + protected void loadSecurityQuestion() { String email = txtEmail.getValue(); String userid = txtUserId.getValue(); @@ -321,7 +326,7 @@ public class ResetPasswordPanel extends Window implements EventListener } } - private void validateEmail() + protected void validateEmail() { String email = txtEmail.getValue(); String userid = txtUserId.getValue(); @@ -351,7 +356,7 @@ public class ResetPasswordPanel extends Window implements EventListener loadSecurityQuestion(); } - private void validateResetPassword() + protected void validateResetPassword() { String email = txtEmail.getValue(); String userid = txtUserId.getValue(); @@ -485,7 +490,7 @@ public class ResetPasswordPanel extends Window implements EventListener } } - private boolean sendEmail(MUser to, String newPassword) + protected boolean sendEmail(MUser to, String newPassword) { MClient client = MClient.get(m_ctx, to.getAD_Client_ID());