aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/System/SystemService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/System/SystemService.cs')
-rw-r--r--MediaBrowser.Api/System/SystemService.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/MediaBrowser.Api/System/SystemService.cs b/MediaBrowser.Api/System/SystemService.cs
index cae648ae0..bac99c848 100644
--- a/MediaBrowser.Api/System/SystemService.cs
+++ b/MediaBrowser.Api/System/SystemService.cs
@@ -1,8 +1,10 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
+using MediaBrowser.Common.Security;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Net;
+using MediaBrowser.Model.Entities;
using MediaBrowser.Model.System;
using ServiceStack;
using System;
@@ -42,6 +44,7 @@ namespace MediaBrowser.Api.System
/// This is currently not authenticated because the uninstaller needs to be able to shutdown the server.
/// </summary>
[Route("/System/Shutdown", "POST", Summary = "Shuts down the application")]
+ [Authenticated(AllowLocal = true)]
public class ShutdownApplication
{
}
@@ -66,6 +69,12 @@ namespace MediaBrowser.Api.System
public string Name { get; set; }
}
+ [Route("/System/SupporterInfo", "GET")]
+ [Authenticated]
+ public class GetSupporterInfo : IReturn<SupporterInfo>
+ {
+ }
+
/// <summary>
/// Class SystemInfoService
/// </summary>
@@ -80,6 +89,8 @@ namespace MediaBrowser.Api.System
private readonly INetworkManager _network;
+ private readonly ISecurityManager _security;
+
/// <summary>
/// Initializes a new instance of the <see cref="SystemService" /> class.
/// </summary>
@@ -87,12 +98,20 @@ namespace MediaBrowser.Api.System
/// <param name="appPaths">The application paths.</param>
/// <param name="fileSystem">The file system.</param>
/// <exception cref="ArgumentNullException">jsonSerializer</exception>
- public SystemService(IServerApplicationHost appHost, IApplicationPaths appPaths, IFileSystem fileSystem, INetworkManager network)
+ public SystemService(IServerApplicationHost appHost, IApplicationPaths appPaths, IFileSystem fileSystem, INetworkManager network, ISecurityManager security)
{
_appHost = appHost;
_appPaths = appPaths;
_fileSystem = fileSystem;
_network = network;
+ _security = security;
+ }
+
+ public async Task<object> Get(GetSupporterInfo request)
+ {
+ var result = await _security.GetSupporterInfo().ConfigureAwait(false);
+
+ return ToOptimizedResult(result);
}
public object Get(GetServerLogs request)