Revision 8075
Added by ben leinfelder over 11 years ago
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
806 | 806 |
String idsToValidate[] = params.get("sessionid"); |
807 | 807 |
if (idsToValidate != null) { |
808 | 808 |
idToValidate = idsToValidate[0]; |
809 |
} else { |
|
810 |
// use the sessionid from the cookie |
|
811 |
SessionData sessionData = RequestUtil.getSessionData(request); |
|
812 |
if (sessionData != null) { |
|
813 |
idToValidate = sessionData.getId(); |
|
814 |
} |
|
809 | 815 |
} |
810 | 816 |
SessionService.getInstance().validateSession(out, response, idToValidate); |
811 | 817 |
out.close(); |
src/edu/ucsb/nceas/metacat/service/SessionService.java | ||
---|---|---|
238 | 238 |
out.write("invalid"); |
239 | 239 |
} |
240 | 240 |
out.write("</status>"); |
241 |
if(needSessionInfo) { |
|
242 |
SessionData sessionData = getRegisteredSession(sessionId); |
|
243 |
if(sessionData != null) { |
|
244 |
out.write("<userInformation>"); |
|
245 |
out.write("<name>"); |
|
246 |
out.write(sessionData.getUserName()); |
|
247 |
out.write("</name>"); |
|
248 |
appendGroupsInformation(sessionData, out); |
|
249 |
out.write("</userInformation>"); |
|
250 |
} |
|
241 |
if (needSessionInfo) { |
|
242 |
SessionData sessionData = getRegisteredSession(sessionId); |
|
243 |
if (sessionData != null) { |
|
244 |
out.write("<userInformation>"); |
|
245 |
out.write("<name>"); |
|
246 |
out.write(sessionData.getUserName()); |
|
247 |
out.write("</name>"); |
|
248 |
out.write("<fullName>"); |
|
249 |
out.write(sessionData.getName()); |
|
250 |
out.write("</fullName>"); |
|
251 |
appendGroupsInformation(sessionData, out); |
|
252 |
out.write("</userInformation>"); |
|
253 |
} |
|
251 | 254 |
} |
252 | 255 |
out.write("<sessionId>" + sessionId + "</sessionId></validateSession>"); |
253 | 256 |
} |
Also available in: Unified diff
include user's fullName when validating a session. also, allow cookie session to be used if not passed in directly as a parameter