mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
fixes #2903 - MediaBrowser.Controller.Net.SecurityException: This user account is not allowed access at this time
This commit is contained in:
parent
3cdc6c5a52
commit
8d4373af5e
@ -1406,13 +1406,21 @@ namespace Emby.Server.Implementations.Session
|
|||||||
.FirstOrDefault(i => string.Equals(request.Username, i.Name, StringComparison.OrdinalIgnoreCase));
|
.FirstOrDefault(i => string.Equals(request.Username, i.Name, StringComparison.OrdinalIgnoreCase));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user != null && !string.IsNullOrWhiteSpace(request.DeviceId))
|
if (user != null)
|
||||||
|
{
|
||||||
|
if (!user.IsParentalScheduleAllowed())
|
||||||
|
{
|
||||||
|
throw new SecurityException("User is not allowed access at this time.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(request.DeviceId))
|
||||||
{
|
{
|
||||||
if (!_deviceManager.CanAccessDevice(user.Id.ToString("N"), request.DeviceId))
|
if (!_deviceManager.CanAccessDevice(user.Id.ToString("N"), request.DeviceId))
|
||||||
{
|
{
|
||||||
throw new SecurityException("User is not allowed access from this device.");
|
throw new SecurityException("User is not allowed access from this device.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (enforcePassword)
|
if (enforcePassword)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user