Revision 5374
Added by berkley about 14 years ago
AuthUtil.java | ||
---|---|---|
198 | 198 |
String sessionId = session.getId(); |
199 | 199 |
|
200 | 200 |
try { |
201 |
SessionService.registerSession(sessionId, |
|
201 |
SessionService.getInstance().registerSession(sessionId,
|
|
202 | 202 |
(String) session.getAttribute("username"), |
203 | 203 |
(String[]) session.getAttribute("groupnames"), |
204 | 204 |
(String) session.getAttribute("password"), |
... | ... | |
223 | 223 |
|
224 | 224 |
try { |
225 | 225 |
|
226 |
if (sessionId != null && SessionService.isSessionRegistered(sessionId)) { |
|
226 |
if (sessionId != null && SessionService.getInstance().isSessionRegistered(sessionId)) {
|
|
227 | 227 |
// get the registered session data |
228 |
sessionData = SessionService.getRegisteredSession(sessionId); |
|
228 |
sessionData = SessionService.getInstance().getRegisteredSession(sessionId);
|
|
229 | 229 |
|
230 | 230 |
// get the timeout limit |
231 | 231 |
String sessionTimeout = PropertyService.getProperty("auth.timeoutMinutes"); |
... | ... | |
240 | 240 |
// if the last accessed time is before now minus the timeout, |
241 | 241 |
// the session has expired. Unregister it and return false. |
242 | 242 |
if (lastAccessedTime.before(now)) { |
243 |
SessionService.unRegisterSession(sessionId); |
|
243 |
SessionService.getInstance().unRegisterSession(sessionId);
|
|
244 | 244 |
return false; |
245 | 245 |
} |
246 | 246 |
|
... | ... | |
301 | 301 |
*/ |
302 | 302 |
public static String[] getGroupNames(HttpServletRequest request) { |
303 | 303 |
String sessionId = request.getSession().getId();; |
304 |
SessionData sessionData = SessionService.getRegisteredSession(sessionId); |
|
304 |
SessionData sessionData = SessionService.getInstance().getRegisteredSession(sessionId);
|
|
305 | 305 |
String[] groupNames = { "" }; |
306 | 306 |
|
307 | 307 |
if (sessionData != null) { |
Also available in: Unified diff
refactored the sessionService to use a correct singleton initialization scheme. Added true authentication to ResourceHandler.