Added ability to manage custom registrar pricing from panel; fixed #163

This commit is contained in:
Pinga 2025-04-01 11:59:10 +03:00
parent acc7d74b32
commit de89a9e3b4
5 changed files with 314 additions and 97 deletions

View file

@ -1154,4 +1154,9 @@ function isValidHostname($hostname) {
function sign($ts, $method, $path, $body, $secret_key) {
$stringToSign = $ts . strtoupper($method) . $path . $body;
return hash_hmac('sha256', $stringToSign, $secret_key);
}
function getClid($db, string $clid): ?int {
$result = $db->selectValue('SELECT id FROM registrar WHERE clid = ? LIMIT 1', [$clid]);
return $result !== false ? (int)$result : null;
}