From 00b9508d8178bae016b2a25a81282dbe9ae0a9d2 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 7 Feb 2015 23:28:17 -0500 Subject: Be able to disable the login form for specific users --- app/Schema/Mysql.php | 7 ++++++- app/Schema/Postgres.php | 19 ++++++++++++------- app/Schema/Sqlite.php | 7 ++++++- 3 files changed, 24 insertions(+), 9 deletions(-) (limited to 'app/Schema') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 5a52288b..9c066625 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -5,7 +5,12 @@ namespace Schema; use PDO; use Core\Security; -const VERSION = 43; +const VERSION = 44; + +function version_44($pdo) +{ + $pdo->exec('ALTER TABLE users ADD COLUMN disable_login_form TINYINT(1) DEFAULT 0'); +} function version_43($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index 7aa1c457..52130c96 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -5,7 +5,12 @@ namespace Schema; use PDO; use Core\Security; -const VERSION = 24; +const VERSION = 25; + +function version_25($pdo) +{ + $pdo->exec("ALTER TABLE users ADD COLUMN disable_login_form BOOLEAN DEFAULT '1'"); +} function version_24($pdo) { @@ -13,17 +18,17 @@ function version_24($pdo) $rq->execute(array('subtask_restriction', '0')); $rq->execute(array('subtask_time_tracking', '0')); - $pdo->exec(" + $pdo->exec(' CREATE TABLE subtask_time_tracking ( id SERIAL PRIMARY KEY, - user_id INTEGER NOT NULL, - subtask_id INTEGER NOT NULL, - start INTEGER DEFAULT 0, - end INTEGER DEFAULT 0, + "user_id" INTEGER NOT NULL, + "subtask_id" INTEGER NOT NULL, + "start" INTEGER DEFAULT 0, + "end" INTEGER DEFAULT 0, FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE ) - "); + '); } function version_23($pdo) diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 17166e64..37483945 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -5,7 +5,12 @@ namespace Schema; use Core\Security; use PDO; -const VERSION = 42; +const VERSION = 43; + +function version_43($pdo) +{ + $pdo->exec('ALTER TABLE users ADD COLUMN disable_login_form INTEGER DEFAULT 0'); +} function version_42($pdo) { -- cgit v1.2.3