Bonjour!

Nous avons un problème avec la gestion des utilisateurs LDAP dans Jahia 4.1
; en effet, lorsque ceux-ci changent de mot de passe, ce changement n'est
pas effectif dans Jahia, car ce dernier stocke en mémoire et de manière
cryptée le mot de passe de la dernière session de la personne. Cependant,
tout remarche si le serveur Jahia est redémarré ou si les caches des
utilisateurs sont flushés.

Je vous propose plutôt le changement de code suivant dans la classe
org.jahia.services.usermanager.JahiaLDAPUser (lignes 396-418, svn version
13267):

Au lieu de:

    public boolean verifyPassword (String password) {

        if (password != null) {

            if (!"".equals(mPassword)) {
                String test = JahiaUserManagerService.encryptPassword
(password);
                return mPassword.equals (test);
            }

            boolean loginResult = JahiaUserManagerLDAPProvider.getInstance
().login (mUserKey,
                    password);
            if (loginResult) {
                /** @todo here we must now update the properties of the user
                 *  since he has access to more of his attributes once
logged in
                 */
                mPassword = JahiaUserManagerService.encryptPassword
(password);
                return true;
            }
            /** @todo insert here LDAP connection check... */

        }
        return false;
    }

Quelque chose qui redirige le test infructueux avec le mot de passe crypté
vers le ldap:


    public boolean verifyPassword (String password) {

        if (password != null) {
            boolean localLoginResult = false;
            if (!"".equals(mPassword)) {
                String test = JahiaUserManagerService.encryptPassword
(password);
                localLoginResult = mPassword.equals (test);
            }
            //test the provided password with the internal memory encrypted
password.
            if(localLoginResult){
                //both passwords match.
                return true;
            }else{
                //the local encrypted password does not match the one in
parameter
                //forward to the ldap authN in case of there was a ldap
password change from the last user's visit.
                boolean loginResult =
JahiaUserManagerLDAPProvider.getInstance ().login (mUserKey,
                    password);
                if (loginResult) {
                        /** @todo here we must now update the properties of
the user
                         *  since he has access to more of his attributes
once logged in
                         */
                        mPassword = JahiaUserManagerService.encryptPassword
(password);
                        return true;
                }
                /** @todo insert here LDAP connection check... */
            }
        }
        return false;
    }


A+

Fabrice Marchon


Répondre à