mirror of
https://github.com/bitwarden/server
synced 2025-12-15 15:53:59 +00:00
gateway check
This commit is contained in:
@@ -722,7 +722,7 @@ namespace Bit.Core.Services
|
|||||||
public async Task EnableAsync(Guid organizationId, DateTime? expirationDate)
|
public async Task EnableAsync(Guid organizationId, DateTime? expirationDate)
|
||||||
{
|
{
|
||||||
var org = await GetOrgById(organizationId);
|
var org = await GetOrgById(organizationId);
|
||||||
if(org != null && !org.Enabled)
|
if(org != null && !org.Enabled && org.Gateway.HasValue)
|
||||||
{
|
{
|
||||||
org.Enabled = true;
|
org.Enabled = true;
|
||||||
org.ExpirationDate = expirationDate;
|
org.ExpirationDate = expirationDate;
|
||||||
|
|||||||
@@ -830,7 +830,7 @@ namespace Bit.Core.Services
|
|||||||
|
|
||||||
public async Task EnablePremiumAsync(User user, DateTime? expirationDate)
|
public async Task EnablePremiumAsync(User user, DateTime? expirationDate)
|
||||||
{
|
{
|
||||||
if(user != null && !user.Premium)
|
if(user != null && !user.Premium && user.Gateway.HasValue)
|
||||||
{
|
{
|
||||||
user.Premium = true;
|
user.Premium = true;
|
||||||
user.PremiumExpirationDate = expirationDate;
|
user.PremiumExpirationDate = expirationDate;
|
||||||
|
|||||||
Reference in New Issue
Block a user