roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r582025 - /roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
Date Thu, 04 Oct 2007 23:46:38 GMT
Author: jtb
Date: Thu Oct  4 16:46:37 2007
New Revision: 582025

URL: http://svn.apache.org/viewvc?rev=582025&view=rev
Log:
handle encrypted passwords in RAP

Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java?rev=582025&r1=582024&r2=582025&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
Thu Oct  4 16:46:37 2007
@@ -21,6 +21,8 @@
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.UserManager;
 import org.apache.roller.weblogger.pojos.User;
+import org.apache.roller.weblogger.config.WebloggerConfig;
+import org.apache.roller.weblogger.util.Utilities;
 
 /**
  * TODO
@@ -47,7 +49,12 @@
     protected void verifyUser(String userName, String password) throws HandlerException {
         User ud = getUserData(userName);
         String realpassword = ud.getPassword();
-
+        
+        boolean encrypted = Boolean.valueOf(WebloggerConfig.getProperty("passwds.encryption.enabled"));
+        if (encrypted) {
+            password = Utilities.encodePassword(password, WebloggerConfig.getProperty("passwds.encryption.algorithm"));
+        }
+        
         if (!userName.trim().equals(ud.getUserName())) {
             throw new UnauthorizedException("ERROR: User is not authorized: " + userName);
         }



Mime
View raw message