diff options
Diffstat (limited to 'src/java/com/juick/http/www/Login.java')
-rw-r--r-- | src/java/com/juick/http/www/Login.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/java/com/juick/http/www/Login.java b/src/java/com/juick/http/www/Login.java index 329cb767..954d21c9 100644 --- a/src/java/com/juick/http/www/Login.java +++ b/src/java/com/juick/http/www/Login.java @@ -36,7 +36,7 @@ import javax.servlet.http.HttpServletResponse; public class Login { protected void doGetLoginForm(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - com.juick.User visitor = Utils.getVisitorUser(sql, request); + com.juick.User visitor = Utils.getVisitorUser(sql, request, response); if (visitor != null) { Utils.sendTemporaryRedirect(response, "/"); return; @@ -244,12 +244,12 @@ public class Login { } protected void doGetLogout(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - int uid = Utils.getVisitorUID(sql, request); - if (uid > 0) { + com.juick.User visitor = Utils.getVisitorUser(sql, request, response); + if (visitor != null) { PreparedStatement stmt = null; try { stmt = sql.prepareStatement("DELETE FROM logins WHERE user_id=?"); - stmt.setInt(1, uid); + stmt.setInt(1, visitor.UID); stmt.executeUpdate(); } catch (SQLException e) { System.err.println(e); |