Skip to content

Commit

Permalink
Check and error if omero.ldap.config is not set correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-allan committed Jan 11, 2024
1 parent 27eefa7 commit dbfc35e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/com/glencoesoftware/ldaptool/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ private int executionStrategy(ParseResult parseResult) {
&& !parseResult.isVersionHelpRequested()) {
try {
init();
} catch (RuntimeException re) {
throw re;
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -133,6 +135,10 @@ public void init() throws IOException {
"classpath:ome/services/datalayer.xml",
"classpath*:beanRefContext.xml"});
ldapImpl = (LdapImpl) context.getBean("internal-ome.api.ILdap");
if (!ldapImpl.getSetting()) {
throw new RuntimeException(
"LDAP is not enabled, is `omero.ldap.config` set?");
}
ldapTemplate = (LdapTemplate) context.getBean("ldapTemplate");
}
}

0 comments on commit dbfc35e

Please sign in to comment.