[Castore-commits] LdapAuthentification.java 1.2.2.1 1.2.2.2

Stéphane Bouchet sbouchet at adullact1.hosting.cri74.org
Mar 7 Mar 10:07:30 CET 2006


Update of /cvsroot/castore/castore-core/src/java/fr/emn/castor/users/authentification
In directory adullact1:/tmp/cvs-serv17901/src/java/fr/emn/castor/users/authentification

Modified Files:
      Tag: v1_1_branch
	LdapAuthentification.java 
Log Message:
Mise en page

Index: LdapAuthentification.java
===================================================================
RCS file: /cvsroot/castore/castore-core/src/java/fr/emn/castor/users/authentification/LdapAuthentification.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C2 -d -r1.2.2.1 -r1.2.2.2
*** LdapAuthentification.java	24 Nov 2005 14:30:16 -0000	1.2.2.1
--- LdapAuthentification.java	7 Mar 2006 09:07:28 -0000	1.2.2.2
***************
*** 125,132 ****
          // initialisation du contexte
          envLdap = new Hashtable();
!         envLdap
!             .put(
!                 Context.INITIAL_CONTEXT_FACTORY,
!                 "com.sun.jndi.ldap.LdapCtxFactory");
  
          // recuperation proprietes Ldap
--- 125,131 ----
          // initialisation du contexte
          envLdap = new Hashtable();
!         envLdap.put(
!             Context.INITIAL_CONTEXT_FACTORY,
!             "com.sun.jndi.ldap.LdapCtxFactory");
  
          // recuperation proprietes Ldap
***************
*** 179,188 ****
              if (identifiant.equals("demo") && motDePasse.equals("demo")) {
                  HashMap demo = new HashMap();
!                 demo
!                     .put(
!                         UsersConstants.INFO_USER_TYPE,
!                         UsersConstants.USERTYPE_USER);
!                 demo
!                     .put(UsersConstants.INFO_USER_GROUPE_NATIF, new ArrayList());
                  demo.put(UsersConstants.INFO_USER_NAME, "Utilisateur demo");
                  return demo;
--- 178,186 ----
              if (identifiant.equals("demo") && motDePasse.equals("demo")) {
                  HashMap demo = new HashMap();
!                 demo.put(
!                     UsersConstants.INFO_USER_TYPE,
!                     UsersConstants.USERTYPE_USER);
!                 demo.put(
!                     UsersConstants.INFO_USER_GROUPE_NATIF, new ArrayList());
                  demo.put(UsersConstants.INFO_USER_NAME, "Utilisateur demo");
                  return demo;
***************
*** 246,250 ****
                          // on essaye de s'authentifier
                          // avec le mot de passe donne par l'utilisateur
!                         envLdap.put(Context.SECURITY_AUTHENTICATION, "simple");
                          ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, dn);
                          ctx.addToEnvironment(
--- 244,249 ----
                          // on essaye de s'authentifier
                          // avec le mot de passe donne par l'utilisateur
!                         envLdap.put(
!                             Context.SECURITY_AUTHENTICATION, "simple");
                          ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, dn);
                          ctx.addToEnvironment(
***************
*** 287,293 ****
                      castorType = UsersConstants.USERTYPE_USER;
                  }
!                 if (isUserType(PropertiesHelper
!                     .getProperty("castortype.supervisor.key"), PropertiesHelper
!                     .getProperty("castortype.supervisor.value"), attrs)) {
                      castorType = UsersConstants.USERTYPE_SUPERVISOR;
                  }
--- 286,294 ----
                      castorType = UsersConstants.USERTYPE_USER;
                  }
!                 if (isUserType(
!                     PropertiesHelper
!                         .getProperty("castortype.supervisor.key"),
!                     PropertiesHelper
!                         .getProperty("castortype.supervisor.value"), attrs)) {
                      castorType = UsersConstants.USERTYPE_SUPERVISOR;
                  }
***************
*** 296,300 ****
                          .getProperty("castortype.documentalist.key"),
                      PropertiesHelper
!                         .getProperty("castortype.documentalist.value"), attrs)) {
                      castorType = UsersConstants.USERTYPE_DOCUMENTALIST;
                  }
--- 297,302 ----
                          .getProperty("castortype.documentalist.key"),
                      PropertiesHelper
