From a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Thu, 27 Dec 2018 18:27:57 -0500 Subject: Add GPL modules --- MediaBrowser.Controller/Library/IUserManager.cs | 207 ++++++++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 MediaBrowser.Controller/Library/IUserManager.cs (limited to 'MediaBrowser.Controller/Library/IUserManager.cs') diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs new file mode 100644 index 000000000..d29b164ef --- /dev/null +++ b/MediaBrowser.Controller/Library/IUserManager.cs @@ -0,0 +1,207 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Events; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Model.Users; +using MediaBrowser.Controller.Authentication; + +namespace MediaBrowser.Controller.Library +{ + /// + /// Interface IUserManager + /// + public interface IUserManager + { + /// + /// Gets the users. + /// + /// The users. + IEnumerable Users { get; } + + /// + /// Occurs when [user updated]. + /// + event EventHandler> UserUpdated; + + /// + /// Occurs when [user deleted]. + /// + event EventHandler> UserDeleted; + + event EventHandler> UserCreated; + event EventHandler> UserPolicyUpdated; + event EventHandler> UserConfigurationUpdated; + event EventHandler> UserPasswordChanged; + event EventHandler> UserLockedOut; + + /// + /// Gets a User by Id + /// + /// The id. + /// User. + /// + User GetUserById(Guid id); + + /// + /// Gets the user by identifier. + /// + /// The identifier. + /// User. + User GetUserById(string id); + + /// + /// Gets the name of the user by. + /// + /// The name. + /// User. + User GetUserByName(string name); + + /// + /// Refreshes metadata for each user + /// + /// The cancellation token. + /// Task. + Task RefreshUsersMetadata(CancellationToken cancellationToken); + + /// + /// Renames the user. + /// + /// The user. + /// The new name. + /// Task. + /// user + /// + Task RenameUser(User user, string newName); + + /// + /// Updates the user. + /// + /// The user. + /// user + /// + void UpdateUser(User user); + + /// + /// Creates the user. + /// + /// The name. + /// User. + /// name + /// + Task CreateUser(string name); + + /// + /// Deletes the user. + /// + /// The user. + /// Task. + /// user + /// + Task DeleteUser(User user); + + /// + /// Resets the password. + /// + /// The user. + /// Task. + Task ResetPassword(User user); + + /// + /// Gets the offline user dto. + /// + /// The user. + /// UserDto. + UserDto GetOfflineUserDto(User user); + + /// + /// Resets the easy password. + /// + /// The user. + /// Task. + void ResetEasyPassword(User user); + + /// + /// Changes the password. + /// + Task ChangePassword(User user, string newPassword); + + /// + /// Changes the easy password. + /// + void ChangeEasyPassword(User user, string newPassword, string newPasswordSha1); + + /// + /// Gets the user dto. + /// + /// The user. + /// The remote end point. + /// UserDto. + UserDto GetUserDto(User user, string remoteEndPoint = null); + + /// + /// Authenticates the user. + /// + Task AuthenticateUser(string username, string password, string passwordSha1, string remoteEndPoint, bool isUserSession); + + /// + /// Starts the forgot password process. + /// + /// The entered username. + /// if set to true [is in network]. + /// ForgotPasswordResult. + Task StartForgotPasswordProcess(string enteredUsername, bool isInNetwork); + + /// + /// Redeems the password reset pin. + /// + /// The pin. + /// true if XXXX, false otherwise. + Task RedeemPasswordResetPin(string pin); + + /// + /// Gets the user policy. + /// + /// The user. + /// UserPolicy. + UserPolicy GetUserPolicy(User user); + + /// + /// Gets the user configuration. + /// + /// The user. + /// UserConfiguration. + UserConfiguration GetUserConfiguration(User user); + + /// + /// Updates the configuration. + /// + /// The user identifier. + /// The new configuration. + /// Task. + void UpdateConfiguration(Guid userId, UserConfiguration newConfiguration); + + void UpdateConfiguration(User user, UserConfiguration newConfiguration); + + /// + /// Updates the user policy. + /// + /// The user identifier. + /// The user policy. + void UpdateUserPolicy(Guid userId, UserPolicy userPolicy); + + /// + /// Makes the valid username. + /// + /// The username. + /// System.String. + string MakeValidUsername(string username); + + void AddParts(IEnumerable authenticationProviders); + + NameIdPair[] GetAuthenticationProviders(); + } +} -- cgit v1.2.3