mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-22 16:54:46 +03:00
update to jquery mobile 1.4.3
This commit is contained in:
@@ -121,17 +121,20 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
/// <summary>
|
||||
/// Authenticates a User and returns a result indicating whether or not it succeeded
|
||||
/// </summary>
|
||||
/// <param name="user">The user.</param>
|
||||
/// <param name="username">The username.</param>
|
||||
/// <param name="password">The password.</param>
|
||||
/// <returns>Task{System.Boolean}.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">user</exception>
|
||||
public async Task<bool> AuthenticateUser(User user, string password)
|
||||
/// <exception cref="System.UnauthorizedAccessException"></exception>
|
||||
public async Task<bool> AuthenticateUser(string username, string password)
|
||||
{
|
||||
if (user == null)
|
||||
if (string.IsNullOrWhiteSpace(username))
|
||||
{
|
||||
throw new ArgumentNullException("user");
|
||||
throw new ArgumentNullException("username");
|
||||
}
|
||||
|
||||
var user = Users.First(i => string.Equals(username, i.Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (user.Configuration.IsDisabled)
|
||||
{
|
||||
throw new UnauthorizedAccessException(string.Format("The {0} account is currently disabled. Please consult with your administrator.", user.Name));
|
||||
|
||||
Reference in New Issue
Block a user