Notification system improvement

Also only registry can now approve and reject applications
This commit is contained in:
Pinga 2025-03-14 17:27:39 +02:00
parent edc2bdab04
commit f942607363
5 changed files with 105 additions and 19 deletions

View file

@ -1367,7 +1367,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
} else {
$errorLogStmt = $db->prepare("INSERT INTO error_log
(channel, level, level_name, message, context, extra, created_at)
VALUES ('epp', 3, 'warning', :log, :context, '{}', CURRENT_TIMESTAMP)");
VALUES ('epp', 300, 'WARNING', :log, :context, '{}', CURRENT_TIMESTAMP)");
$errorLogStmt->execute([
':log' => "Domain: $domainName; hostObj: $hostObj - is duplicated",
':context' => json_encode(['registrar_id' => $clid, 'domain' => $domainName, 'host' => $hostObj])
@ -1437,7 +1437,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
// Log duplicate mapping error
$stmt = $db->prepare("INSERT INTO error_log
(channel, level, level_name, message, context, extra, created_at)
VALUES ('epp', 3, 'warning', ?, ?, '{}', CURRENT_TIMESTAMP)");
VALUES ('epp', 300, 'WARNING', ?, ?, '{}', CURRENT_TIMESTAMP)");
$stmt->execute([
"Domain: $domainName; hostName: $hostName - duplicate mapping",
json_encode(['registrar_id' => $clid, 'domain' => $domainName, 'host' => $hostName])
@ -1736,7 +1736,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
} else {
$errorLogStmt = $db->prepare("INSERT INTO error_log
(channel, level, level_name, message, context, extra, created_at)
VALUES ('epp', 3, 'warning', :log, :context, '{}', CURRENT_TIMESTAMP)");
VALUES ('epp', 300, 'WARNING', :log, :context, '{}', CURRENT_TIMESTAMP)");
$errorLogStmt->execute([
':log' => "Domain: $domainName; hostObj: $hostObj - is duplicated",
':context' => json_encode(['registrar_id' => $clid, 'domain' => $domainName, 'host' => $hostObj])
@ -1806,7 +1806,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
// Log duplicate mapping error
$stmt = $db->prepare("INSERT INTO error_log
(channel, level, level_name, message, context, extra, created_at)
VALUES ('epp', 3, 'warning', ?, ?, '{}', CURRENT_TIMESTAMP)");
VALUES ('epp', 300, 'WARNING', ?, ?, '{}', CURRENT_TIMESTAMP)");
$stmt->execute([
"Domain: $domainName; hostName: $hostName - duplicate mapping",
json_encode(['registrar_id' => $clid, 'domain' => $domainName, 'host' => $hostName])

View file

@ -578,7 +578,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
$stmt_log = $db->prepare("INSERT INTO error_log (channel, level, level_name, message, context, extra) VALUES (?, ?, ?, ?, ?, ?)");
$stmt_log->execute([
'domain_transfer',
'manual_transfer',
250,
'NOTICE',
"Domain transfer manually approved: $domainName (New registrant: $newRegistrantId, Registrar: $reid)",
@ -730,7 +730,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
$stmt_log = $db->prepare("INSERT INTO error_log (channel, level, level_name, message, context, extra) VALUES (?, ?, ?, ?, ?, ?)");
$stmt_log->execute([
'domain_transfer',
'manual_transfer',
250,
'NOTICE',
"Domain transfer manually canceled: $domainName (Registrar: $reid)",
@ -879,7 +879,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
$stmt_log = $db->prepare("INSERT INTO error_log (channel, level, level_name, message, context, extra) VALUES (?, ?, ?, ?, ?, ?)");
$stmt_log->execute([
'domain_transfer',
'manual_transfer',
250,
'NOTICE',
"Domain transfer manually rejected: $domainName (Registrar: $reid)",

View file

@ -1537,7 +1537,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
]);
$stmt = $db->prepare("INSERT INTO error_log
(channel, level, level_name, message, context, extra, created_at)
VALUES ('epp', 3, 'warning', ?, ?, '{}', CURRENT_TIMESTAMP)");
VALUES ('epp', 300, 'WARNING', ?, ?, '{}', CURRENT_TIMESTAMP)");
$stmt->execute([$logMessage, $contextData]);
}
} else {