Added authentication functionality and simple role based model
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
<?php
|
||||
require 'db.php';
|
||||
require 'auth.php';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
require_can_manage_settings();
|
||||
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
$title = $data['title'] ?? 'tinyTask';
|
||||
$icon = $data['icon_class'] ?? 'kanban';
|
||||
$icon = $data['icon_class'] ?? 'kanban';
|
||||
$color = $data['icon_color'] ?? '#ff0000';
|
||||
|
||||
$stmt = $pdo->prepare("UPDATE settings SET title = ?, icon_class = ?, icon_color = ? WHERE id = 1");
|
||||
$stmt->execute([$title, $icon, $color]);
|
||||
|
||||
echo json_encode(['success' => true]);
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user