Files
dpl/plugins/VipLoyalty/ValidatedConfigService.php
T
hellcat 0501711267 feat(fuc-xb): prepare isolated staging theme and VIP auto upgrades
Port the Fuc 0.12.0 frontend and default-off VIP plugin. Include the previously approved password-reset token revocation. Deploy only to an independent FUC-XB test instance; no production cutover.
2026-11-04 13:44:33 +08:00

14 lines
650 B
PHP

<?php
namespace Plugin\VipLoyalty;
use App\Services\Plugin\PluginConfigService;
// Keep the native administrator plugin editor; validate only this plugin's payload.
final class ValidatedConfigService extends PluginConfigService {
public function updateConfig(string $pluginCode,array $config): bool {
if($pluginCode!=='vip_loyalty')return parent::updateConfig($pluginCode,$config);
$values=app(Settings::class)->validate(array_replace($this->getDbConfig($pluginCode),$config));
$saved=parent::updateConfig($pluginCode,$values);
if(!$values['enabled'])app(Service::class)->suspend();
return $saved;
}
}