Dokumentation

This commit is contained in:
Kevin Feiler
2025-10-16 03:42:47 +02:00
parent f5cf6ee08f
commit e9e48ff314
4 changed files with 480 additions and 13 deletions

Binary file not shown.

View File

@@ -179,12 +179,12 @@ function keyhelpmanager_CreateAccount(array $params)
// Use template if selected (skip if manual or empty)
if (!empty($templateId) && $templateId !== "manual") {
$accountData["plan_id"] = $templateId;
$accountData["id_hosting_plan"] = $templateId;
}
$result = _keyhelpmanager_APIRequest(
$params,
"/users",
"/clients",
"POST",
$accountData,
);
@@ -200,12 +200,9 @@ function keyhelpmanager_CreateAccount(array $params)
}
// Create domain with template settings
$domainData = ["domain_name" => $domain, "user_id" => $userId];
$domainData = ["domain_name" => $domain, "id_client" => $userId];
// Only add template_id if it's set and not manual mode
if (!empty($templateId) && $templateId !== "manual") {
$domainData["template_id"] = $templateId;
}
// KeyHelp API doesn't use template_id for domains, template is applied via user
$domainResult = _keyhelpmanager_APIRequest(
$params,
@@ -215,7 +212,7 @@ function keyhelpmanager_CreateAccount(array $params)
);
if (!$domainResult["success"]) {
_keyhelpmanager_APIRequest($params, "/users/" . $userId, "DELETE");
_keyhelpmanager_APIRequest($params, "/clients/" . $userId, "DELETE");
return "Domain creation failed: " . $domainResult["error"];
}
@@ -247,7 +244,7 @@ function keyhelpmanager_SuspendAccount(array $params)
$result = _keyhelpmanager_APIRequest(
$params,
"/users/" . $userId,
"/clients/" . $userId,
"PUT",
["is_locked" => true],
);
@@ -269,7 +266,7 @@ function keyhelpmanager_UnsuspendAccount(array $params)
$result = _keyhelpmanager_APIRequest(
$params,
"/users/" . $userId,
"/clients/" . $userId,
"PUT",
["is_locked" => false],
);
@@ -291,7 +288,7 @@ function keyhelpmanager_TerminateAccount(array $params)
$result = _keyhelpmanager_APIRequest(
$params,
"/users/" . $userId,
"/clients/" . $userId,
"DELETE",
);
@@ -366,7 +363,7 @@ function keyhelpmanager_ClientArea(array $params)
if (!empty($userId)) {
$statsResult = _keyhelpmanager_APIRequest(
$params,
"/users/" . $userId . "/statistics",
"/clients/" . $userId . "/statistics",
"GET",
);
@@ -489,7 +486,7 @@ function keyhelpmanager_ChangePassword(array $params)
$result = _keyhelpmanager_APIRequest(
$params,
"/users/" . $userId,
"/clients/" . $userId,
"PUT",
["password" => $newPassword],
);