fixes #941 - Rework password recovery and remove IsLocal checks

This commit is contained in:
Luke Pulverenti
2014-11-08 22:18:14 -05:00
parent 0ef95fb19c
commit 40897bac14
34 changed files with 445 additions and 260 deletions

View File

@@ -89,5 +89,11 @@ namespace MediaBrowser.Controller.Drawing
/// <param name="imageIndex">Index of the image.</param>
/// <returns>Task{System.String}.</returns>
Task<string> GetEnhancedImage(IHasImages item, ImageType imageType, int imageIndex);
/// <summary>
/// Gets the supported image output formats.
/// </summary>
/// <returns>ImageOutputFormat[].</returns>
ImageOutputFormat[] GetSupportedImageOutputFormats();
}
}

View File

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

View File

@@ -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
/// <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>
@@ -141,5 +149,20 @@ namespace MediaBrowser.Controller.Library
/// <param name="remoteEndPoint">The remote end point.</param>
/// <returns>Task&lt;System.Boolean&gt;.</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);
}
}

View File

@@ -9,12 +9,6 @@ namespace MediaBrowser.Controller.Net
{
public IAuthService AuthService { get; set; }
/// <summary>
/// Gets or sets a value indicating whether or not to allow local unauthenticated access.
/// </summary>
/// <value><c>true</c> if [allow local]; otherwise, <c>false</c>.</value>
public bool AllowLocal { get; set; }
/// <summary>
/// Gets or sets the roles.
/// </summary>
@@ -70,7 +64,6 @@ namespace MediaBrowser.Controller.Net
{
bool EscapeParentalControl { get; }
bool AllowLocal { get; }
IEnumerable<string> GetRoles();
}
}

View File

@@ -223,9 +223,8 @@ namespace MediaBrowser.Controller.Session
/// Authenticates the new session.
/// </summary>
/// <param name="request">The request.</param>
/// <param name="isLocal">if set to <c>true</c> [is local].</param>
/// <returns>Task{SessionInfo}.</returns>
Task<AuthenticationResult> AuthenticateNewSession(AuthenticationRequest request, bool isLocal);
Task<AuthenticationResult> AuthenticateNewSession(AuthenticationRequest request);
/// <summary>
/// Reports the capabilities.