Search in sources :

Example 1 with SQLException

use of com.twinsoft.tas.SQLException 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;
}
Also used : BufferedReader(java.io.BufferedReader) FileReader(java.io.FileReader) File(java.io.File) ApplicationException(com.twinsoft.tas.ApplicationException) MessagingException(javax.mail.MessagingException) IOException(java.io.IOException) SQLException(com.twinsoft.tas.SQLException) ParsingException(com.twinsoft.tas.ParsingException)

Aggregations

ApplicationException (com.twinsoft.tas.ApplicationException)1 ParsingException (com.twinsoft.tas.ParsingException)1 SQLException (com.twinsoft.tas.SQLException)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileReader (java.io.FileReader)1 IOException (java.io.IOException)1 MessagingException (javax.mail.MessagingException)1