Files
Sentri/pub/api/classes/API_system_sources.php
Marco Mooij eec1d13cf5 v.1.1 changes 16-04-2026:
- Minor changes to interface.
- Fixed different missing includes.
- Access now denied to api calls that are related to disabled modules.
- Fixed sorting of CPU and memory in server overview.
2026-04-16 15:01:40 +02:00

26 lines
1.0 KiB
PHP

<?php
namespace api\classes;
use api\classes\API;
require_once 'API.php';
class API_system_sources extends API
{
public function inserveUpdate()
{
$query = "INSERT INTO system_sources (source_uuid, source_name, source_url, source_auth_username, source_auth_password, source_auth_token, source_create_timestamp, source_modified_timestamp)
VALUES (UUID(), ?, ?, '', '', ?, ?, NULL)
ON DUPLICATE KEY UPDATE
source_url = VALUES(source_url),
source_auth_token = VALUES(source_auth_token),
source_modified_timestamp = VALUES(source_create_timestamp)";
$stmt = $this->prepareStatement($query);
$stmt->bind_param('sssi', $this->data['source_name'], $this->data['source_url'], $this->data['source_auth_token'], time());
$this->executeStatement($stmt);
$stmt->close();
$this->apiOutput(200, ['success' => 'Information modified'], 'Information updated successfully.');
}
}