Mercurial > hg > digilib
changeset 1167:4c7ee297e860
quick fix to make authentication work again in oldskin and greyskin.
needs copying of /oldskin and /greyskin folders into /authenticated.
author | robcast |
---|---|
date | Tue, 26 Mar 2013 11:46:16 +0100 |
parents | 00662a0439fc |
children | 6c5eb1896cc0 |
files | servlet2/src/main/java/digilib/servlet/DocumentBean.java servlet2/src/main/java/digilib/servlet/Scaler.java servlet3/src/main/java/digilib/servlet/DocumentBean.java servlet3/src/main/java/digilib/servlet/Scaler.java |
diffstat | 4 files changed, 21 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/servlet2/src/main/java/digilib/servlet/DocumentBean.java Tue Mar 26 11:35:43 2013 +0100 +++ b/servlet2/src/main/java/digilib/servlet/DocumentBean.java Tue Mar 26 11:46:16 2013 +0100 @@ -2,6 +2,7 @@ /* * #%L + * * DocumentBean -- Access control bean for JSP * * Digital Image Library servlet components @@ -165,6 +166,13 @@ // shortcut if no authentication return true; } + // quick fix: add auth-url-path to base.url + if (isAuthRequired(request)) { + String baseUrl = request.getAsString("base.url"); + if (!baseUrl.endsWith(authURLPath)) { + request.setValue("base.url", baseUrl + "/" + authURLPath); + } + } // check if we are already authenticated if (((HttpServletRequest) request.getServletRequest()).getRemoteUser() == null) { logger.debug("unauthenticated so far"); @@ -172,7 +180,7 @@ if (isAuthRequired(request)) { logger.debug("auth required, redirect"); // we are not yet authenticated -> redirect - response.sendRedirect(authURLPath + response.sendRedirect(request.getAsString("base.url") + ((HttpServletRequest) request.getServletRequest()) .getServletPath() + "?"
--- a/servlet2/src/main/java/digilib/servlet/Scaler.java Tue Mar 26 11:35:43 2013 +0100 +++ b/servlet2/src/main/java/digilib/servlet/Scaler.java Tue Mar 26 11:46:16 2013 +0100 @@ -59,7 +59,7 @@ private static final long serialVersionUID = -5439198888139362735L; /** digilib servlet version (for all components) */ - public static final String version = "2.1b3 noasync"; + public static final String version = "2.1b4 noasync"; /** servlet error codes */ public static enum Error {UNKNOWN, AUTH, FILE, IMAGE}; @@ -98,7 +98,7 @@ protected DigilibServletConfiguration dlConfig; /** use authorization database */ - protected boolean useAuthorization = true; + protected boolean useAuthorization = false; /** AuthOps instance */ protected AuthOps authOp;
--- a/servlet3/src/main/java/digilib/servlet/DocumentBean.java Tue Mar 26 11:35:43 2013 +0100 +++ b/servlet3/src/main/java/digilib/servlet/DocumentBean.java Tue Mar 26 11:46:16 2013 +0100 @@ -6,7 +6,7 @@ * DocumentBean -- Access control bean for JSP * * Digital Image Library servlet components - * + * * %% * Copyright (C) 2001 - 2013 MPIWG Berlin * %% @@ -166,6 +166,13 @@ // shortcut if no authentication return true; } + // quick fix: add auth-url-path to base.url + if (isAuthRequired(request)) { + String baseUrl = request.getAsString("base.url"); + if (!baseUrl.endsWith(authURLPath)) { + request.setValue("base.url", baseUrl + "/" + authURLPath); + } + } // check if we are already authenticated if (((HttpServletRequest) request.getServletRequest()).getRemoteUser() == null) { logger.debug("unauthenticated so far"); @@ -173,7 +180,7 @@ if (isAuthRequired(request)) { logger.debug("auth required, redirect"); // we are not yet authenticated -> redirect - response.sendRedirect(authURLPath + response.sendRedirect(request.getAsString("base.url") + ((HttpServletRequest) request.getServletRequest()) .getServletPath() + "?"
--- a/servlet3/src/main/java/digilib/servlet/Scaler.java Tue Mar 26 11:35:43 2013 +0100 +++ b/servlet3/src/main/java/digilib/servlet/Scaler.java Tue Mar 26 11:46:16 2013 +0100 @@ -57,7 +57,7 @@ private static final long serialVersionUID = 5289386646192471549L; /** digilib servlet version (for all components) */ - public static final String version = "2.1b3 async"; + public static final String version = "2.1b4 async"; /** servlet error codes */ public static enum Error {