Skip to content

Commit 415abbe

Browse files
committed
fix: backward compatibility and UI improvements
- AcmeHttpPort: use string key and method_exists() for PBX < 2024.2.30 - JS: schedule button unlock via timeout instead of immediate unlock - JS: integrate event-bus for real-time certificate status updates
1 parent 1e630c5 commit 415abbe

File tree

5 files changed

+84
-7
lines changed

5 files changed

+84
-7
lines changed

Lib/AcmeHttpPort.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,22 @@ private function removeFirewallRules(): void
249249
* Checks whether firewall rules need to be managed.
250250
*
251251
* Returns true only when PBX firewall is enabled AND system can manage iptables.
252+
* Uses method_exists() for backward compatibility with PBX < 2024.2.30
253+
* where System::canManageFirewall() does not exist.
252254
*/
253255
private function isFirewallManaged(): bool
254256
{
255-
$firewallEnabled = PbxSettings::getValueByKey(PbxSettings::PBX_FIREWALL_ENABLED);
257+
// Use string key for backward compatibility with PBX < 2024.2.30
258+
// where PbxSettings::PBX_FIREWALL_ENABLED constant does not exist.
259+
$firewallEnabled = PbxSettings::getValueByKey('PBXFirewallEnabled');
256260
if ($firewallEnabled !== '1') {
257261
return false;
258262
}
259-
return System::canManageFirewall();
263+
if (method_exists(System::class, 'canManageFirewall')) {
264+
return System::canManageFirewall();
265+
}
266+
// Older PBX without container detection: assume firewall can be managed
267+
return true;
260268
}
261269

262270
/**

public/assets/js/module-get-ssl-index.js

Lines changed: 29 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)