diff options
Diffstat (limited to 'MediaBrowser.Controller/Library/IUserManager.cs')
| -rw-r--r-- | MediaBrowser.Controller/Library/IUserManager.cs | 86 |
1 files changed, 74 insertions, 12 deletions
diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs index 3efdbea76..f5846973e 100644 --- a/MediaBrowser.Controller/Library/IUserManager.cs +++ b/MediaBrowser.Controller/Library/IUserManager.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Library { @@ -35,13 +36,6 @@ namespace MediaBrowser.Controller.Library event EventHandler<GenericEventArgs<User>> UserPasswordChanged; /// <summary> - /// Updates the configuration. - /// </summary> - /// <param name="user">The user.</param> - /// <param name="newConfiguration">The new configuration.</param> - void UpdateConfiguration(User user, UserConfiguration newConfiguration); - - /// <summary> /// Gets a User by Id /// </summary> /// <param name="id">The id.</param> @@ -55,16 +49,23 @@ namespace MediaBrowser.Controller.Library /// <param name="id">The identifier.</param> /// <returns>User.</returns> User GetUserById(string id); - + + /// <summary> + /// Gets the name of the user by. + /// </summary> + /// <param name="name">The name.</param> + /// <returns>User.</returns> + User GetUserByName(string name); + /// <summary> /// Authenticates a User and returns a result indicating whether or not it succeeded /// </summary> /// <param name="username">The username.</param> - /// <param name="password">The password.</param> + /// <param name="passwordSha1">The password sha1.</param> /// <param name="remoteEndPoint">The remote end point.</param> /// <returns>Task{System.Boolean}.</returns> /// <exception cref="System.ArgumentNullException">user</exception> - Task<bool> AuthenticateUser(string username, string password, string remoteEndPoint); + Task<bool> AuthenticateUser(string username, string passwordSha1, string remoteEndPoint); /// <summary> /// Refreshes metadata for each user @@ -120,9 +121,9 @@ namespace MediaBrowser.Controller.Library /// Changes the password. /// </summary> /// <param name="user">The user.</param> - /// <param name="newPassword">The new password.</param> + /// <param name="newPasswordSha1">The new password sha1.</param> /// <returns>Task.</returns> - Task ChangePassword(User user, string newPassword); + Task ChangePassword(User user, string newPasswordSha1); /// <summary> /// Gets the user dto. @@ -131,5 +132,66 @@ namespace MediaBrowser.Controller.Library /// <param name="remoteEndPoint">The remote end point.</param> /// <returns>UserDto.</returns> UserDto GetUserDto(User user, string remoteEndPoint = null); + + /// <summary> + /// Authenticates the user. + /// </summary> + /// <param name="username">The username.</param> + /// <param name="passwordSha1">The password sha1.</param> + /// <param name="passwordMd5">The password MD5.</param> + /// <param name="remoteEndPoint">The remote end point.</param> + /// <returns>Task<System.Boolean>.</returns> + Task<bool> AuthenticateUser(string username, string passwordSha1, string passwordMd5, string remoteEndPoint); + + /// <summary> + /// Starts the forgot password process. + /// </summary> + /// <param name="enteredUsername">The entered username.</param> + /// <param name="isInNetwork">if set to <c>true</c> [is in network].</param> + /// <returns>ForgotPasswordResult.</returns> + ForgotPasswordResult StartForgotPasswordProcess(string enteredUsername, bool isInNetwork); + + /// <summary> + /// Redeems the password reset pin. + /// </summary> + /// <param name="pin">The pin.</param> + /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> + Task<PinRedeemResult> RedeemPasswordResetPin(string pin); + + /// <summary> + /// Gets the user policy. + /// </summary> + /// <param name="user">The user.</param> + /// <returns>UserPolicy.</returns> + UserPolicy GetUserPolicy(User user); + + /// <summary> + /// Gets the user configuration. + /// </summary> + /// <param name="user">The user.</param> + /// <returns>UserConfiguration.</returns> + UserConfiguration GetUserConfiguration(User user); + + /// <summary> + /// Updates the configuration. + /// </summary> + /// <param name="userId">The user identifier.</param> + /// <param name="newConfiguration">The new configuration.</param> + /// <returns>Task.</returns> + Task UpdateConfiguration(string userId, UserConfiguration newConfiguration); + + /// <summary> + /// Updates the user policy. + /// </summary> + /// <param name="userId">The user identifier.</param> + /// <param name="userPolicy">The user policy.</param> + Task UpdateUserPolicy(string userId, UserPolicy userPolicy); + + /// <summary> + /// Makes the valid username. + /// </summary> + /// <param name="username">The username.</param> + /// <returns>System.String.</returns> + string MakeValidUsername(string username); } } |
