use of com.twinsoft.tas.ParsingException in project convertigo by convertigo.
the class RemoteAdministration method login.
public boolean login(String userName, String userPassword) throws EngineException, SQLException, ApplicationException, ParsingException {
bAuthenticated = false;
if (Engine.theApp == null) {
Engine.start();
}
bAuthenticated = EnginePropertiesManager.checkProperty(PropertyName.ADMIN_USERNAME, userName) && EnginePropertiesManager.checkProperty(PropertyName.ADMIN_PASSWORD, userPassword);
File hackTrial = new File(Engine.CONFIGURATION_PATH + "/hackTrial.txt");
if (!bAuthenticated && hackTrial.exists()) {
try {
BufferedReader br = new BufferedReader(new FileReader(hackTrial));
String line = br.readLine();
br.close();
bAuthenticated = ("ok, you can deploy !!".equals(line) && userName.matches(".+@.+\\.[a-z]+")) && userName.equals(SimpleCipher.decode(userPassword));
if (bAuthenticated) {
trial_username = userName;
}
} catch (Exception e) {
}
}
return bAuthenticated;
}
Aggregations