return auth;
}
public Account findOrCreateAdminAccount() throws EvasionException {
Account acc = accountDAO.findAccountByUsername("admin");
if (acc == null) {
User admin = userDAO.findById("admin");
if (admin == null) {
admin = new User();
admin.setEnabled(true);
admin.setUsername("admin");
admin.setPassword("adminadmin");
admin.setEmail("admin@localhost");
}
Person person = new Individual("", Civilite.monsieur, "admin", "admin", new Date());
defaultDAO.persist(person);
acc = new Account(admin, person);
createAccount(acc);
}
return acc;
}