Refactor routes and controllers for RESTful resource access

Updated controllers and routes to use RESTful resource-based URLs and parameter passing for groups, users, and notification channels. Added user isolation checks for domain and group access, ensuring proper data filtering based on isolation mode. Adjusted views to match new route structure and improved security and maintainability by removing reliance on query parameters for resource identification.
This commit is contained in:
Hosteroid
2025-10-20 21:08:09 +03:00
parent c4e4196e02
commit ac7a0c0aa8
10 changed files with 266 additions and 94 deletions

View File

@@ -63,7 +63,10 @@ class NotificationGroup extends Model
// Get domains (filtered by user if needed)
$domainModel = new Domain();
if ($userId) {
$group['domains'] = $domainModel->where('notification_group_id', $id, $userId);
$sql = "SELECT * FROM domains WHERE notification_group_id = ? AND user_id = ?";
$stmt = $this->db->prepare($sql);
$stmt->execute([$id, $userId]);
$group['domains'] = $stmt->fetchAll();
} else {
$group['domains'] = $domainModel->where('notification_group_id', $id);
}