aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/UserManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/UserManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/UserManager.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/MediaBrowser.Server.Implementations/Library/UserManager.cs
index a001b25b6..09f060a46 100644
--- a/MediaBrowser.Server.Implementations/Library/UserManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/UserManager.cs
@@ -402,6 +402,19 @@ namespace MediaBrowser.Server.Implementations.Library
return dto;
}
+ public UserDto GetOfflineUserDto(User user, string deviceId)
+ {
+ var dto = GetUserDto(user);
+
+ var offlinePasswordHash = GetLocalPasswordHash(user);
+ dto.HasPassword = !IsPasswordEmpty(offlinePasswordHash);
+
+ // Hash the pin with the device Id to create a unique result for this device
+ dto.OfflinePassword = GetSha1String(offlinePasswordHash + deviceId);
+
+ return dto;
+ }
+
private string GetImageCacheTag(BaseItem item, ItemImageInfo image)
{
try