support adding connect user

This commit is contained in:
Luke Pulverenti
2015-03-17 11:57:06 -04:00
parent 8b89d0b020
commit d9d295251c
5 changed files with 66 additions and 1 deletions

View File

@@ -1085,6 +1085,34 @@ namespace MediaBrowser.Server.Implementations.Connect
}
}
public async Task AddConnectSupporter(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, "POST").ConfigureAwait(false)).Content)
{
}
}
public async Task RemoveConnectSupporter(string id)
{
if (!_securityManager.IsMBSupporter)

View File

@@ -50,6 +50,8 @@
"ButtonOrganize": "Organize",
"LinkedToMediaBrowserConnect": "Linked to Media Browser Connect",
"HeaderSupporterBenefits": "Supporter Benefits",
"HeaderAddUser": "Add User",
"LabelAddConnectSupporterHelp": "To add a user who isn't listed, you'll need to first link their accounts to Media Browser Connect from their user profile page.",
"LabelPinCode": "Pin code:",
"ButtonOk": "Ok",
"ButtonCancel": "Cancel",