diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index 05fce4542..b33ae72b7 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -23,7 +23,6 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Security; using MediaBrowser.Controller.Session; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Connect; using MediaBrowser.Model.Cryptography; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; @@ -211,11 +210,8 @@ namespace Emby.Server.Implementations.Library { foreach (var user in users) { - if (!user.ConnectLinkType.HasValue || user.ConnectLinkType.Value == UserLinkType.LinkedUser) - { - user.Policy.IsAdministrator = true; - UpdateUserPolicy(user, user.Policy, false); - } + user.Policy.IsAdministrator = true; + UpdateUserPolicy(user, user.Policy, false); } } } @@ -273,13 +269,9 @@ namespace Emby.Server.Implementations.Library if (user != null) { - // Authenticate using local credentials if not a guest - if (!user.ConnectLinkType.HasValue || user.ConnectLinkType.Value != UserLinkType.Guest) - { - var authResult = await AuthenticateLocalUser(username, password, hashedPassword, user, remoteEndPoint).ConfigureAwait(false); - authenticationProvider = authResult.Item1; - success = authResult.Item2; - } + var authResult = await AuthenticateLocalUser(username, password, hashedPassword, user, remoteEndPoint).ConfigureAwait(false); + authenticationProvider = authResult.Item1; + success = authResult.Item2; } else { @@ -554,9 +546,6 @@ namespace Emby.Server.Implementations.Library LastActivityDate = user.LastActivityDate, LastLoginDate = user.LastLoginDate, Configuration = user.Configuration, - ConnectLinkType = user.ConnectLinkType, - ConnectUserId = user.ConnectUserId, - ConnectUserName = user.ConnectUserName, ServerId = _appHost.SystemId, Policy = user.Policy }; @@ -815,11 +804,6 @@ namespace Emby.Server.Implementations.Library throw new ArgumentNullException(nameof(user)); } - if (user.ConnectLinkType.HasValue && user.ConnectLinkType.Value == UserLinkType.Guest) - { - throw new ArgumentException("Passwords for guests cannot be changed."); - } - await GetAuthenticationProvider(user).ChangePassword(user, newPassword).ConfigureAwait(false); UpdateUser(user); @@ -926,11 +910,6 @@ namespace Emby.Server.Implementations.Library null : GetUserByName(enteredUsername); - if (user != null && user.ConnectLinkType.HasValue && user.ConnectLinkType.Value == UserLinkType.Guest) - { - throw new ArgumentException("Unable to process forgot password request for guests."); - } - var action = ForgotPasswordAction.InNetworkRequired; string pinFile = null; DateTime? expirationDate = null; @@ -975,10 +954,7 @@ namespace Emby.Server.Implementations.Library _lastPin = null; _lastPasswordPinCreationResult = null; - var users = Users.Where(i => !i.ConnectLinkType.HasValue || i.ConnectLinkType.Value != UserLinkType.Guest) - .ToList(); - - foreach (var user in users) + foreach (var user in Users) { await ResetPassword(user).ConfigureAwait(false); diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 3d59b4c9a..53ba7eefd 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Connect; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Net; @@ -39,7 +38,7 @@ namespace MediaBrowser.Api } [Route("/Startup/User", "POST", Summary = "Updates initial user info", IsHidden = true)] - public class UpdateStartupUser : StartupUser, IReturn + public class UpdateStartupUser : StartupUser { } @@ -102,12 +101,11 @@ namespace MediaBrowser.Api return new StartupUser { Name = user.Name, - ConnectUserName = user.ConnectUserName, Password = user.Password }; } - public async Task Post(UpdateStartupUser request) + public async Task Post(UpdateStartupUser request) { var user = _userManager.Users.First(); @@ -118,10 +116,6 @@ namespace MediaBrowser.Api if (!string.IsNullOrEmpty(request.Password)) { await _userManager.ChangePassword(user, request.Password).ConfigureAwait(false); } - - var result = new UpdateStartupUserResult(); - - return result; } } @@ -135,12 +129,6 @@ namespace MediaBrowser.Api public class StartupUser { public string Name { get; set; } - public string ConnectUserName { get; set; } public string Password { get; set; } } - - public class UpdateStartupUserResult - { - public UserLinkResult UserLinkResult { get; set; } - } } diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs index 2ef18d7cf..a6849f75f 100644 --- a/MediaBrowser.Api/UserService.cs +++ b/MediaBrowser.Api/UserService.cs @@ -10,7 +10,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Session; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Connect; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Services; using MediaBrowser.Model.Users; @@ -299,11 +298,6 @@ namespace MediaBrowser.Api users = users.Where(i => i.Policy.IsHidden == request.IsHidden.Value); } - if (request.IsGuest.HasValue) - { - users = users.Where(i => (i.ConnectLinkType.HasValue && i.ConnectLinkType.Value == UserLinkType.Guest) == request.IsGuest.Value); - } - if (filterByDevice) { var deviceId = _authContext.GetAuthorizationInfo(Request).DeviceId; diff --git a/MediaBrowser.Controller/Connect/UserLinkResult.cs b/MediaBrowser.Controller/Connect/UserLinkResult.cs deleted file mode 100644 index 327ceb952..000000000 --- a/MediaBrowser.Controller/Connect/UserLinkResult.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MediaBrowser.Controller.Connect -{ - public class UserLinkResult - { - public bool IsPending { get; set; } - public bool IsNewUserInvitation { get; set; } - public string GuestDisplayName { get; set; } - } -} diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 06bae9211..0d5f508dd 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Connect; using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; @@ -33,11 +32,6 @@ namespace MediaBrowser.Controller.Entities public string EasyPassword { get; set; } public string Salt { get; set; } - public string ConnectUserName { get; set; } - public string ConnectUserId { get; set; } - public UserLinkType? ConnectLinkType { get; set; } - public string ConnectAccessKey { get; set; } - // Strictly to remove IgnoreDataMember public override ItemImageInfo[] ImageInfos { diff --git a/MediaBrowser.Model/Connect/ConnectAuthorization.cs b/MediaBrowser.Model/Connect/ConnectAuthorization.cs deleted file mode 100644 index cdb3172d9..000000000 --- a/MediaBrowser.Model/Connect/ConnectAuthorization.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace MediaBrowser.Model.Connect -{ - public class ConnectAuthorization - { - public string ConnectUserId { get; set; } - public string UserName { get; set; } - public string ImageUrl { get; set; } - public string Id { get; set; } - public string[] EnabledLibraries { get; set; } - public bool EnableLiveTv { get; set; } - public string[] EnabledChannels { get; set; } - - public ConnectAuthorization() - { - EnabledLibraries = Array.Empty(); - EnabledChannels = Array.Empty(); - } - } -} diff --git a/MediaBrowser.Model/Connect/ConnectUser.cs b/MediaBrowser.Model/Connect/ConnectUser.cs deleted file mode 100644 index 4c536c6b0..000000000 --- a/MediaBrowser.Model/Connect/ConnectUser.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace MediaBrowser.Model.Connect -{ - public class ConnectUser - { - public string Id { get; set; } - public string Name { get; set; } - public string Email { get; set; } - public bool IsActive { get; set; } - public string ImageUrl { get; set; } - } -} diff --git a/MediaBrowser.Model/Connect/ConnectUserQuery.cs b/MediaBrowser.Model/Connect/ConnectUserQuery.cs deleted file mode 100644 index 4f04934d6..000000000 --- a/MediaBrowser.Model/Connect/ConnectUserQuery.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace MediaBrowser.Model.Connect -{ - public class ConnectUserQuery - { - public string Id { get; set; } - public string Name { get; set; } - public string Email { get; set; } - public string NameOrEmail { get; set; } - } -} diff --git a/MediaBrowser.Model/Connect/UserLinkType.cs b/MediaBrowser.Model/Connect/UserLinkType.cs deleted file mode 100644 index 19b4b67e6..000000000 --- a/MediaBrowser.Model/Connect/UserLinkType.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace MediaBrowser.Model.Connect -{ - public enum UserLinkType - { - /// - /// The linked user - /// - LinkedUser = 0, - /// - /// The guest - /// - Guest = 1 - } -} diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs index b00f5919f..13da018a6 100644 --- a/MediaBrowser.Model/Dto/UserDto.cs +++ b/MediaBrowser.Model/Dto/UserDto.cs @@ -1,6 +1,5 @@ using System; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Connect; using MediaBrowser.Model.Users; namespace MediaBrowser.Model.Dto @@ -29,22 +28,6 @@ namespace MediaBrowser.Model.Dto /// The name of the server. public string ServerName { get; set; } - /// - /// Gets or sets the name of the connect user. - /// - /// The name of the connect user. - public string ConnectUserName { get; set; } - /// - /// Gets or sets the connect user identifier. - /// - /// The connect user identifier. - public string ConnectUserId { get; set; } - /// - /// Gets or sets the type of the connect link. - /// - /// The type of the connect link. - public UserLinkType? ConnectLinkType { get; set; } - /// /// Gets or sets the id. ///