From abeeba71672a711dab98194bb8ae751ee95e3385 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 31 Mar 2015 22:48:14 -0400 Subject: Add two factor authentication --- app/Schema/Mysql.php | 8 +++++++- app/Schema/Postgres.php | 8 +++++++- app/Schema/Sqlite.php | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'app/Schema') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 4ea7b041..2dcfd3b7 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,13 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 60; +const VERSION = 61; + +function version_61($pdo) +{ + $pdo->exec('ALTER TABLE users ADD COLUMN twofactor_activated TINYINT(1) DEFAULT 0'); + $pdo->exec('ALTER TABLE users ADD COLUMN twofactor_secret CHAR(16)'); +} function version_60($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index 93d8e869..6c6ea001 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -6,7 +6,13 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 40; +const VERSION = 42; + +function version_42($pdo) +{ + $pdo->exec('ALTER TABLE users ADD COLUMN twofactor_activated BOOLEAN DEFAULT \'0\''); + $pdo->exec('ALTER TABLE users ADD COLUMN twofactor_secret CHAR(16)'); +} function version_41($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 3683acb6..ef6523e4 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -6,7 +6,13 @@ use Core\Security; use PDO; use Model\Link; -const VERSION = 59; +const VERSION = 60; + +function version_60($pdo) +{ + $pdo->exec('ALTER TABLE users ADD COLUMN twofactor_activated INTEGER DEFAULT 0'); + $pdo->exec('ALTER TABLE users ADD COLUMN twofactor_secret TEXT'); +} function version_59($pdo) { -- cgit v1.2.3