Update of /cvsroot/roller/roller/src/org/roller/presentation
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23662/src/org/roller/presentation
Modified Files:
LoginServlet.java
Log Message:
Open up classes for inheritance.
Index: LoginServlet.java
===================================================================
RCS file: /cvsroot/roller/roller/src/org/roller/presentation/LoginServlet.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** LoginServlet.java 21 Mar 2004 04:33:56 -0000 1.8
--- LoginServlet.java 30 Jul 2004 03:43:41 -0000 1.9
***************
*** 36,44 ****
* url-pattern="/auth/*"
*/
! public final class LoginServlet extends HttpServlet
{
! private static String mAuthURL = "/j_security_check";
! private static String mAlgorithm = "SHA";
! private static Boolean mEncrypt = Boolean.FALSE;
//=========================================================================
--- 36,44 ----
* url-pattern="/auth/*"
*/
! public class LoginServlet extends HttpServlet
{
! protected static String mAuthURL = "/j_security_check";
! protected static String mAlgorithm = "SHA";
! protected static Boolean mEncrypt = Boolean.FALSE;
//=========================================================================
***************
*** 121,124 ****
--- 121,154 ----
}
+ // Extract attributes we will need
+ String username = request.getParameter("j_username");
+ String password = request.getParameter("j_password");
+
+ String encryptedPassword = getEncryptedPassword(request, username,
password);
+
+ String req = request.getContextPath() + mAuthURL + "?j_username=" +
+ username + "&j_password=" + encryptedPassword +
"&j_uri=" +
+ request.getParameter("j_uri");
+
+ if (mLogger.isDebugEnabled())
+ {
+ mLogger.debug("Authenticating user '" + username + "'");
+ }
+
+ response.sendRedirect(response.encodeRedirectURL(req));
+ }
+
+ /**
+ * Encode the user's password (if necessary) before redirecting to
+ * the Container Managed Security servlet.
+ *
+ * @param request
+ * @param username
+ * @param password
+ * @return
+ */
+ protected String getEncryptedPassword(HttpServletRequest request,
+ String username, String password)
+ {
RollerContext rc = RollerContext.getRollerContext( request );
RollerConfig rollerConfig = rc.getRollerConfig();
***************
*** 134,141 ****
mLogger.debug("Encryption algorithm: " + mAlgorithm);
}
-
- // Extract attributes we will need
- String username = request.getParameter("j_username");
- String password = request.getParameter("j_password");
if (request.getParameter("rememberMe") != null) {
--- 164,167 ----
***************
*** 159,173 ****
encryptedPassword = password;
}
!
! String req = request.getContextPath() + mAuthURL + "?j_username=" +
! username + "&j_password=" + encryptedPassword +
"&j_uri=" +
! request.getParameter("j_uri");
!
! if (mLogger.isDebugEnabled())
! {
! mLogger.debug("Authenticating user '" + username + "'");
! }
!
! response.sendRedirect(response.encodeRedirectURL(req));
}
}
\ No newline at end of file
--- 185,189 ----
encryptedPassword = password;
}
! return encryptedPassword;
}
}
\ No newline at end of file
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|