From 74f0e662697a05d30b5ac1cec6d1ffeaae14bf5f Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Fri, 24 Jan 2014 19:19:31 +0700 Subject: Tomcat upgrade, small fixes --- nbproject/project.properties | 2 +- src/java/com/juick/api/Main.java | 13 +++++++------ src/java/com/juick/api/PM.java | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/nbproject/project.properties b/nbproject/project.properties index 92f560c4..9991f39f 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -30,7 +30,7 @@ includes=** j2ee.compile.on.save=true j2ee.deploy.on.save=true j2ee.platform=1.6-web -j2ee.platform.classpath=${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/ecj-3.7.1.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/annotations-api.jar +j2ee.platform.classpath=${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat7-websocket.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.2.2.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/websocket-api.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/annotations-api.jar j2ee.server.type=Tomcat jar.compress=false javac.classpath=\ diff --git a/src/java/com/juick/api/Main.java b/src/java/com/juick/api/Main.java index 38716282..9e0b8523 100644 --- a/src/java/com/juick/api/Main.java +++ b/src/java/com/juick/api/Main.java @@ -29,6 +29,7 @@ import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; import javax.servlet.ServletException; +import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -39,6 +40,7 @@ import javax.servlet.http.HttpServletResponse; * @author Ugnich Anton */ @WebServlet(name = "Main", urlPatterns = {"/"}) +@MultipartConfig public class Main extends HttpServlet implements Stream.StreamListener { Connection sql; @@ -186,16 +188,15 @@ public class Main extends HttpServlet implements Stream.StreamListener { if (vuid == 0) { vuid = Utils.getVisitorQueryStringUID(sql, request); } - + if (vuid == 0) { + response.sendError(401); + return; + } String uri = request.getRequestURI(); if (uri.equals("/post")) { } else if (uri.equals("/pm")) { - if (vuid > 0) { - pm.doPostPM(request, response, xmpp, vuid); - } else { - response.sendError(401); - } + pm.doPostPM(request, response, xmpp, vuid); } else { response.sendError(405); } diff --git a/src/java/com/juick/api/PM.java b/src/java/com/juick/api/PM.java index d279d9e3..2722526d 100644 --- a/src/java/com/juick/api/PM.java +++ b/src/java/com/juick/api/PM.java @@ -59,7 +59,7 @@ public class PM { return; } - if (UserQueries.isInBL(sql, uid, vuid) || UserQueries.isInBL(sql, vuid, uid)) { + if (UserQueries.isInBLAny(sql, uid, vuid)) { response.sendError(403); return; } -- cgit v1.2.3