sWrkA = DBCommand.queryStr(oCon, "SELECT "+DB.gu_workarea+" FROM "+DB.k_users+" WHERE "+DB.gu_user+"='"+sUid+"'");
oCon.close("HttpCalendarServlet.getid");
if (null==sWrkA) {
oBuf.append("<calendarresponse command=\"connect\" code=\""+String.valueOf(ACL.WORKAREA_NOT_SET)+"\"><error>"+ACL.getErrorMessage(ACL.WORKAREA_NOT_SET)+"</error><value/></calendarresponse>");
} else {
oSecurityTokens.put(sTok, new NameValuePair(sUid, ACL.decript(sPwd,iEnc)));
oWorkAreas.put(sTok, sWrkA);
if (sOut.equalsIgnoreCase("xml")) {
oBuf.append("<calendarresponse command=\"connect\" code=\"0\"><error></error><value>"+sTok+"</value></calendarresponse>");
}
}
} catch (SQLException sqle) {
try { if (oCon!=null) if (!oCon.isClosed()) oCon.close("HttpCalendarServlet.getid"); } catch (Exception ignore) { }
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, sqle.getMessage());
return;
}
}
response.setContentType("text/xml");
response.setCharacterEncoding("UTF-8");
response.getWriter().print(oBuf.toString());
}
} else if (sCmd.equalsIgnoreCase("isAvailableRoom") || sCmd.equalsIgnoreCase("getAvailableRooms") ||
sCmd.equalsIgnoreCase("getMeetings") || sCmd.equalsIgnoreCase("getMeetingsForRoom") ||
sCmd.equalsIgnoreCase("getMeetingsOrganizedBy") ||
sCmd.equalsIgnoreCase("getMeeting") || sCmd.equals("getRooms") ||
sCmd.equalsIgnoreCase("storeMeeting") || sCmd.equalsIgnoreCase("deleteMeeting") ||
sCmd.equalsIgnoreCase("disconnect")) {
sTok = request.getParameter("token");
sMeet = request.getParameter("meeting");
sType = request.getParameter("type");
sRoom = request.getParameter("room");
sDtStart = request.getParameter("startdate");
sDtEnd = request.getParameter("enddate");
if (null==sTok) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, "No security token was supplied");
} else {
NameValuePair oUsrPwd = oSecurityTokens.get(sTok);
if (null==oUsrPwd) {
oBuf.append("<calendarresponse command=\""+sCmd+"\" code=\""+String.valueOf(ACL.DOMAIN_NOT_FOUND)+"\"><error>Invalid security token</error><value/></calendarresponse>");
} else {
try {
oCon = oDbb.getConnection("HttpCalendarServlet.authenticate");
iAuth = ACL.autenticate(oCon, oUsrPwd.getName(), oUsrPwd.getValue(), ACL.PWD_CLEAR_TEXT);
sUid = oUsrPwd.getName();
oCon.close("HttpCalendarServlet.authenticate");
} catch (SQLException sqle) {
try { if (oCon!=null) if (!oCon.isClosed()) oCon.close("HttpCalendarServlet.authenticate"); } catch (Exception ignore) { }
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, sqle.getMessage());
return;