mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
commit
92eacb9cc6
4 changed files with 26 additions and 43 deletions
8
Ombi.Api.Models/Watcher/WatcherResponse.cs
Normal file
8
Ombi.Api.Models/Watcher/WatcherResponse.cs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
using System;
|
||||||
|
namespace Ombi.Api.Models
|
||||||
|
{
|
||||||
|
public class WatcherResponse<T>
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -74,6 +74,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Array.isArray($scope.users)){
|
||||||
|
|
||||||
var existingUsername = $scope.users.some(function (u) {
|
var existingUsername = $scope.users.some(function (u) {
|
||||||
return u.username === $scope.user.username;
|
return u.username === $scope.user.username;
|
||||||
});
|
});
|
||||||
|
@ -81,6 +83,7 @@
|
||||||
if (existingUsername) {
|
if (existingUsername) {
|
||||||
return generateNotify("A user with the username " + $scope.user.username + " already exists!", 'danger');
|
return generateNotify("A user with the username " + $scope.user.username + " already exists!", 'danger');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
userManagementService.addUser($scope.user, $scope.selectedPermissions, $scope.selectedFeatures)
|
userManagementService.addUser($scope.user, $scope.selectedPermissions, $scope.selectedFeatures)
|
||||||
.then(function (data) {
|
.then(function (data) {
|
||||||
|
@ -92,6 +95,8 @@
|
||||||
clearCheckboxes();
|
clearCheckboxes();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Watch the checkboxes for updates (Creating a user)
|
// Watch the checkboxes for updates (Creating a user)
|
||||||
|
|
|
@ -86,23 +86,20 @@ namespace Ombi.UI.Modules
|
||||||
{
|
{
|
||||||
//Get Plex Users
|
//Get Plex Users
|
||||||
var plexUsers = PlexApi.GetUsers(plexSettings.PlexAuthToken);
|
var plexUsers = PlexApi.GetUsers(plexSettings.PlexAuthToken);
|
||||||
|
if (plexUsers != null && plexUsers.User != null) {
|
||||||
foreach (var u in plexUsers.User)
|
foreach (var u in plexUsers.User) {
|
||||||
{
|
|
||||||
var dbUser = plexDbUsers.FirstOrDefault (x => x.PlexUserId == u.Id);
|
var dbUser = plexDbUsers.FirstOrDefault (x => x.PlexUserId == u.Id);
|
||||||
var userDb = userLogins.FirstOrDefault (x => x.UserId == u.Id);
|
var userDb = userLogins.FirstOrDefault (x => x.UserId == u.Id);
|
||||||
|
|
||||||
// We don't have the user in the database yet
|
// We don't have the user in the database yet
|
||||||
if (dbUser == null)
|
if (dbUser == null) {
|
||||||
{
|
|
||||||
model.Add (MapPlexUser (u, null, userDb?.LastLoggedIn ?? DateTime.MinValue));
|
model.Add (MapPlexUser (u, null, userDb?.LastLoggedIn ?? DateTime.MinValue));
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// The Plex User is in the database
|
// The Plex User is in the database
|
||||||
model.Add (MapPlexUser (u, dbUser, userDb?.LastLoggedIn ?? DateTime.MinValue));
|
model.Add (MapPlexUser (u, dbUser, userDb?.LastLoggedIn ?? DateTime.MinValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Also get the server admin
|
// Also get the server admin
|
||||||
var account = PlexApi.GetAccount(plexSettings.PlexAuthToken);
|
var account = PlexApi.GetAccount(plexSettings.PlexAuthToken);
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
|
||||||
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">/************************************************************************
|
|
||||||
Copyright (c) $CURRENT_YEAR$ Jamie Rees
|
|
||||||
File: $FILENAME$
|
|
||||||
Created By: $USER_NAME$
|
|
||||||

|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||

|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||

|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
************************************************************************/
|
|
||||||
</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderRegionName/@EntryValue">Copyright</s:String></wpf:ResourceDictionary>
|
|
Loading…
Add table
Add a link
Reference in a new issue