Minor change to allow non-authed users to request images, css, and js for styling

This commit is contained in:
Obique PSWG
2015-08-29 15:29:09 -05:00
parent d210822c30
commit 1817f14258
2 changed files with 4 additions and 2 deletions
@@ -173,11 +173,13 @@ public class OnlineInterfaceService extends Service implements HttpServerCallbac
synchronized (getUser) {
try {
getUser.setString(1, username);
boolean prevAuthenticated = session.isAuthenticated();
session.setAuthenticated(false);
try (ResultSet cursor = getUser.executeQuery()) {
session.setAuthenticated(cursor.next() && isUserValid(cursor, password));
if (session.isAuthenticated()) {
Log.i(TAG, "[%s] Successfully logged in to online interface", username);
if (!prevAuthenticated)
Log.i(TAG, "[%s] Successfully logged in to online interface", username);
} else {
Log.w(TAG, "[%s] Failed to login to online interface. Incorrect user/pass", username);
socket.redirect(new URL("https", httpsServer.getBindAddress().getHostName(), httpsServer.getBindPort(), "/").toString());