Add kiosk mode, public board access with read-only and auto-refresh

This commit is contained in:
Frédéric Guillot
2014-02-22 16:30:03 -05:00
parent a1923d3d7f
commit 2f4651411b
12 changed files with 121 additions and 19 deletions

View File

@@ -2,11 +2,27 @@
namespace Schema;
function version_3($pdo)
{
$pdo->exec('ALTER TABLE projects ADD column token TEXT');
// For each existing project, assign a different token
$rq = $pdo->prepare("SELECT id FROM projects WHERE token IS NULL");
$rq->execute();
$results = $rq->fetchAll(\PDO::FETCH_ASSOC);
if ($results !== false) {
foreach ($results as &$result) {
$rq = $pdo->prepare('UPDATE projects SET token=? WHERE id=?');
$rq->execute(array(\Model\Base::generateToken(), $result['id']));
}
}
}
function version_2($pdo)
{
$pdo->exec('ALTER TABLE tasks ADD column date_completed INTEGER');
// For all existing completed tasks, set the date of creation as a date of completion
$pdo->exec('UPDATE tasks SET date_completed=date_creation WHERE is_active=0');
}
@@ -74,6 +90,6 @@ function version_1($pdo)
$pdo->exec("
INSERT INTO config
(language, webhooks_token)
VALUES ('en_US', '".\Model\Config::generateToken()."')
VALUES ('en_US', '".\Model\Base::generateToken()."')
");
}