diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-02 14:34:08 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-02 14:34:08 -0400 |
| commit | 59dc591f66c20b6417aa2baa9503a154585386f9 (patch) | |
| tree | 68ee71de2e4162550bb95f5e661ef413ddf1e046 /MediaBrowser.Server.Implementations/Library/UserManager.cs | |
| parent | 9bab99d4d8659e69478722d72028e84b64575ab2 (diff) | |
update to jquery mobile 1.4.3
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/UserManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/UserManager.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/MediaBrowser.Server.Implementations/Library/UserManager.cs index f9d7479ce..1e0bbc39b 100644 --- a/MediaBrowser.Server.Implementations/Library/UserManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserManager.cs @@ -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)); |
