aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-17 11:03:59 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-17 11:03:59 -0400
commit8b89d0b020c5cf060158007ba55d4dd4d62e0ebf (patch)
treeb6f31913914401b6138747e2e3cc0a6a33490792 /MediaBrowser.Server.Implementations
parent4915da4cdd9bd7de3f67fa681e06585dbbcfafdb (diff)
support remove connect user
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectManager.cs30
-rw-r--r--MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json2
2 files changed, 31 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
index c9b690086..ac8ce7638 100644
--- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
+++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
@@ -1068,7 +1068,7 @@ namespace MediaBrowser.Server.Implementations.Connect
url += "?serverId=" + ConnectServerId;
url += "&supporterKey=" + _securityManager.SupporterKey;
-
+
var options = new HttpRequestOptions
{
Url = url,
@@ -1085,6 +1085,34 @@ namespace MediaBrowser.Server.Implementations.Connect
}
}
+ public async Task RemoveConnectSupporter(string id)
+ {
+ if (!_securityManager.IsMBSupporter)
+ {
+ throw new InvalidOperationException();
+ }
+
+ var url = GetConnectUrl("keyAssociation");
+
+ url += "?serverId=" + ConnectServerId;
+ url += "&supporterKey=" + _securityManager.SupporterKey;
+ url += "&userId=" + id;
+
+ var options = new HttpRequestOptions
+ {
+ Url = url,
+ CancellationToken = CancellationToken.None
+ };
+
+ SetServerAccessToken(options);
+ SetApplicationHeader(options);
+
+ // No need to examine the response
+ using (var stream = (await _httpClient.SendAsync(options, "DELETE").ConfigureAwait(false)).Content)
+ {
+ }
+ }
+
public async Task Authenticate(string username, string passwordMd5)
{
if (string.IsNullOrWhiteSpace(username))
diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
index 9e0260f3c..d995e485f 100644
--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
@@ -38,6 +38,8 @@
"ErrorLaunchingChromecast": "There was an error launching chromecast. Please ensure your device is connected to your wireless network.",
"MessageErrorLoadingSupporterInfo": "There was an error loading supporter information. Please try again later.",
"MessageLinkYourSupporterKey": "Link your supporter key with up to {0} Media Browser Connect members to enjoy free access to the following apps:",
+ "HeaderConfirmRemoveUser": "Remove User",
+ "MessageConfirmRemoveConnectSupporter": "Are you sure you wish to remove the additional supporter benefits from this user?",
"ValueTimeLimitSingleHour": "Time limit: 1 hour",
"ValueTimeLimitMultiHour": "Time limit: {0} hours",
"PluginCategoryGeneral": "General",