aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/Main.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-01-27 06:21:29 +0700
committerGravatar Ugnich Anton2014-01-27 06:21:29 +0700
commit36c8ec33c09fbfd0f82a5a4121ef63ed1ec77457 (patch)
treeb6f33bc1a14a2ab8dbde89a2908a1243d741cc76 /src/java/com/juick/http/www/Main.java
parentf1e3d22f610640c9096ad182503ebb3a9f850f2b (diff)
Popular on the main page
Diffstat (limited to 'src/java/com/juick/http/www/Main.java')
-rw-r--r--src/java/com/juick/http/www/Main.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/java/com/juick/http/www/Main.java b/src/java/com/juick/http/www/Main.java
index 998fb4f3..59065341 100644
--- a/src/java/com/juick/http/www/Main.java
+++ b/src/java/com/juick/http/www/Main.java
@@ -143,28 +143,24 @@ public class Main extends HttpServlet implements Stream.StreamListener {
if (uri.equals("/")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- if (visitor == null) {
- login.doGetLoginForm(sql, request, response);
- } else {
- home.doGet(sql, sqlSearch, request, response, visitor);
- }
+ home.doGet(sql, sqlSearch, request, response, visitor);
} else if (uri.equals("/post")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
if (visitor != null) {
pagesNewMessage.doGetNewMessage(sql, request, response, visitor);
} else {
- Utils.sendTemporaryRedirect(response, "/");
+ Utils.sendTemporaryRedirect(response, "/login");
}
} else if (uri.equals("/login")) {
if (request.getQueryString() == null) {
- Utils.sendPermanentRedirect(response, "/");
+ login.doGetLoginForm(sql, request, response);
} else {
login.doGetLogin(sql, request, response);
}
} else if (uri.startsWith("/pm/")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
if (visitor == null) {
- login.doGetLoginForm(sql, request, response);
+ Utils.sendTemporaryRedirect(response, "/login");
} else {
if (uri.equals("/pm/inbox")) {
pm.doGetInbox(sql, request, response, visitor);