Add premium key verification

[MAILPOET-5131]
This commit is contained in:
Brezo Cordero
2023-03-21 21:01:41 -05:00
committed by Aschepikov
parent c0eed5b919
commit fb93c73a34
4 changed files with 41 additions and 2 deletions

View File

@ -283,6 +283,11 @@ class Services extends APIEndpoint {
return $this->checkMSSKey(['key' => $key]);
}
public function refreshPremiumKeyStatus() {
$key = $this->settings->get('premium.premium_key');
return $this->checkPremiumKey(['key' => $key]);
}
private function isItemInArray($item, $array): bool {
return in_array($item, $array, true);
}

View File

@ -512,6 +512,7 @@ class Settings extends APIEndpoint {
'signup_confirmation' => [
'enabled' => '1',
],
'premium.premium_key' => $apiKey,
];
return $this->set($new_settings);
}