You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 61a3223
Browse filesBrowse the repository at this point in the historyBrowse files
Apply mute filter in Certificates::get_expired (fixesphpipam#42)
The $mute_clause was built but never added to the queries, so muted hosts
were still included in expiry notifications.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RuhB6rpLgBrF8dpAsSimX9
$mute_clause = $exclude_muted ? "and (h.mute = 0 or h.id is null)" : "";
115
115
// fetch
116
116
try {
117
117
// keep rows with a current host, plus host-less rows only for manually imported certs
118
118
// (a host-less non-manual cert is just a superseded/replaced scan result, not a real orphan)
119
119
$orphan_clause = "and (h.id is not null or c.is_manual = 1)";
120
120
if ($this->user->admin == "1") {
121
-
$certs = $this->Database->getObjectsQuery("select *,c.id as id,z.name as zone_name,z.private_zone_uid as private_zone_uid from certificates as c JOIN zones as z ON c.z_id = z.id JOIN tenants as t ON z.t_id = t.id LEFT JOIN hosts as h ON h.c_id = c.id where c.expires < ? and c.expires > ? $pz_clause$orphan_clause order by expires asc", [$from_date, $expired_from_date]);
121
+
$certs = $this->Database->getObjectsQuery("select *,c.id as id,z.name as zone_name,z.private_zone_uid as private_zone_uid from certificates as c JOIN zones as z ON c.z_id = z.id JOIN tenants as t ON z.t_id = t.id LEFT JOIN hosts as h ON h.c_id = c.id where c.expires < ? and c.expires > ? $pz_clause$orphan_clause$mute_clauseorder by expires asc", [$from_date, $expired_from_date]);
122
122
}
123
123
else {
124
-
$certs = $this->Database->getObjectsQuery("select *,c.id as id,z.name as zone_name,z.private_zone_uid as private_zone_uid from certificates as c JOIN zones as z ON c.z_id = z.id JOIN tenants as t ON z.t_id = t.id LEFT JOIN hosts as h ON h.c_id = c.id where t.id = ? and c.expires < ? and c.expires > ? $pz_clause$orphan_clause order by expires asc", [$this->user->t_id, $from_date, $expired_from_date]);
124
+
$certs = $this->Database->getObjectsQuery("select *,c.id as id,z.name as zone_name,z.private_zone_uid as private_zone_uid from certificates as c JOIN zones as z ON c.z_id = z.id JOIN tenants as t ON z.t_id = t.id LEFT JOIN hosts as h ON h.c_id = c.id where t.id = ? and c.expires < ? and c.expires > ? $pz_clause$orphan_clause$mute_clauseorder by expires asc", [$this->user->t_id, $from_date, $expired_from_date]);
0 commit comments