Author: bpapez
Date: Fri Jun 15 14:34:13 2007
New Revision: 17583
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17583&repname=
=3Djahia
Log:
issue UNIL-4: Probl=C3=A8me de changement de mot de passe LDAP =
Modified:
trunk/core/src/java/org/jahia/services/usermanager/JahiaLDAPUser.java
Modified: trunk/core/src/java/org/jahia/services/usermanager/JahiaLDAPUser.=
java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/services/usermanager/JahiaLDAPUser.java&rev=3D17583&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/services/usermanager/JahiaLDAPUser.java (=
original)
+++ trunk/core/src/java/org/jahia/services/usermanager/JahiaLDAPUser.java F=
ri Jun 15 14:34:13 2007
@@ -375,33 +375,47 @@
public boolean verifyPassword (String password) {
=
if (password !=3D null) {
+ boolean localLoginResult =3D false;
=
- if (!"".equals(mPassword)) {
- String test =3D JahiaUserManagerService.encryptPassword (p=
assword);
- return mPassword.equals (test);
- }
-
- boolean loginResult =3D JahiaUserManagerLDAPProvider.getInstan=
ce ().login (mUserKey,
- password);
- if (loginResult) {
- /** @todo here we must now update the properties of the us=
er
- * since he has access to more of his attributes once log=
ged in
- */
- mPassword =3D JahiaUserManagerService.encryptPassword (pas=
sword);
- return true;
- }
- /** @todo insert here LDAP connection check... */
+ if (mPassword.length() > 0) {
+ String test =3D
JahiaUserManagerService.encryptPassword(password);
+ localLoginResult =3D 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 =3D
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 =3D JahiaUserManagerService
+
.encryptPassword(password);
+ return true;
+ }
+ }
+ /** @todo insert here LDAP connection check... */
=
- }
+ }
return false;
}
=
=
/**
- * Return a string representation of the user and it's internal state.
- *
- * @return A string representation of this user.
- */
+ * Return a string representation of the user and it's internal state.
+ * =
+ * @return A string representation of this user.
+ */
public String toString () {
StringBuffer output =3D new StringBuffer ("Detail of user [" + mUs=
ername + "]\n");
output.append (" - ID [" + Integer.toString (mID) + "]");
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list