aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/Main.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-10 22:46:56 +0300
committerGravatar Vitaly Takmazov2016-07-10 22:46:56 +0300
commita0fa66fd9587407030d1c1ed3c5ee57d15c280fb (patch)
tree60c54455d7376868104c8e915b2ab8ef57340f39 /juick-www/src/main/java/com/juick/www/Main.java
parentcc192146f434263b73fb965e566e2829e70f209e (diff)
fix getUserByHash usage
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/Main.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/Main.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Main.java b/juick-www/src/main/java/com/juick/www/Main.java
index 8602447a..4d340cd8 100644
--- a/juick-www/src/main/java/com/juick/www/Main.java
+++ b/juick-www/src/main/java/com/juick/www/Main.java
@@ -149,7 +149,7 @@ public class Main extends HttpServlet implements Stream.StreamListener {
}
} else if (uri.startsWith("/pm/")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- if (visitor == null) {
+ if (visitor.getUID() == 0) {
Utils.sendTemporaryRedirect(response, "/login");
} else {
switch (uri) {
@@ -271,28 +271,28 @@ public class Main extends HttpServlet implements Stream.StreamListener {
String uri = request.getRequestURI();
if (uri.equals("/post")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- if (visitor != null && !visitor.Banned) {
+ if (visitor.getUID() > 0 && !visitor.Banned) {
pagesNewMessage.doPostMessage(sql, request, response, xmpp, visitor);
} else {
response.sendError(403);
}
} else if (uri.equals("/comment")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- if (visitor != null && !visitor.Banned) {
+ if (visitor.getUID() > 0 && !visitor.Banned) {
pagesNewMessage.doPostComment(sql, request, response, xmpp, visitor);
} else {
response.sendError(403);
}
} else if (uri.equals("/like")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- if (visitor != null && !visitor.Banned) {
+ if (visitor.getUID() > 0 && !visitor.Banned) {
pagesNewMessage.doPostRecomm(sql, request, response, xmpp, visitor);
} else {
response.sendError(403);
}
} else if (uri.equals("/pm/send")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- if (visitor != null && !visitor.Banned) {
+ if (visitor.getUID() > 0 && !visitor.Banned) {
pm.doPostPM(sql, request, response, xmpp, visitor);
} else {
response.sendError(403);