@ -19,11 +19,43 @@ public class SqliteSessionService extends SqliteStore implements SessionService
@@ -19,11 +19,43 @@ public class SqliteSessionService extends SqliteStore implements SessionService
privatestaticfinalStringSET_STORE_VERSION="UPDATE metainfo SET value = ? WHERE key = '"+STORE_VERSION+"'";
privatestaticfinalStringCREATE_SESSION_TABLE="CREATE TABLE sessions (id VARCHAR(64) PRIMARY KEY, userId VARCHAR(64) NOT NULL, expiration LONG NOT NULL)";
privatestaticfinalStringSAVE_SESSION="INSERT INTO sessions (id, userId, expiration) VALUES (?,?,?) ON CONFLICT DO UPDATE SET expiration = ?;";
privatestaticfinalStringDROP_SESSION="DELETE FROM sessions WHERE id = ?";
privatestaticfinalStringSELECT_SESSION="SELECT * FROM sessions WHERE id = ?";
@ -31,7 +31,7 @@ public class SqliteUserService extends SqliteStore implements UserService {
@@ -31,7 +31,7 @@ public class SqliteUserService extends SqliteStore implements UserService {
privatestaticfinalStringLOAD_PERMISSIONS="SELECT permission FROM user_permissions WHERE uuid = ?";
privatestaticfinalStringFIND_USER="SELECT * FROM users WHERE uuid = ? OR username LIKE ? OR realname LIKE ? OR email = ? ORDER BY COALESCE(uuid, ?), username";
privatestaticfinalStringLIST_USERS="SELECT * FROM users";
privatestaticfinalStringINSERT_USER="INSERT INTO users (uuid,password,email,session_duration,username,realname) VALUES (?,?,?,?,?,?) ON CONFLICT DO UPDATE SET password = ?, email = ?, session_duration = ?, username = ?, realname = ?;";
privatestaticfinalStringSAVE_USER="INSERT INTO users (uuid,password,email,session_duration,username,realname) VALUES (?,?,?,?,?,?) ON CONFLICT DO UPDATE SET password = ?, email = ?, session_duration = ?, username = ?, realname = ?;";
privatestaticfinalStringINSERT_PERMISSIONS="INSERT INTO user_permissions (uuid, permission) VALUES (?,?)";
privatestaticfinalStringDROP_PERMISSIONS="DELETE FROM user_permissions WHERE uuid = ?";
privatestaticfinalStringDROP_USER="DELETE FROM users WHERE uuid = ?";
@ -53,6 +53,22 @@ public class SqliteUserService extends SqliteStore implements UserService {
@@ -53,6 +53,22 @@ public class SqliteUserService extends SqliteStore implements UserService {