@@ -82,6 +82,15 @@ class Repository
|
||||
$this->db->pdo()->prepare("DELETE FROM rules WHERE id = ?")->execute([$id]);
|
||||
}
|
||||
|
||||
public function updateRule(int $id, string $name, string $pattern, string $severity, ?int $rateLimitSeconds = null, bool $active = true): Rule
|
||||
{
|
||||
$stmt = $this->db->pdo()->prepare(
|
||||
"UPDATE rules SET name = ?, pattern = ?, severity = ?, rate_limit_seconds = ?, active = ? WHERE id = ?"
|
||||
);
|
||||
$stmt->execute([$name, $pattern, $severity, $rateLimitSeconds, (int) $active, $id]);
|
||||
return $this->getRule($id);
|
||||
}
|
||||
|
||||
// --- Alerts ---
|
||||
|
||||
public function createAlert(int $ruleId, string $ruleName, string $severity, string $message, string $rawLine, ?int $sourceId = null, ?string $sourceName = null): Alert
|
||||
|
||||
Reference in New Issue
Block a user