check if connect user is active

pull/702/head
Luke Pulverenti 10 years ago
parent b12215b3f9
commit 14bb0aa30c

@ -11,6 +11,7 @@ namespace MediaBrowser.Controller.Connect
public string Id { get; set; } public string Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string Email { get; set; } public string Email { get; set; }
public bool IsActive { get; set; }
} }
public class ConnectUserQuery public class ConnectUserQuery

@ -291,6 +291,11 @@ namespace MediaBrowser.Server.Implementations.Connect
}, CancellationToken.None).ConfigureAwait(false); }, CancellationToken.None).ConfigureAwait(false);
if (!connectUser.IsActive)
{
throw new ArgumentException("The Media Browser account has been disabled.");
}
var user = GetUser(userId); var user = GetUser(userId);
if (!string.IsNullOrWhiteSpace(user.ConnectUserId)) if (!string.IsNullOrWhiteSpace(user.ConnectUserId))
@ -422,7 +427,8 @@ namespace MediaBrowser.Server.Implementations.Connect
{ {
Email = response.Email, Email = response.Email,
Id = response.Id, Id = response.Id,
Name = response.Name Name = response.Name,
IsActive = response.IsActive
}; };
} }
} }

@ -22,7 +22,7 @@ namespace MediaBrowser.Server.Implementations.Connect
public string Name { get; set; } public string Name { get; set; }
public string DisplayName { get; set; } public string DisplayName { get; set; }
public string Email { get; set; } public string Email { get; set; }
public string IsActive { get; set; } public bool IsActive { get; set; }
public string ImageUrl { get; set; } public string ImageUrl { get; set; }
} }

Loading…
Cancel
Save