!                         .getProperty("castortype.documentalist.value"),
!                     attrs)) {
                      castorType = UsersConstants.USERTYPE_DOCUMENTALIST;
                  }
***************
*** 302,308 ****
                      // on a trouve le type d'utilisateur
                      if (log.isDebugEnabled()) {
!                         log
!                             .debug("L'utilisateur est du profil : "
!                                     + castorType);
                      }
                  } else {
--- 304,309 ----
                      // on a trouve le type d'utilisateur
                      if (log.isDebugEnabled()) {
!                         log.debug("L'utilisateur est du profil : "
!                                 + castorType);
                      }
                  } else {
***************
*** 439,444 ****
              String supervisorValue = PropertiesHelper
                  .getProperty("castortype.supervisor.value");
!             String filter = "(&(" + this.ldapSearchNamePredicat + "=*" + query
!                     + "*)(" + supervisorPredicat + "=" + supervisorValue + "))";
  
              NamingEnumeration results = ctx.search(
--- 440,446 ----
              String supervisorValue = PropertiesHelper
                  .getProperty("castortype.supervisor.value");
!             String filter = "(&(" + this.ldapSearchNamePredicat + "=*"
!                     + query + "*)(" + supervisorPredicat + "="
!                     + supervisorValue + "))";
  
              NamingEnumeration results = ctx.search(
***************
*** 451,455 ****
              // on a trouvé des gens !
              while (results.hasMoreElements()) {
!                 SearchResult nextResult = (SearchResult) results.nextElement();
                  Attributes attrs = nextResult.getAttributes();
                  Attribute attr = attrs.get(this.ldapSearchNamePredicat);
--- 453,458 ----
              // on a trouvé des gens !
              while (results.hasMoreElements()) {
!                 SearchResult nextResult = (SearchResult) results
!                     .nextElement();
                  Attributes attrs = nextResult.getAttributes();
                  Attribute attr = attrs.get(this.ldapSearchNamePredicat);
***************
*** 464,468 ****
                          result.put(
                              UsersConstants.SEARCH_TUTOR_LOGIN, tutorLogin);
!                         result.put(UsersConstants.SEARCH_TUTOR_NAME, tutorName);
                          resultList.add(result);
                      }
--- 467,472 ----
                          result.put(
                              UsersConstants.SEARCH_TUTOR_LOGIN, tutorLogin);
!                         result.put(
!                             UsersConstants.SEARCH_TUTOR_NAME, tutorName);
                          resultList.add(result);
                      }
***************
*** 511,517 ****
                      castorType = UsersConstants.USERTYPE_USER;
                  }
!                 if (isUserType(PropertiesHelper
!                     .getProperty("castortype.supervisor.key"), PropertiesHelper
!                     .getProperty("castortype.supervisor.value"), attrs)) {
                      castorType = UsersConstants.USERTYPE_SUPERVISOR;
                  }
--- 515,523 ----
                      castorType = UsersConstants.USERTYPE_USER;
                  }
!                 if (isUserType(
!                     PropertiesHelper
!                         .getProperty("castortype.supervisor.key"),
!                     PropertiesHelper
!                         .getProperty("castortype.supervisor.value"), attrs)) {
                      castorType = UsersConstants.USERTYPE_SUPERVISOR;
                  }
***************
*** 520,524 ****
                          .getProperty("castortype.documentalist.key"),
                      PropertiesHelper
!                         .getProperty("castortype.documentalist.value"), attrs)) {
                      castorType = UsersConstants.USERTYPE_DOCUMENTALIST;
                  }
--- 526,531 ----
                          .getProperty("castortype.documentalist.key"),
                      PropertiesHelper
!                         .getProperty("castortype.documentalist.value"),
!                     attrs)) {
                      castorType = UsersConstants.USERTYPE_DOCUMENTALIST;
                  }
***************
*** 526,532 ****
                      // on a trouve le type d'utilisateur
                      if (log.isDebugEnabled()) {
!                         log
!                             .debug("L'utilisateur est du profil : "
!                                     + castorType);
                      }
                  } else {
--- 533,538 ----
                      // on a trouve le type d'utilisateur
                      if (log.isDebugEnabled()) {
!                         log.debug("L'utilisateur est du profil : "
!                                 + castorType);
                      }
                  } else {




Plus d'informations sur la liste de diffusion Castore-commits