v1.0 Initial commit of project

This commit is contained in:
2026-01-01 10:54:18 +01:00
commit 768cf78b57
990 changed files with 241213 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
use api\classes\API_inserve;
session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_inserve.php';
$API_inserve = new API_inserve();
$API_inserve->setupConnection();
if ($API_inserve->request_method === 'GET') {
if ($_GET['action'] = 'auth/me') {
# This api call, when called from the frontend will not be forwarding to a url.
$API_inserve->return_url = false;
$auth = $API_inserve->authMe();
http_response_code($API_inserve->httpCode);
}
}

View File

@@ -0,0 +1,32 @@
<?php
use api\classes\API_inserve;
session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_inserve.php';
$API_inserve = new API_inserve();
if ($API_inserve->request_method === 'GET') {
if ($_GET['action'] == 'sync-companies') {
# This syncs the company id's from Sentri to the Inserve cloudDistributor
# These are the same id's but it Inserve requires it to be synced to the cloudDistributor
$API_inserve->checkPermissions('servers', 'RW');
$API_inserve->setupConnection();
$API_inserve->syncCompaniesFromSentri();
}
if ($_GET['action'] == 'sync-subscriptions') {
$API_inserve->checkPermissions('servers', 'RW');
$API_inserve->setupConnection();
$API_inserve->syncServerLicencesToInserve();
}
}