aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/Login.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/Login.java
parentcc192146f434263b73fb965e566e2829e70f209e (diff)
fix getUserByHash usage
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/Login.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/Login.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Login.java b/juick-www/src/main/java/com/juick/www/Login.java
index 155f58d5..0ec63a8e 100644
--- a/juick-www/src/main/java/com/juick/www/Login.java
+++ b/juick-www/src/main/java/com/juick/www/Login.java
@@ -34,7 +34,7 @@ public class Login {
protected void doGetLoginForm(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- if (visitor != null) {
+ if (visitor.getUID() > 0) {
Utils.sendTemporaryRedirect(response, "/");
return;
}
@@ -228,7 +228,7 @@ public class Login {
protected void doGetLogout(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- if (visitor != null) {
+ if (visitor.getUID() > 0) {
sql.update("DELETE FROM logins WHERE user_id=?", visitor.getUID());
}