about summary refs log tree commit diff stats
path: root/schema.sql
diff options
context:
space:
mode:
authorAndrew Dolgov <noreply@fakecake.org>2017-06-28 12:32:48 +0300
committerAndrew Dolgov <noreply@fakecake.org>2017-06-28 12:32:48 +0300
commit9f4927825bb5efeefdff9a2aac05c5b3200f5ef6 (patch)
treef7782cb57127c68bfd5c67fb0d90c725eb8f0e68 /schema.sql
parent4496d4a5e1f3ddb5fd0b3a0315f12c207e7c9041 (diff)
downloadthe-epube-9f4927825bb5efeefdff9a2aac05c5b3200f5ef6.tar.gz
the-epube-9f4927825bb5efeefdff9a2aac05c5b3200f5ef6.tar.xz
move to internal user management because it's impossible to implement
proper transparent offline mode with http auth (worker is incapable of
authenticating properly)

MIGRATION:

1. disable HTTP authentication (this is important!)
2. add two new tables to db/scratch.db (sessions & users)
3. create users via useradm.php (same names and passwords, previous data
is kept)
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql16
1 files changed, 16 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql
index 457b499..1cd0971 100644
--- a/schema.sql
+++ b/schema.sql
@@ -1,5 +1,9 @@
 drop table if exists epube_pagination;
 drop table if exists epube_books;
+drop table if exists epube_users;
+drop table if exists epube_sessions;
+
+drop index if exists epube_sessions_expire;
 
 create table epube_pagination(
 	id integer not null primary key autoincrement,
@@ -13,3 +17,15 @@ create table epube_books(
 	owner varchar(200) not null,
 	lastcfi varchar(200) not null,
 	lastread integer not null);
+
+create table epube_users(
+	id integer not null primary key autoincrement,
+	user varchar(100) not null,
+	pass varchar(200) not null);
+
+create table epube_sessions (
+	id varchar(250) not null primary key,
+	data text,
+	expire integer not null);
+
+create index epube_sessions_expire on epube_sessions(expire);