diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-12-29 15:18:48 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-12-29 15:18:48 -0500 |
| commit | 8a9f16ff6ae94fe1e86d93495b4908e253f7dba2 (patch) | |
| tree | 8b6b2dd44cf00eecb42fc3401aec599ca82cd146 /MediaBrowser.Server.Implementations/Session/SessionManager.cs | |
| parent | 800a16a2130ed49204a8b1358e62901077285a82 (diff) | |
enable user device access
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionManager.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 4c587d1ab..d9ec9b7e4 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -1191,6 +1191,14 @@ namespace MediaBrowser.Server.Implementations.Session var user = _userManager.Users .FirstOrDefault(i => string.Equals(request.Username, i.Name, StringComparison.OrdinalIgnoreCase)); + if (user != null && !string.IsNullOrWhiteSpace(request.DeviceId)) + { + if (!_deviceManager.CanAccessDevice(user.Id.ToString("N"), request.DeviceId)) + { + throw new UnauthorizedAccessException("User is not allowed access from this device."); + } + } + var result = await _userManager.AuthenticateUser(request.Username, request.PasswordSha1, request.PasswordMd5, request.RemoteEndPoint).ConfigureAwait(false); if (!result) |
