fix logic issue

This commit is contained in:
Sola
2015-12-12 22:22:10 +08:00
parent 8b44cedf58
commit 3a4ed81482
3 changed files with 3 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ public class Register extends HttpServlet {
response.addHeader("Content-type", "text/plain;charset=utf-8"); response.addHeader("Content-type", "text/plain;charset=utf-8");
HttpSession httpSession = request.getSession(false); HttpSession httpSession = request.getSession(false);
if (Checker.authorized(httpSession, Command.REGISTER)) { if (!Checker.authorized(httpSession, Command.REGISTER)) {
Redirect.message(response, 0, "Authorize_Failed"); Redirect.message(response, 0, "Authorize_Failed");
return; return;
} }

View File

@@ -52,7 +52,7 @@ public class TicketQuery extends HttpServlet {
try (Session s = SQLCore.sf.openSession()) { try (Session s = SQLCore.sf.openSession()) {
HttpSession httpSession = request.getSession(false); HttpSession httpSession = request.getSession(false);
if (Checker.authorized(httpSession, Command.QUERY)) { if (!Checker.authorized(httpSession, Command.QUERY)) {
return new Response(Response.ResponseCode.UNAUTHORIZED); return new Response(Response.ResponseCode.UNAUTHORIZED);
} }
User u = (User) httpSession.getAttribute("user"); User u = (User) httpSession.getAttribute("user");

View File

@@ -54,7 +54,7 @@ public class TicketSubmit extends HttpServlet {
try (Session s = SQLCore.sf.openSession()) { try (Session s = SQLCore.sf.openSession()) {
HttpSession httpSession = request.getSession(false); HttpSession httpSession = request.getSession(false);
if (Checker.authorized(httpSession, Command.SUBMIT)) { if (!Checker.authorized(httpSession, Command.SUBMIT)) {
return new Response(Response.ResponseCode.UNAUTHORIZED); return new Response(Response.ResponseCode.UNAUTHORIZED);
} }
User u = (User) httpSession.getAttribute("user"); User u = (User) httpSession.getAttribute("user");