diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-14 20:05:09 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-14 20:05:09 -0400 |
| commit | bd1bd5e87e1744b363279577a6550afc5f2229c1 (patch) | |
| tree | dcee85b1a7e0d3243702a6df6cc422f45609870f /MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs | |
| parent | 52776df0129f73f7d0f87e9c51629241c5c4a7de (diff) | |
fixes #552 - Add parental control usage limits
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs index cae2cead4..ac8e37902 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs @@ -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)) |
