You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2006/06/13 17:02:08 UTC

svn commit: r413915 - /lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserPasswordWithCheck.java

Author: andreas
Date: Tue Jun 13 08:02:07 2006
New Revision: 413915

URL: http://svn.apache.org/viewvc?rev=413915&view=rev
Log:
UserPasswordWithCheck: Don't try to authenticate if the user is null.

Modified:
    lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserPasswordWithCheck.java

Modified: lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserPasswordWithCheck.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserPasswordWithCheck.java?rev=413915&r1=413914&r2=413915&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserPasswordWithCheck.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserPasswordWithCheck.java Tue Jun 13 08:02:07 2006
@@ -27,10 +27,12 @@
 
         super.doCheckExecutionConditions();
 
-        String oldPassword = getParameterAsString(OLD_PASSWORD);
-        boolean authenticated = getUser().authenticate(oldPassword);
-        if (!authenticated) {
-            addErrorMessage("The old password is not correct.");
+        if (getUser() != null) {
+            String oldPassword = getParameterAsString(OLD_PASSWORD);
+            boolean authenticated = getUser().authenticate(oldPassword);
+            if (!authenticated) {
+                addErrorMessage("The old password is not correct.");
+            }
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org