Index: lams_build/conf/unix/authentication/lamsauthentication.xml =================================================================== RCS file: /usr/local/cvsroot/lams_build/conf/unix/authentication/Attic/lamsauthentication.xml,v diff -u -r1.2 -r1.3 --- lams_build/conf/unix/authentication/lamsauthentication.xml 21 Nov 2006 06:15:39 -0000 1.2 +++ lams_build/conf/unix/authentication/lamsauthentication.xml 7 May 2007 06:11:31 -0000 1.3 @@ -5,16 +5,24 @@ com.sun.jndi.ldap.LdapCtxFactory - ldap://mams.melcoe.mq.edu.au:636 + ldap://192.168.111.35 simple - ssl - uid= - ,ou=mams,dc=melcoe,dc=mq,dc=edu,dc=au - java:/MySqlDS + cn= + ,dc=melcoe,dc=local + java:/jdbc/lams-ds select password from lams_user where login=? - select name,'Roles' from lams_role, lams_user where login=? + + SELECT DISTINCT r.name,'Roles' FROM + lams_user u LEFT OUTER JOIN lams_user_organisation uo USING(user_id) + LEFT OUTER JOIN lams_user_organisation_role urr USING(user_organisation_id) + LEFT OUTER JOIN lams_role r USING (role_id) + WHERE u.login=? + + Index: lams_build/conf/windows/authentication/lamsauthentication.xml =================================================================== RCS file: /usr/local/cvsroot/lams_build/conf/windows/authentication/Attic/lamsauthentication.xml,v diff -u -r1.2 -r1.3 --- lams_build/conf/windows/authentication/lamsauthentication.xml 21 Nov 2006 06:15:40 -0000 1.2 +++ lams_build/conf/windows/authentication/lamsauthentication.xml 7 May 2007 06:09:55 -0000 1.3 @@ -5,12 +5,11 @@ com.sun.jndi.ldap.LdapCtxFactory - ldap://mams.melcoe.mq.edu.au:636 + ldap://192.168.111.35 simple - ssl - uid= - ,ou=mams,dc=melcoe,dc=mq,dc=edu,dc=au - java:/MySqlDS + cn= + ,dc=melcoe,dc=local + java:/jdbc/lams-ds select password from lams_user where login=? SELECT DISTINCT r.name,'Roles' FROM @@ -19,8 +18,11 @@ LEFT OUTER JOIN lams_role r USING (role_id) WHERE u.login=? + Index: lams_central/src/java/org/lamsfoundation/lams/security/LDAPAuthenticator.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/security/LDAPAuthenticator.java,v diff -u -r1.4 -r1.5 --- lams_central/src/java/org/lamsfoundation/lams/security/LDAPAuthenticator.java 17 Sep 2006 06:12:05 -0000 1.4 +++ lams_central/src/java/org/lamsfoundation/lams/security/LDAPAuthenticator.java 7 May 2007 06:09:53 -0000 1.5 @@ -70,7 +70,6 @@ // Load all authentication method parameters into env env.setProperty(Context.INITIAL_CONTEXT_FACTORY, method.getParameterByName(Context.INITIAL_CONTEXT_FACTORY).getValue()); env.setProperty(Context.SECURITY_AUTHENTICATION, method.getParameterByName(Context.SECURITY_AUTHENTICATION).getValue()); - env.setProperty(Context.SECURITY_PROTOCOL, method.getParameterByName(Context.SECURITY_PROTOCOL).getValue()); String principalDNPrefix = method.getParameterByName(PRINCIPAL_DN_PREFIX_OPT).getValue(); String principalDNSuffix = method.getParameterByName(PRINCIPAL_DN_SUFFIX_OPT).getValue(); @@ -79,19 +78,26 @@ env.setProperty(Context.PROVIDER_URL, method.getParameterByName(Context.PROVIDER_URL).getValue()); env.put(Context.SECURITY_CREDENTIALS, credential); - + Object originalTrustStore = System.getProperty("javax.net.ssl.trustStore"); Object originalTrustPass = System.getProperty("javax.net.ssl.trustStorePassword"); - //FIXME: synchronization issue: dynamically load certificate into - // system instead of overwritting it. - System.setProperty("javax.net.ssl.trustStore", method.getParameterByName("truststore.path").getValue()); - System.setProperty("javax.net.ssl.trustStorePassword", method.getParameterByName("truststore.password").getValue()); + + // optional parameters + try { + env.setProperty(Context.SECURITY_PROTOCOL, method.getParameterByName(Context.SECURITY_PROTOCOL).getValue()); + log.debug("security.protocol: "+method.getParameterByName(Context.SECURITY_PROTOCOL).getValue()); + // FIXME: synchronization issue: dynamically load certificate into + // system instead of overwritting it. + System.setProperty("javax.net.ssl.trustStore", method.getParameterByName("truststore.path").getValue()); + System.setProperty("javax.net.ssl.trustStorePassword", method.getParameterByName("truststore.password").getValue()); + } catch(NullPointerException e) { + } log.debug("===> LDAP authenticator: " + env); InitialLdapContext ctx = null; try { - ctx = new InitialLdapContext(env, null); + ctx = new InitialLdapContext(env, null);System.out.println(ctx); log.debug("===> ldap context created: "+ctx); return true; } catch (Exception e) {