Initial control project import

This commit is contained in:
seo
2026-06-07 00:33:58 +09:00
commit e1ca2fc125
25 changed files with 8231 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
require_once __DIR__ . '/../../config/config.php';
if (!signed_in()) {
json_out([
'ok' => false,
'error' => 'login_required',
], 401);
}
if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST') {
json_out([
'ok' => false,
'error' => 'method_not_allowed',
], 405);
}
require_csrf();
$subscription = push_subscription_from_json((string)file_get_contents('php://input'));
save_push_subscription($subscription);
json_out([
'ok' => true,
]);