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.
14 lines
650 B
PHP
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;
|
|
}
|
|
}
|