fixes #552 - Add parental control usage limits

This commit is contained in:
Luke Pulverenti
2014-10-14 20:05:09 -04:00
parent 52776df012
commit bd1bd5e87e
34 changed files with 326 additions and 94 deletions

View File

@@ -67,7 +67,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
{
if (!_config.Configuration.InsecureApps.Contains(auth.Client ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
//SessionManager.ValidateSecurityToken(auth.Token);
SessionManager.ValidateSecurityToken(auth.Token);
}
}
@@ -80,9 +80,17 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
throw new ArgumentException("User with Id " + auth.UserId + " not found");
}
if (user != null && user.Configuration.IsDisabled)
if (user != null)
{
throw new AuthenticationException("User account has been disabled.");
if (user.Configuration.IsDisabled)
{
throw new AuthenticationException("User account has been disabled.");
}
if (!user.Configuration.IsAdministrator && !user.IsParentalScheduleAllowed())
{
throw new AuthenticationException("This user account is not allowed access at this time.");
}
}
if (roles.Contains("admin", StringComparer.OrdinalIgnoreCase))