mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-11 12:52:15 +01:00
fixes #552 - Add parental control usage limits
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user