Enhance API with OIDC support, including login and callback endpoints. Update environment variables for OIDC configuration in .env.example. Add new features to the catalog service for listing software families, Minecraft versions, and deployment regions. Implement server management actions such as kill, delete, and update in the servers module. Integrate feature flags for maintenance mode in server operations. Update pnpm-lock.yaml with new dependencies and versions.
This commit is contained in:
68
integrations/whmcs/modules/servers/hexagamecloud/hooks.php
Normal file
68
integrations/whmcs/modules/servers/hexagamecloud/hooks.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('WHMCS')) {
|
||||
die('This file cannot be accessed directly');
|
||||
}
|
||||
|
||||
if (!defined('HEXAGAMECLOUD_SERVER_VERSION')) {
|
||||
define('HEXAGAMECLOUD_SERVER_VERSION', '1.1.0');
|
||||
}
|
||||
|
||||
add_hook('AfterModuleRenew', 1, function (array $vars): void {
|
||||
if (($vars['params']['moduletype'] ?? '') !== 'hexagamecloud') {
|
||||
return;
|
||||
}
|
||||
|
||||
$serviceId = (string) ($vars['params']['serviceid'] ?? '');
|
||||
if ($serviceId === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
logActivity('HexaGameCloud service renewed via WHMCS (service #' . $serviceId . ')');
|
||||
});
|
||||
|
||||
add_hook('AfterModuleCreate', 1, function (array $vars): void {
|
||||
if (($vars['params']['moduletype'] ?? '') !== 'hexagamecloud') {
|
||||
return;
|
||||
}
|
||||
|
||||
$serviceId = (string) ($vars['params']['serviceid'] ?? '');
|
||||
if ($serviceId === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
logActivity('HexaGameCloud service provisioned (service #' . $serviceId . ')');
|
||||
});
|
||||
|
||||
add_hook('ClientAreaPageProductDetails', 1, function (array $vars): array {
|
||||
if (($vars['module'] ?? '') !== 'hexagamecloud') {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
'gamecloudModuleVersion' => HEXAGAMECLOUD_SERVER_VERSION,
|
||||
];
|
||||
});
|
||||
|
||||
add_hook('AdminAreaHeadOutput', 1, function (array $vars): string {
|
||||
if (($vars['filename'] ?? '') !== 'clientsservices') {
|
||||
return '';
|
||||
}
|
||||
|
||||
return '<!-- HexaGameCloud server module ' . htmlspecialchars(HEXAGAMECLOUD_SERVER_VERSION, ENT_QUOTES, 'UTF-8') . ' -->';
|
||||
});
|
||||
|
||||
add_hook('ServiceEdit', 1, function (array $vars): void {
|
||||
if (($vars['moduletype'] ?? '') !== 'hexagamecloud') {
|
||||
return;
|
||||
}
|
||||
|
||||
$serviceId = (string) ($vars['serviceid'] ?? '');
|
||||
if ($serviceId === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
logActivity('HexaGameCloud service edited in WHMCS admin (service #' . $serviceId . ')');
|
||||
});
|
||||
Reference in New Issue
Block a user