Files
Enes Yakıştır 33b0940012
Build and Push Docker Images / build (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s
feat: SnapCAD Studio'yu YakHub deposuna taşı
- DWG/DXF içe aktarma ve .skf yeniden açma düzeltmeleri

- YakNet Bulut eşitlemede boş/eski kopya koruması ve yerel-only proje bildirimi

- Panelden içe aktarma duyuruları ve erişilebilir Türkçe hata mesajları

- AGPL-3.0 lisansı, README ve YakHub bağlantıları
2026-10-25 18:20:21 +03:00

46 lines
1.4 KiB
PHP

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* SnapCAD — YakNet SSO Oturum Durumu (/api/sync_session.php)
*
* Güvenlik notu: Bu uç nokta istemciden gelen kullanıcı verisini ASLA kabul etmez.
* Oturum yalnızca sunucu taraflı OAuth callback'i (/callback.php) ile kurulur.
* Eski istemci taraflı SSO senkronizasyonu kaldırılmıştır.
*/
require_once __DIR__ . '/../snap-config.php';
header('Content-Type: application/json; charset=utf-8');
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
$action = $_GET['action'] ?? '';
$user = $_SESSION['yaknet_user'] ?? null;
if ($action === 'logout') {
snapcad_logout();
echo json_encode([
'ok' => true,
'success' => true,
'authenticated' => false,
'user' => null,
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
}
if ($action === 'status' || $action === '') {
echo json_encode([
'ok' => true,
'success' => true,
'authenticated' => $user !== null,
'user' => $user,
'guest_student' => $_SESSION['snapcad_guest_student'] ?? null,
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
}
http_response_code(403);
echo json_encode([
'ok' => false,
'success' => false,
'authenticated' => $user !== null,
'error' => 'İstemci taraflı oturum senkronizasyonu devre dışı. Lütfen YakNet hesabınızla giriş yapın.',
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);