Remove more Connect related stuff

This commit is contained in:
Claus Vium 2019-01-28 23:07:03 +01:00 committed by Bond-009
parent ffcf6bdd3a
commit f7a46c7a56
10 changed files with 8 additions and 138 deletions

View File

@ -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);

View File

@ -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<UpdateStartupUserResult>
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<object> 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; }
}
}

View File

@ -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;

View File

@ -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; }
}
}

View File

@ -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
{

View File

@ -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<string>();
EnabledChannels = Array.Empty<string>();
}
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -1,14 +0,0 @@
namespace MediaBrowser.Model.Connect
{
public enum UserLinkType
{
/// <summary>
/// The linked user
/// </summary>
LinkedUser = 0,
/// <summary>
/// The guest
/// </summary>
Guest = 1
}
}

View File

@ -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
/// <value>The name of the server.</value>
public string ServerName { get; set; }
/// <summary>
/// Gets or sets the name of the connect user.
/// </summary>
/// <value>The name of the connect user.</value>
public string ConnectUserName { get; set; }
/// <summary>
/// Gets or sets the connect user identifier.
/// </summary>
/// <value>The connect user identifier.</value>
public string ConnectUserId { get; set; }
/// <summary>
/// Gets or sets the type of the connect link.
/// </summary>
/// <value>The type of the connect link.</value>
public UserLinkType? ConnectLinkType { get; set; }
/// <summary>
/// Gets or sets the id.
/// </summary>