From 40897bac1494791e1ec6abcfe85cda27d4664a32 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 8 Nov 2014 22:18:14 -0500 Subject: fixes #941 - Rework password recovery and remove IsLocal checks --- MediaBrowser.Controller/Drawing/IImageProcessor.cs | 6 ++++++ .../Drawing/ImageProcessingOptions.cs | 8 ++------ MediaBrowser.Controller/Library/IUserManager.cs | 23 ++++++++++++++++++++++ .../Net/AuthenticatedAttribute.cs | 7 ------- MediaBrowser.Controller/Session/ISessionManager.cs | 3 +-- 5 files changed, 32 insertions(+), 15 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs index a0128f111..3bd333527 100644 --- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs +++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs @@ -89,5 +89,11 @@ namespace MediaBrowser.Controller.Drawing /// Index of the image. /// Task{System.String}. Task GetEnhancedImage(IHasImages item, ImageType imageType, int imageIndex); + + /// + /// Gets the supported image output formats. + /// + /// ImageOutputFormat[]. + ImageOutputFormat[] GetSupportedImageOutputFormats(); } } diff --git a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs index fbbf21797..b99186f37 100644 --- a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs +++ b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs @@ -1,6 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Drawing; +using System; using System.Collections.Generic; using System.IO; @@ -59,12 +60,7 @@ namespace MediaBrowser.Controller.Drawing private bool IsOutputFormatDefault(string originalImagePath) { - if (OutputFormat == ImageOutputFormat.Original) - { - return true; - } - - return string.Equals(Path.GetExtension(originalImagePath), "." + OutputFormat); + return string.Equals(Path.GetExtension(originalImagePath), "." + OutputFormat, StringComparison.OrdinalIgnoreCase); } } } diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs index 6e084e9d8..bd44f786f 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 { @@ -56,6 +57,13 @@ namespace MediaBrowser.Controller.Library /// User. User GetUserById(string id); + /// + /// Gets the name of the user by. + /// + /// The name. + /// User. + User GetUserByName(string name); + /// /// Authenticates a User and returns a result indicating whether or not it succeeded /// @@ -141,5 +149,20 @@ namespace MediaBrowser.Controller.Library /// The remote end point. /// Task<System.Boolean>. Task AuthenticateUser(string username, string passwordSha1, string passwordMd5, string remoteEndPoint); + + /// + /// Starts the forgot password process. + /// + /// The entered username. + /// if set to true [is in network]. + /// ForgotPasswordResult. + ForgotPasswordResult StartForgotPasswordProcess(string enteredUsername, bool isInNetwork); + + /// + /// Redeems the password reset pin. + /// + /// The pin. + /// true if XXXX, false otherwise. + Task RedeemPasswordResetPin(string pin); } } diff --git a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs index 83e404dfc..17c91c977 100644 --- a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs +++ b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs @@ -9,12 +9,6 @@ namespace MediaBrowser.Controller.Net { public IAuthService AuthService { get; set; } - /// - /// Gets or sets a value indicating whether or not to allow local unauthenticated access. - /// - /// true if [allow local]; otherwise, false. - public bool AllowLocal { get; set; } - /// /// Gets or sets the roles. /// @@ -70,7 +64,6 @@ namespace MediaBrowser.Controller.Net { bool EscapeParentalControl { get; } - bool AllowLocal { get; } IEnumerable GetRoles(); } } diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index c048e3fab..8bc516887 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -223,9 +223,8 @@ namespace MediaBrowser.Controller.Session /// Authenticates the new session. /// /// The request. - /// if set to true [is local]. /// Task{SessionInfo}. - Task AuthenticateNewSession(AuthenticationRequest request, bool isLocal); + Task AuthenticateNewSession(AuthenticationRequest request); /// /// Reports the capabilities. -- cgit v1.2.3