Index: lams_central/src/java/org/lamsfoundation/lams/security/UniversalLoginModule.java =================================================================== diff -u -r3920fca37b6f52d187d97b632a22adc545ae0492 -r265feb3ba727127cf34550916a7e48c0f5ccfb97 --- lams_central/src/java/org/lamsfoundation/lams/security/UniversalLoginModule.java (.../UniversalLoginModule.java) (revision 3920fca37b6f52d187d97b632a22adc545ae0492) +++ lams_central/src/java/org/lamsfoundation/lams/security/UniversalLoginModule.java (.../UniversalLoginModule.java) (revision 265feb3ba727127cf34550916a7e48c0f5ccfb97) @@ -97,14 +97,14 @@ String username = getUsername(); WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(HttpSessionManager.getInstance().getServletContext()); UserManagementService service = (UserManagementService) ctx.getBean("userManagementService"); - LdapService ldapService = (LdapService) ctx.getBean("ldapService"); User user = service.getUserByLogin(username); log.debug("===> authenticating user: " + username); // LDAP user provisioning if (user == null) { // provision a new user by checking ldap server if (Configuration.getAsBoolean(ConfigurationKeys.LDAP_PROVISIONING_ENABLED)) { + LdapService ldapService = (LdapService) ctx.getBean("ldapService"); log.debug("===> LDAP provisioning is enabled, checking username against LDAP server..."); LDAPAuthenticator ldap = new LDAPAuthenticator(); isValid = ldap.authenticate(username, inputPassword);