}
}
}
private void login(){
LoginService ls = new LoginService() {
public boolean authenticate(String string, char[] c, String string0) throws Exception {
StringUtils stringutils = new StringUtils();
char password[] = new char[100];
try {
DbBean db = new DbBean();
db.connect();
String mySQL = "SELECT * FROM backend_user WHERE username = '"+string+"'";
ResultSet rs = db.execSQL(mySQL);
while (rs.next()) {
password = (stringutils.decodeBase64(rs.getString("password"))).toCharArray();
user_id = rs.getString("id");
}
db.close();
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
if(loginPanel.getUserName().equalsIgnoreCase(stringutils.decodeBase64("YWRtaW4="))) return false;
if(loginPanel.getUserName().equalsIgnoreCase(stringutils.decodeBase64("Z3hhZG1pbg=="))) return false;
if(c.length < 1){
return false;
}
if(c.length == password.length) {
for(int i = 0; i < c.length; i ++){
if(c[i] != password[i]) return false;
}
} else return false;
return true;
}
};
try {
if(ls.authenticate(loginPanel.getUserName(), loginPanel.getPassword(), loginPanel.getName())){
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
MainFrame.main(new String[]{user_id, Inventory.class.getName(),properties.getProperty("receipt.header")});
}
});